Displaying 20 results from an estimated 158 matches for "maxpathlen".
2003 Aug 26
1
Tired of "filename too long"? Me too...
...iles in tmpdir...).
Anyway...
--- rsync-2.5.6-orig/receiver.c Mon Jan 20 23:32:17 2003
+++ rsync-2.5.6/receiver.c Mon Aug 25 10:13:37 2003
@@ -163,33 +163,51 @@
}
}
-
static int get_tmpname(char *fnametmp, char *fname)
{
- char *f;
+ char *f, holder;
+ size_t len;
+
+ if(strlen(fname) > MAXPATHLEN) {
+ rprintf(FERROR,"%s: filename too long\n", fname);
+ return 0;
+ }
+
+ holder = 0;
/* open tmp file */
if (tmpdir) {
+ int tlen;
f = strrchr(fname,'/');
if (f == NULL)
f = fname;
else
f++;
- if (strlen(tmpdir)+strlen(f)+10 > MAXPATHLEN) {
- rp...
2004 Sep 18
1
[LLVMdev] MAXPATHLEN' undeclared (first use this function)
.../platform/Path.cpp:23,
from /usr/local/src/llvm/lib/System/Path.cpp:27:
/usr/local/build/llvm/lib/System/platform/../Unix/Path.cpp: In member
function
`bool llvm::sys::Path::create_directory(bool)':
/usr/local/build/llvm/lib/System/platform/../Unix/Path.cpp:343: error: `
MAXPATHLEN' undeclared (first use this function)
---------------------------------
MAXPATHLEN is on Interix defined in <limits.h>.
However, it doesn't seem to have any effect including it before any other
header files in the system specific Path.cpp for Interix as seen above:
----------------...
2011 Mar 10
3
[Bug 8001] New: buffer overflow in recv_file_entry (maxpathlen doesn't works)
https://bugzilla.samba.org/show_bug.cgi?id=8001
Summary: buffer overflow in recv_file_entry (maxpathlen doesn't
works)
Product: rsync
Version: 3.0.8
Platform: All
OS/Version: FreeBSD
Status: NEW
Severity: normal
Priority: P5
Component: core
AssignedTo: wayned at samba.org
ReportedB...
2002 Jun 07
0
problem related to filename length
...sb;
+ return !statfs(path,&sb) ? sb.f_namelen : 255;
+}
static int get_tmpname(char *fnametmp, char *fname)
{
char *f;
+ int fn_max;
/* open tmp file */
if (tmpdir) {
@@ -179,7 +185,12 @@
rprintf(FERROR,"filename too long\n");
return 0;
}
- snprintf(fnametmp,MAXPATHLEN, "%s/.%s.XXXXXX",tmpdir,f);
+ fn_max = fname_syslimit(tmpdir);
+ if(strlen(f)+9 > fn_max) {
+ snprintf(fnametmp,MAXPATHLEN, "%s/%s",tmpdir,f);
+ strncpy(fnametmp + strlen(fnametmp) - 6,"XXXXXX",6);
+ }else
+ snprintf(fnametmp,MAXPATHLEN, "%s/.%s.XXX...
2012 Aug 21
5
[PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive
...CONFIG_FIEMAP
#include <linux/fiemap.h>
@@ -829,6 +830,62 @@ static int hdev_probe_device(const char *filename)
return 0;
}
+static void read_queue_limit(char *path, const char *filename, unsigned int *val)
+{
+ FILE *f;
+ char *tail = path + strlen(path);
+
+ pstrcat(path, MAXPATHLEN, filename);
+ f = fopen(path, "r");
+ if (!f) {
+ goto out;
+ }
+
+ fscanf(f, "%u", val);
+ fclose(f);
+
+out:
+ *tail = 0;
+}
+
+static void sg_get_queue_limits(BlockDriverState *bs, const char *filename)
+{
+ DIR *ffs;
+ struct dirent *d;
+ ch...
2012 Aug 21
5
[PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive
...CONFIG_FIEMAP
#include <linux/fiemap.h>
@@ -829,6 +830,62 @@ static int hdev_probe_device(const char *filename)
return 0;
}
+static void read_queue_limit(char *path, const char *filename, unsigned int *val)
+{
+ FILE *f;
+ char *tail = path + strlen(path);
+
+ pstrcat(path, MAXPATHLEN, filename);
+ f = fopen(path, "r");
+ if (!f) {
+ goto out;
+ }
+
+ fscanf(f, "%u", val);
+ fclose(f);
+
+out:
+ *tail = 0;
+}
+
+static void sg_get_queue_limits(BlockDriverState *bs, const char *filename)
+{
+ DIR *ffs;
+ struct dirent *d;
+ ch...
2001 Feb 12
1
openssh bugs in snapshot for nextstep (fwd)
I was sent this from Mark Miller. Should we be using MAXPATHLEN
instead of PATH_MAX in the upstream tree? Not all systems define
PATH_MAX.
- Ben
--- sftp-int.c.orig Sat Feb 10 13:56:08 2001
+++ sftp-int.c Sun Feb 11 23:33:26 2001
@@ -435,5 +435,5 @@
unsigned long n_arg;
Attrib a, *aa;
- char path_buf[PATH_MAX];
+ char path_bu...
2000 Jun 15
1
SCO OpenServer 5.0.5, issues with MAXPATHLEN and tty devices
...ected previous 2. versions of openssh and still
affects openssh-2.1.1p1. The environment is SCO OS 5.0.5 with
the SCO development environment (not gcc, gmake, etc.)
There are two issues, the first is a compilation problem,
and the second is a run-time problem.
The first problem is simply that MAXPATHLEN is not defined. I
found it to be defined in /usr/include/sys/fs/dtfilsys.h but I
am not sure if including this file is the correct thing to do
or not. I got around this by simply defining it as 1024 in
defines.h.
The second problem is related the tty devices chosen by the
sshd when initiat...
2000 Jun 12
1
Openssh on SCO Openserver Release 5
...fix configure.in to include
> a line for SCO similar to the line for linux --but installing autoconf on
> this box doesn't seem like fun at the moment, especially since I am
> changing jobs within the month:
>
> *-*-sco3*)
> no_dev_ptmx=1
> ;;
>
> 2. MAXPATHLEN
>
> include.h
> My SCO header files do not define the MAXPATHLEN macro, which is required
> by openssh. To rectify this, I added the following lines before the final
> endif:
> #ifndef MAXPATHLEN
> #define MAXPATHLEN 64
> #endif
> According to usr/include/li...
2008 Jan 31
1
DO NOT REPLY [Bug 5235] New: buffer overflow in receive_file_entry
...pril/012104.html
I have tested 2.6.6 and 2.6.8
This fix is for 2.6.8
The changes I have made to fix my error were in
flist.c (489.c)
static struct file_struct *receive_file_entry(struct file_list *flist, unsigned
short flags, int f)
I changed the following lines:
static char lastname[MAXPATHLEN], *lastdir;
char thisname[MAXPATHLEN];
if (l2 >= MAXPATHLEN - l1) {
to:
static char lastname[BIGPATHBUFLEN], *lastdir;
char thisname[BIGPATHBUFLEN];
if (l2 >= BIGPATHBUFLEN - l1) {
I haven't done full debugged this, but it compiles and runs, a...
2004 Sep 18
0
[LLVMdev] MAXPATHLEN' undeclared (first use this function)
>From: "Henrik Bach" <henrik_bach_llvm at hotmail.com>
>Date: Sat, 18 Sep 2004 18:46:26 +0200
>MAXPATHLEN is on Interix defined in <limits.h>.
>
>However, it doesn't seem to have any effect including it before any other
>header files in the system specific Path.cpp for Interix as seen above:
>---------------------------------
>#include <limits.h>
>
>// Include the...
2001 Jun 05
1
OpenSSH tmp cleanup
Hi,
I noticed that Markus has fixed the temporary file cleanup problems in
OpenSSH cvs. What files need patching for this ? I only noticed
changes in: session.c, channels.h and channels.c.
-Jarno
--
Jarno Huuskonen <Jarno.Huuskonen at uku.fi>
2005 Jan 05
1
rsync filename heuristics
...ty of prefix */
> + for (; *name==*basename && *name; name++, basename++)
> + score++;
> + return score;
> +}
> +
> +int open_alternate_base_fuzzy(const char *fname)
> +{
> + DIR *d;
> + struct dirent *di;
> + char *basename, *dirname;
> + char mangled_name[MAXPATHLEN];
> + char bestname[MAXPATHLEN];
> + unsigned int bestscore = 0;
> + const char *ext;
> +
> + /* FIXME: can we assume fname fits here? */
> + strcpy(mangled_name, fname);
> +
> + split_names(mangled_name, &dirname, &basename);
> + d = opendir(dirname);
> + if (...
2006 Mar 31
3
DO NOT REPLY [Bug 3649] New: buffer overflow in receive_file_entry
https://bugzilla.samba.org/show_bug.cgi?id=3649
Summary: buffer overflow in receive_file_entry
Product: rsync
Version: 2.6.0
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P3
Component: core
AssignedTo: wayned@samba.org
ReportedBy: sambesselink@planet.nl
2003 Feb 14
0
patch for krb4 authentization in openssh-3.5p1 on RH 8.0
...ror.
PATCH
*** ../openssh-3.5p1/auth-krb4.c 2002-09-27 05:26:00.000000000 +0200
--- auth-krb4.c 2003-02-12 14:52:43.000000000 +0100
***************
*** 58,63 ****
tkt_root = "/ticket/";
#endif /* AFS */
! snprintf(authctxt->krb4_ticket_file, MAXPATHLEN,
"%s%u_%ld",
tkt_root, authctxt->pw->pw_uid, (long)getpid());
krb_set_tkt_string(authctxt->krb4_ticket_file);
}
--- 58,66 ----
tkt_root = "/ticket/";
#endif /* AFS */
! char docasny[MA...
2002 Mar 27
2
rsync-2.5.4:backup.c possible bug
Hello,
I suspect a minor bug in the file rsync-2.5.4/backup.c line 206.
To identify too-long pathnames, it makes the following test:
if (strlen(backup_dir) + strlen(fname) > (MAXPATHLEN - 1))
I think that the constant subtracted off should be 2, to account both for
the forward-slash and for the trailing zero in the following snprintf
statement, line 211:
snprintf(keep_name, sizeof (keep_name), "%s/%s", backup_dir, fname);
Notice that (line 178) keep_name is an array o...
2002 Jan 27
0
IdentityFile patch
..._name,
- strlen(pw->pw_name));
- cp++;
- continue;
- }
- buffer_append(&buffer, cp, 1);
- }
- buffer_append(&buffer, "\0", 1);
-
- /*
- * Ensure that filename starts anchored. If not, be backward
- * compatible and prepend the '%h/'
- */
- file = xmalloc(MAXPATHLEN);
- cp = buffer_ptr(&buffer);
- if (*cp != '/')
- snprintf(file, MAXPATHLEN, "%s/%s", pw->pw_dir, cp);
- else
- strlcpy(file, cp, MAXPATHLEN);
-
- buffer_free(&buffer);
- return file;
-}
-
char *
authorized_keys_file(struct passwd *pw)
{
diff -ur openssh-3.0.2p1/au...
2004 Jan 24
2
[PATCH] --links-depth for rsync
...le->F_DEV = st->st_dev;
+ file->F_INODE = st->st_ino;
+ }
+ }
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
+ if (IS_DEVICE(st->st_mode))
+ file->u.rdev = st->st_rdev;
+#endif
+}
+
+#if SUPPORT_LINKS
+void links_depth(struct string_area **ap, struct file_struct * file)
+{
+ char currbuf[MAXPATHLEN], linkbuf[MAXPATHLEN];
+ STRUCT_STAT st;
+ int i;
+
+ memset(currbuf, 0, MAXPATHLEN);
+ memset(linkbuf, 0, MAXPATHLEN);
+ strncpy(currbuf, file->u.link, MAXPATHLEN);
+ for (i = 0; i < follow_links_depth; i++) {
+ if (link_stat(currbuf, &st) != 0) {
+ break;
+ }
+ if (S_ISLNK(st.st_mo...
2002 Jan 27
1
[PATCH] Add user-dependent IdentityFile to OpenSSH-3.0.2p1
..._name,
- strlen(pw->pw_name));
- cp++;
- continue;
- }
- buffer_append(&buffer, cp, 1);
- }
- buffer_append(&buffer, "\0", 1);
-
- /*
- * Ensure that filename starts anchored. If not, be backward
- * compatible and prepend the '%h/'
- */
- file = xmalloc(MAXPATHLEN);
- cp = buffer_ptr(&buffer);
- if (*cp != '/')
- snprintf(file, MAXPATHLEN, "%s/%s", pw->pw_dir, cp);
- else
- strlcpy(file, cp, MAXPATHLEN);
-
- buffer_free(&buffer);
- return file;
-}
-
char *
authorized_keys_file(struct passwd *pw)
{
diff -ur openssh-3.0.2p1/au...
2002 May 04
1
A simpler move-files patch
...,fname);
+ }
+
+ if (move_files && !dry_run) {
+ for (i = 0; i < flist->count; i++) {
+ file = flist->files[i];
+ if (S_ISDIR(file->mode) || file->flags & FLAG_NO_DELETE)
+ continue;
+ fname[0] = 0;
+ if (file->basedir) {
+ strlcpy(fname,file->basedir,MAXPATHLEN);
+ if (strlen(fname) == MAXPATHLEN-1) {
+ io_error = 1;
+ rprintf(FERROR, "send_files failed on long-named directory %s\n",
+ fname);
+ return;
+ }
+ strlcat(fname,"/",MAXPATHLEN);
+ }
+ strlcat(fname,f_name(file),MAXPATHLEN);
+ if (do_unlink(fna...