search for: robust_unlink

Displaying 14 results from an estimated 14 matches for "robust_unlink".

2003 Sep 03
1
[patch] replace dir with file error
Hit the "not a regular file (recv_files)" error last night having replaced a directory with a file. The really dumb part is that this was hit doing a link-dest on an empty destination so the robust_unlink would have presented no problem anyway. I can see no reason why non-directory special files should have any problem being replaced so i've changed that logic too. The new code simply treats old non-directory special files as though they were non-existent and the same for directories if they a...
2004 Feb 17
1
[patch] Make robust_rename() handle EXDEV.
...util.c 2004-02-17 09:58:44.000000000 -0500 +++ util.c 2004-02-17 10:21:22.000000000 -0500 @@ -355,16 +355,40 @@ int robust_rename(char *from, char *to) { -#ifndef ETXTBSY - return do_rename(from, to); -#else - int rc = do_rename(from, to); - if (rc == 0 || errno != ETXTBSY) - return rc; - if (robust_unlink(to) != 0) - return -1; - return do_rename(from, to); + int do_copy = 0, tries = 4, rc; + STRUCT_STAT st; + while (tries--) { + if (do_copy) { + rc = copy_file(from, to, st.st_mode); + if (rc == 0) { + do_unlink(from); + } + } else { + rc = do_rename(from, to); + } + + if (rc == 0) +...
2013 Aug 12
2
[Bug 10081] New: Multiple rsync instances conflict
...rtedBy: xaionaro at gmail.com QAContact: rsync-qa at samba.org When running multiple instances of rsync with "--backup" option on same file (for example in case of intersecting include-files), few of them can exit with exitcode "23". It happens due to nonatomicity of robust_unlink()&do_open() operation in copy_file(). While one of instances is proceeding between robust_unlink() and do_open(), another instance can run do_open(). So the first instance will fail on do_open() due to flag "O_EXCL". I suggest to remove the flag "O_EXCL" if copy_file() is c...
2004 Mar 22
2
orphan dirs and files with --delete
...s with the w bit cleared. (example below) Rsync will sync a dir with w bit clear, but will not remove it with --delete. This is not a big problem, but it will create situations where there are 'orphaned' files. Has anyone else had this problem? It looks like a change would be needed in robust_unlink (util.c). This function would have to do a chmod on dirs that are locked down before it does the unlink. (syncing as user root doesn't have this problem) The CHECK_RO macro in syscall.c only checks for file being RO. It doesn't check for the dir being RO. eric here is an example: COMMA...
2002 Sep 10
0
[PATCH] Add --preserve-atime switch to rsync
...**** *** 233,239 **** pid_t local_child(int argc, char **argv,int *f_in,int *f_out); void out_of_memory(char *str); void overflow(char *str); ! int set_modtime(char *fname, time_t modtime); int create_directory_path(char *fname); int copy_file(char *source, char *dest, mode_t mode); int robust_unlink(char *fname); --- 233,239 ---- pid_t local_child(int argc, char **argv,int *f_in,int *f_out); void out_of_memory(char *str); void overflow(char *str); ! int set_modtime(char *fname,time_t modtime,time_t acctime); int create_directory_path(char *fname); int copy_file(char *source, char *de...
2013 Oct 24
0
patch for combining detect-renamed and fileflags patches (fwd)
...time_t modtime, uint32 mod_nsec, mode_t mode, uint32 fileflags); -int make_path(char *fname, int flags); +int make_path(char *fname, mode_t mode, int flags); int full_write(int desc, const char *ptr, size_t len); int copy_file(const char *source, const char *dest, int ofd, mode_t mode); int robust_unlink(const char *fname); -@@ -373,6 +374,8 @@ char *sanitize_path(char *dest, const ch +@@ -376,6 +377,8 @@ int flags); int change_dir(const char *dir, int set_path_only); char *normalize_path(char *path, BOOL force_newbuf, unsigned int *len_ptr);
2006 Mar 09
2
DO NOT REPLY [Bug 3594] New: --delete doesn't delete destination files that don't exist at the source
https://bugzilla.samba.org/show_bug.cgi?id=3594 Summary: --delete doesn't delete destination files that don't exist at the source Product: rsync Version: 2.6.7 Platform: PPC OS/Version: Mac OS X Status: NEW Severity: normal Priority: P3 Component: core AssignedTo:
2002 Apr 03
3
metadata in dryrun mode
As I reported a while back rsync doesn't handle metadata (permissions and ownership) in dryrun mode. I offered to make a patch and that offer still stands. I didn't have the time for it until now and want to pick it up again. I had some ugly hack back then but I want to redo it in a clean way. I would like some input on my thoughts. IMHO, it would be ideally if the check for dry_run
2003 Sep 05
1
new option suggestion '--backup-only'
...et == 0 && !preserve_perms && (S_ISDIR(st.st_mode) == S_ISDIR(file->mode))) { @@ -313,6 +317,8 @@ if (dry_run) return; /* XXXX -- might cause inaccuracies?? -- mbp */ if (statret == 0 && !S_ISDIR(st.st_mode)) { + if (backup_only) + return; if (robust_unlink(fname) != 0) { rprintf(FERROR, RSYNC_NAME ": recv_generator: unlink \"%s\" to make room for directory: %s\n", @@ -321,6 +327,8 @@ } statret = -1; } + if (backup_only) + return; if (statret != 0 && do_mkdir(fname,file->mode) != 0 &&...
2004 Apr 10
0
patches for copying atimes
...argv(char **cmd); void out_of_memory(char *str); void overflow(char *str); -int set_modtime(char *fname, time_t modtime); +int set_times(char *fname, time_t modtime, time_t atime); int create_directory_path(char *fname, int base_umask); int copy_file(char *source, char *dest, mode_t mode); int robust_unlink(char *fname); @@ -268,7 +268,7 @@ int unsafe_symlink(const char *dest, const char *src); char *timestring(time_t t); int msleep(int t); -int cmp_modtime(time_t file1, time_t file2); +int cmp_time(time_t file1, time_t file2); int _Insure_trap_error(int a1, int a2, int a3, int a4, int a5, int a6)...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 4).
...linkname = %s\n", linkname); + rprintf(FINFO,"link-by-hash: max link count exceeded, starting new file \"%s\".\n", linkname); + } else { + rprintf(FERROR,"link \"%s\" -> %s: %s\n", + linkname,full_fname(fname), + strerror(errno)); + robust_unlink(fname); + rc = robust_rename(fnametmp,fname,0644); + } + } else { + do_unlink(fnametmp); + } + } + + if (first) { + rprintf(FINFO, "link-by-hash (new): %s -> \"%s\"\n", + full_fname(fname),linkname); + + rc = robust_rename(fnametmp,fname,0644); + if (rc != 0) {...
2004 Feb 17
0
[patch] Add `--link-by-hash' option (rev 3).
...linkname = %s\n", linkname); + rprintf(FINFO,"link-by-hash: max link count exceeded, starting new file \"%s\".\n", linkname); + } else { + rprintf(FERROR,"link \"%s\" -> %s: %s\n", + linkname,full_fname(fname), + strerror(errno)); + robust_unlink(fname); + rc = robust_rename(fnametmp,fname); + } + } else { + do_unlink(fnametmp); + } + } + + if (first) { + rprintf(FINFO, "link-by-hash (new): %s -> \"%s\"\n", + full_fname(fname),linkname); + + rc = robust_rename(fnametmp,fname); + if (rc != 0) { + rprin...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 5).
...linkname = %s\n", linkname); + rprintf(FINFO,"link-by-hash: max link count exceeded, starting new file \"%s\".\n", linkname); + } else { + rprintf(FERROR,"link \"%s\" -> %s: %s\n", + linkname,full_fname(fname), + strerror(errno)); + robust_unlink(fname); + rc = robust_rename(fnametmp,fname,0644); + } + } else { + do_unlink(fnametmp); + } + } + + if (first) { + rprintf(FINFO, "link-by-hash (new): %s -> \"%s\"\n", + full_fname(fname),linkname); + + rc = robust_rename(fnametmp,fname,0644); + if (rc != 0) {...
2004 Apr 20
1
improved atime patch
...argv(char **cmd); void out_of_memory(char *str); void overflow(char *str); -int set_modtime(char *fname, time_t modtime); +int set_times(char *fname, time_t modtime, time_t atime); int create_directory_path(char *fname, int base_umask); int copy_file(char *source, char *dest, mode_t mode); int robust_unlink(char *fname); @@ -267,7 +267,7 @@ int unsafe_symlink(const char *dest, const char *src); char *timestring(time_t t); int msleep(int t); -int cmp_modtime(time_t file1, time_t file2); +int cmp_time(time_t file1, time_t file2); int _Insure_trap_error(int a1, int a2, int a3, int a4, int a5, int a6)...