search for: glob_t

Displaying 20 results from an estimated 48 matches for "glob_t".

2015 Sep 11
11
[Bug 2463] New: Conflict with openbsd compat glob() function in shared libraries
...ger, because I would like to express the state of things and the way how I get to this issue. Short story is that we should not override this library function in the same "namespace" where are library functions, if we are not sure the functions and types are binary compatible (on Linux, glob_t is NOT), because other shared object can expect structure with different content. The long story: Currently glob function is used only in sftp.c, and sftp-glob.c files which build together into sftp binary, where is also "packed" compat function glob making the system glob() function no...
2007 Nov 26
1
Problem with configure's detection of glob on 2.6.0 (PR#10468)
...but compilation aborts with: pgcc -I../../src/extra/zlib -I../../src/extra/bzip2 -I../../src/extra/pcre -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -Mvect=sse -Mscalarsse -Mcache_align -O2 -Kieee -c platform.c -o platform.o PGC-S-0040-Illegal use of symbol, glob_t (platform.c: 1141) PGC-W-0156-Type not specified, 'int' assumed (platform.c: 1141) PGC-W-0095-Type cast required for this conversion (platform.c: 1168) PGC/x86-64 Linux 7.0-2: compilation completed with severe errors make[3]: *** [platform.o] Error 2 Running a diff on ./src/include/config...
2002 Oct 18
1
Patch: sftp client support of "ls [flags] [path [localfile]]" feature
...name); } xfree(fname); } + if (fp) fclose(fp); free_sftp_dirents(d); return (0); } *************** *** 600,611 **** /* sftp ls.1 replacement which handles path globs */ static int do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path, ! int lflag) { glob_t g; int i; Attrib *a; struct stat sb; memset(&g, 0, sizeof(g)); --- 621,634 ---- /* sftp ls.1 replacement which handles path globs */ static int do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path, ! int lflag, char* localpath) { glob_t g; int i;...
2008 Jul 21
2
sftp needs a long time for sending a filelist
Hello all Im using sftp 1:4.7p1-8ubuntu1.2 in a batchjob Ive noticed that sftp needs a long time for sending a filelist. The timespan increases exponential if many files are on the remoteserver. for example "ls -la *.txt" needs 10 seconds for 2000 files but needs 50 seconds for 4000 files. For 150.000 Files i have to wait 15 minutes for example but the
2006 Apr 01
0
sftp tab completion patch (First release - NOT FOR INCLUDING YET)
...====================== RCS file: /cvs/src/usr.bin/ssh/sftp.c,v retrieving revision 1.80 diff -u -r1.80 sftp.c --- sftp.c 27 Mar 2006 23:15:46 -0000 1.80 +++ sftp.c 31 Mar 2006 23:31:13 -0000 @@ -64,6 +64,9 @@ int remote_glob(struct sftp_conn *, const char *, int, int (*)(const char *, int), glob_t *); /* proto for sftp-glob.c */ +/* sftp connection structure */ +struct sftp_conn *conn; + /* Separators for interactive commands */ #define WHITESPACE " \t\r\n" @@ -108,42 +111,49 @@ struct CMD { const char *c; const int n; + const int t; }; +/* Type of completion */ +#...
2007 Dec 12
0
Revisiting sftp tab completion patch
...===================== RCS file: /cvs/src/usr.bin/ssh/sftp.c,v retrieving revision 1.97 diff -u -r1.97 sftp.c --- sftp.c 24 Oct 2007 03:30:02 -0000 1.97 +++ sftp.c 12 Dec 2007 03:19:32 -0000 @@ -71,6 +71,12 @@ int remote_glob(struct sftp_conn *, const char *, int, int (*)(const char *, int), glob_t *); /* proto for sftp-glob.c */ +/* sftp connection structure */ +struct sftp_conn *conn; + +/* sftp remote path */ +char *remote_path; + /* Separators for interactive commands */ #define WHITESPACE " \t\r\n" @@ -115,42 +121,49 @@ struct CMD { const char *c; const int n; + c...
2022 Nov 11
1
Memory leak, make_absolute_pwd_glob
...pe_glob(pwd); if (p == NULL) return escpwd; - ret = make_absolute(xstrdup(p), escpwd); + ret = make_absolute(p, escpwd); free(escpwd); return ret; } @@ -641,7 +641,7 @@ process_get(struct sftp_conn *conn, const char *src, const char *dst, glob_t g; int i, r, err = 0; - abs_src = make_absolute_pwd_glob(src, pwd); + abs_src = make_absolute_pwd_glob(xstrdup(src), pwd); memset(&g, 0, sizeof(g)); debug3("Looking up %s", abs_src);
2002 Feb 14
1
HP/UX 11 bug
...e's a patch which, at least, doesn't seem to do any harm on Solaris or Linux and fixes the problem on HP. Cheers, Mark --- util.c.OLD Tue Jan 29 15:25:08 2002 +++ util.c Tue Jan 29 15:30:03 2002 @@ -542,6 +542,7 @@ return; #else extern int sanitize_paths; + int trailing_slash = 0; glob_t globbuf; int i; @@ -559,10 +560,25 @@ globfree(&globbuf); return; } - for (i=0; i<(maxargs - (*argc)) && i < (int) globbuf.gl_pathc;i++) { + + /* remember pattern's trailing '/' (HP/UX glob(3) leaves it off matches) */ + if (*(argv[*argc] + strlen(argv[*arg...
2012 Aug 30
1
Patch to allow glob patterns as authorized keys file names
...it a/auth2-pubkey.c b/auth2-pubkey.c --- a/auth2-pubkey.c +++ b/auth2-pubkey.c @@ -454,9 +454,16 @@ user_key_allowed(struct passwd *pw, Key *key) return success; for (i = 0; !success && i < options.num_authkeys_files; i++) { + int j; + glob_t glob_result; file = expand_authorized_keys( options.authorized_keys_files[i], pw); - success = user_key_allowed2(pw, key, file); + glob(file, GLOB_NOCHECK, NULL, &glob_result); + for (j = 0; !success && j <...
2009 Aug 20
2
[Bug 1634] New: [PATCH] openbsd-compat/glob.h conflicts with system glob.h
...an Chen <opensslbug0lkdsfo8hsd at spock.org> 2009-08-20 13:54:14 EST --- On FreeBSD, openbsd-compat's glob is supposed to be used used instead of the system glob, due to BROKEN_GLOB being set in configure. However, includes.h pulls in the system glob.h nonetheless, resulting in divergent glob_t definitions within openssh. On FreeBSD, this can manifest as sftp throwing a SIGBUS when a directory listing is requested. The trivial patch below fixes the problem. --- includes.h~ 2009-08-19 23:32:26.000000000 -0400 +++ includes.h 2009-08-19 23:32:53.000000000 -0400 @@ -31,7 +31,8 @@ #endif...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
..._t strtodest(const char *, const char *, int); STATIC void memtodest(const char *, size_t, const char *, int); -STATIC ssize_t varvalue(char *, int, int); +STATIC ssize_t varvalue(char *, int, int, int *); STATIC void expandmeta(struct strlist *, int); #ifdef HAVE_GLOB STATIC void addglob(const glob_t *); @@ -722,6 +722,7 @@ evalvar(char *p, int flag) ssize_t varlen; int easy; int quoted; + int nulonly; varflags = *p++; subtype = varflags & VSTYPE; @@ -732,11 +733,12 @@ evalvar(char *p, int flag) quoted = flag & EXP_QUOTED; var = p; easy = (!quoted || (*var == '@...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
..._t strtodest(const char *, const char *, int); STATIC void memtodest(const char *, size_t, const char *, int); -STATIC ssize_t varvalue(char *, int, int); +STATIC ssize_t varvalue(char *, int, int, int *); STATIC void expandmeta(struct strlist *, int); #ifdef HAVE_GLOB STATIC void addglob(const glob_t *); @@ -722,6 +722,7 @@ evalvar(char *p, int flag) ssize_t varlen; int easy; int quoted; + int nulonly; varflags = *p++; subtype = varflags & VSTYPE; @@ -732,11 +733,12 @@ evalvar(char *p, int flag) quoted = flag & EXP_QUOTED; var = p; easy = (!quoted || (*var == '@...
2001 Mar 28
0
sftp client globbing problems on Solaris, Irix, etc
...=========================================== RCS file: /var/cvs/openssh/acconfig.h,v retrieving revision 1.108 diff -u -r1.108 acconfig.h --- acconfig.h 2001/03/17 01:15:38 1.108 +++ acconfig.h 2001/03/28 03:28:37 @@ -308,6 +308,9 @@ /* Define if your system glob() function has gl_matchc options in glob_t */ #undef GLOB_HAS_GL_MATCHC +/* Define in your struct dirent expects you to allocate extra space for d_name */ +#undef BROKEN_ONE_BYTE_DIRENT_D_NAME + @BOTTOM@ /* ******************* Shouldn't need to edit below this line ************** */ Index: configure.in =============================...
2016 Feb 03
0
[PATCH 2/3] daemon: glob: add option for not returning dirs with trailing slash
...tions(-) diff --git a/daemon/glob.c b/daemon/glob.c index 45fb30f..de615ee 100644 --- a/daemon/glob.c +++ b/daemon/glob.c @@ -26,14 +26,18 @@ #include "actions.h" char ** -do_glob_expand (const char *pattern) +do_glob_expand (const char *pattern, int nodirectoryslash) { int r; glob_t buf = { .gl_pathc = 0, .gl_pathv = NULL, .gl_offs = 0 }; + int flags = GLOB_BRACE; + + if (!nodirectoryslash) + flags |= GLOB_MARK; /* glob(3) in glibc never calls chdir, so this seems to be safe: */ CHROOT_IN; - r = glob (pattern, GLOB_MARK|GLOB_BRACE, NULL, &buf); + r = glob (p...
2019 Jan 25
0
[klibc:update-dash] expand: Fix buffer overflow in expandmeta
...---- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index 974a31de..f52f34c9 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -124,7 +124,7 @@ STATIC void expandmeta(struct strlist *, int); #ifdef HAVE_GLOB STATIC void addglob(const glob_t *); #else -STATIC void expmeta(char *, char *); +STATIC void expmeta(char *, unsigned, unsigned); STATIC struct strlist *expsort(struct strlist *); STATIC struct strlist *msort(struct strlist *, int); #endif @@ -1246,6 +1246,7 @@ addglob(pglob) #else /* HAVE_GLOB */ STATIC char *expdir; +ST...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix buffer overflow in expandmeta
...---- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index 974a31de..f52f34c9 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -124,7 +124,7 @@ STATIC void expandmeta(struct strlist *, int); #ifdef HAVE_GLOB STATIC void addglob(const glob_t *); #else -STATIC void expmeta(char *, char *); +STATIC void expmeta(char *, unsigned, unsigned); STATIC struct strlist *expsort(struct strlist *); STATIC struct strlist *msort(struct strlist *, int); #endif @@ -1246,6 +1246,7 @@ addglob(pglob) #else /* HAVE_GLOB */ STATIC char *expdir; +ST...
2016 Jul 07
0
[PATCH 2/2] daemon: fix cleanup of stringsbuf usages
...a/daemon/ldm.c b/daemon/ldm.c index 71cdf46..0636082 100644 --- a/daemon/ldm.c +++ b/daemon/ldm.c @@ -50,7 +50,7 @@ glob_errfunc (const char *epath, int eerrno) static char ** get_devices (const char *pattern) { - DECLARE_STRINGSBUF (ret); + CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (ret); glob_t devs; int err; size_t i; @@ -76,12 +76,10 @@ get_devices (const char *pattern) if (end_stringsbuf (&ret) == -1) goto error; globfree (&devs); - return ret.argv; + return take_stringsbuf (&ret); error: globfree (&devs); - if (ret.argv != NULL) - free_string...
2019 Jan 25
0
[klibc:update-dash] expand: Fix ghost fields with unquoted $@/$*
...rtodest(const char *, const char *, int); STATIC void memtodest(const char *, size_t, const char *, int); -STATIC ssize_t varvalue(char *, int, int, int *); +STATIC ssize_t varvalue(char *, int, int, int); STATIC void expandmeta(struct strlist *, int); #ifdef HAVE_GLOB STATIC void addglob(const glob_t *); @@ -712,7 +712,6 @@ evalvar(char *p, int flag) int c; int startloc; ssize_t varlen; - int easy; int quoted; varflags = *p++; @@ -723,12 +722,11 @@ evalvar(char *p, int flag) quoted = flag & EXP_QUOTED; var = p; - easy = (!quoted || (*var == '@' && shellpara...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix ghost fields with unquoted $@/$*
...rtodest(const char *, const char *, int); STATIC void memtodest(const char *, size_t, const char *, int); -STATIC ssize_t varvalue(char *, int, int, int *); +STATIC ssize_t varvalue(char *, int, int, int); STATIC void expandmeta(struct strlist *, int); #ifdef HAVE_GLOB STATIC void addglob(const glob_t *); @@ -712,7 +712,6 @@ evalvar(char *p, int flag) int c; int startloc; ssize_t varlen; - int easy; int quoted; varflags = *p++; @@ -723,12 +722,11 @@ evalvar(char *p, int flag) quoted = flag & EXP_QUOTED; var = p; - easy = (!quoted || (*var == '@' && shellpara...
2017 Jul 14
0
[PATCH 13/27] daemon: Reimplement ‘list_ldm_(volumes|partitions)’ APIs in OCaml.
...(str_ldmtool); } -static int -glob_errfunc (const char *epath, int eerrno) -{ - fprintf (stderr, "glob: failure reading %s: %s\n", epath, strerror (eerrno)); - return 1; -} - -static char ** -get_devices (const char *pattern) -{ - CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (ret); - glob_t devs; - int err; - size_t i; - - memset (&devs, 0, sizeof devs); - - err = glob (pattern, GLOB_ERR, glob_errfunc, &devs); - if (err == GLOB_NOSPACE) { - reply_with_error ("glob: returned GLOB_NOSPACE: " - "rerun with LIBGUESTFS_DEBUG=1"); -...