search for: get_tmpnam

Displaying 11 results from an estimated 11 matches for "get_tmpnam".

Did you mean: get_tmpname
2010 Nov 24
3
DO NOT REPLY [Bug 7816] New: get_tmpname() can create invalid UTF-8 filenames
https://bugzilla.samba.org/show_bug.cgi?id=7816 Summary: get_tmpname() can create invalid UTF-8 filenames Product: rsync Version: 3.0.7 Platform: Sparc OS/Version: Solaris Status: NEW Severity: minor Priority: P3 Component: core AssignedTo: wayned at samba.org ReportedB...
2011 Feb 24
1
osx 10.6 strange rsync errors
...attempt is made to create a file with a leading ".." As a workaround I figured the simplest thing to do would be to ensure that rsync only ever adds a "." when creating tmp files for filenames that do not already have a leading dot. I've attached a modified version of the get_tmpname method which simply wraps the addition of a "." in an if statement. I'd like to ask the list if you think this is a likely to have any issues (eg filename comparisons relying on a dot always being added). On my system this change seems to work around the problem pretty well. Th...
2002 Jun 07
0
problem related to filename length
...5.orig/receiver.c Thu Feb 14 03:41:58 2002 +++ rsync-2.5.5/receiver.c Sat Jun 8 03:41:22 2002 @@ -163,10 +163,16 @@ } } +#include <sys/vfs.h> +static inline int fname_syslimit(const char* path) { + struct statfs 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); +...
2001 Nov 13
2
direct write patch
...truct map_struct *buf; @@ -314,6 +316,7 @@ extern int preserve_perms; extern int delete_after; struct stats initial_stats; + int write_flags; if (verbose > 2) { rprintf(FINFO,"recv_files(%d) starting\n",flist->count); @@ -404,22 +407,29 @@ buf = NULL; } - if (!get_tmpname(fnametmp,fname)) { - if (buf) unmap_file(buf); - if (fd1 != -1) close(fd1); - continue; - } + if(direct_write) { + fnametmp = fname; + write_flags = O_WRONLY|O_CREAT; + } else { + fnametmp = fnametmpbuf; + if (!get_tmpname(fnametmp,fname)) { + if (buf) unmap_file(buf); + if...
2011 Apr 05
2
osx 10.6 strange rsync errors
...h a leading ".." >> >> As a workaround I figured the simplest thing to do would be to ensure that rsync only ever adds a "." when creating tmp files for filenames that do not already have a leading dot. >> >> I've attached a modified version of the get_tmpname method which simply wraps the addition of a "." in an if statement. >> >> I'd like to ask the list if you think this is a likely to have any issues (eg filename comparisons relying on a dot always being added). >> >> On my system this change seems to work...
2004 Apr 27
1
[PATCH] Inplace option for rsync
...offset += len; } flush_write_file(fd); + if (inplace) + ftruncate(fd, offset); + if (do_progress) end_progress(total_size); @@ -410,39 +424,52 @@ } else mapbuf = NULL; - if (!get_tmpname(fnametmp,fname)) { - if (mapbuf) unmap_file(mapbuf); - if (fd1 != -1) close(fd1); - continue; - } - - strlcpy(template, fnametmp, sizeof template); + /* We now check to see if we are writing file "inplace&q...
2003 Aug 26
1
Tired of "filename too long"? Me too...
...for the filename being maintained (to restart the download? I don't know, it seems like this would fail for files 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,'/')...
2006 Sep 01
0
Add --no-tweak-hlinked, etc.
...by the same name, so it works; however, if rsync is interrupted, data is lost. Using an rsync-style temporary file would be good, but copy_file would have to be changed. It occurs to me that --copy-dest local copies should probably also use a temporary file so that replaces are atomic. However, get_tmpname is currently private to receiver.c. That brings up another good point: maybe the receiver should perform both --copy-dest and --no-tweak-hlinked local copies since they might hold up the pipeline if done in the generator. But then the generator has to somehow indicate the source of the local cop...
2014 Feb 21
1
Partial file creation tripping up on aufs volume - tries to use a reserved name
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm backing up a file named 'wh.txt' with the destination an aufs volume - rsync creates a partial filename like '.wh.txt.M8ucDx', which results in an Operation not permitted (1) error - aufs reserves '.wh.*' names for whiteout records I think. Other than ignoring the problem and using --inplace, it doesnt look like I can
2008 Oct 09
1
DO NOT REPLY [Bug 5820] New: rsync does not replace symlink atomically
...goto return_with_success; goto cleanup; + } else { + char fnametmp[MAXPATHLEN]; + + /* Replace the symlink atomically. */ + if (!get_tmpname(fnametmp, fname)) + goto cleanup; + if (!mktemp(fnametmp)) + goto cleanup; + if (do_symlink(sl, fnametmp) != 0) { + rsyserr(...
2004 Jan 19
3
Improving name-truncation detection
I've got a patch that changes f_name_to() to return an unsigned int (like snprintf() and strlcpy() do) and adds checking to ensure that we didn't overflow the name before we try to use it: http://www.blorf.net/name-overflow.patch If anyone would care to check out the following patch before I commit it, please do. ..wayne..