search for: do_link

Displaying 17 results from an estimated 17 matches for "do_link".

Did you mean: db_link
2012 May 07
0
Solved problem with hard links and schg flag under FreeBSD
...d files having schg set result in EPERM "Operation not permitted". This behavior can be observed if rsyncing /usr/bin/. The patch fileflags.diff tries to deal with this situation but changes the flags of the parent directory only. It doesn't change the flags of the files itself. do_link() in syscall.c has to be fixed. The attached syscall-do_link.c.txt contains the complete function do_link(). patch-syscall.c.txt is a patch which have the be applied after fileflags.diff. Please have a look at the changes. What is the "official" way of asking for inclusion in the rsy...
2009 Feb 12
2
[patch] hard link protocol extension for sftp
...p(value, "1") == 0) { + exts |= SFTP_EXT_LINK; + known = 1; } if (known) { debug2("Server supports extension \"%s\" revision %s", @@ -731,6 +736,39 @@ do_rename(struct sftp_conn *conn, char * newpath, fx2txt(status)); return(status); +} + +int +do_link(struct sftp_conn *conn, char *oldpath, char *newpath) +{ + Buffer msg; + u_int status, id; + + buffer_init(&msg); + + /* Send link request */ + id = conn->msg_id++; + if ((conn->exts & SFTP_EXT_LINK) == 0) { + error("Server does not support link at openssh.com extension");...
2002 Jan 07
0
rsync-2.5.1 / updated syscall.c "const" patch
...CHECK_RO return unlink(fname); } -int do_symlink(char *fname1, char *fname2) +#if SUPPORT_LINKS +int do_symlink(const char *fname1, const char *fname2) { if (dry_run) return 0; CHECK_RO return symlink(fname1, fname2); } +#endif -#if HAVE_LINK -int do_link(char *fname1, char *fname2) +#if SUPPORT_HARD_LINKS +int do_link(const char *fname1, const char *fname2) { if (dry_run) return 0; CHECK_RO @@ -58,8 +61,8 @@ return lchown(path, owner, group); } -#if HAVE_MKNOD -int do_mknod(char *pathname, mode_t mode, dev_t dev) +#i...
2002 Aug 02
1
[patch] --link-dest
...+ return 0; + } + } + /* if always checksum is set then we use the checksum instead of the file time to determine whether to sync */ @@ -356,6 +366,18 @@ statret = -1; if (statret == -1) errno = saveerrno; +#if HAVE_LINK + else if (link_dest && !dry_run) { + if (do_link(fnamecmpbuf, fname) != 0) { + if (verbose > 0) + rprintf(FINFO,"link %s => %s : %s\n", + fnamecmpbuf, + fname, + strerror(errno)); + } + fnamecmp = fnamecmpbuf; + } +#endif else fnamecmp = fnamecmpbuf; } Index: options.c ==========================...
2002 Feb 14
1
[BUG] [PATCH]: handling bad inodes in 2.4.x kernels
...x-2.4.17-uml/fs/namei.c Fri Feb 8 02:53:36 2002 @@ -1052,6 +1052,11 @@ error = -ENOENT; if (!dentry->d_inode) goto exit_dput; + + error = -EIO; + if (is_bad_inode(dentry->d_inode)) + goto exit_dput; + if (dentry->d_inode->i_op && dentry->d_inode->i_op->follow_link) goto do_link; an open() does not make any sense on a bad inode so i see no reason for not breaking the branch at this point. any comments? please let me know if you're able to trigger this effect on older 2.4 kernels. btw, version 2.2.19 is not tainted. greets, daniel --
2003 Oct 18
0
Added functionality --compare-file and --compare-auto
...AXPATHLEN,"%s/%s",compare_dest,fname); - statret = link_stat(fnamecmpbuf,&st); + statret = link_stat(compare_file,&st); if (!S_ISREG(st.st_mode)) statret = -1; if (statret == -1) errno = saveerrno; #if HAVE_LINK else if (link_dest && !dry_run) { - if (do_link(fnamecmpbuf, fname) != 0) { + if (do_link(compare_file, fname) != 0) { if (verbose > 0) rprintf(FINFO,"link %s => %s : %s\n", - fnamecmpbuf, + compare_file, fname, strerror(errno)); } - fnamecmp = fnamecmpbuf; + fnamecmp = compare_file;...
2004 Feb 09
1
[patch] Add `--link-by-hash' option.
...(fd, hashfiles); + hashfiles = NULL; + + if (hashfile) { + first = 0; + linkname = strdup(hashfile->name); + kill_hashfile(hashfile); + } else { + first = 1; + asprintf(&linkname, "%s/%ld", hashname, + last_fnbr + 1); + } + } + } + + if (first) { + if (do_link(fname, linkname) == -1) { + rprintf(FERROR,"link \"%s\" -> \"%s\": %s\n", + full_fname(fname),linkname, + strerror(errno)); + } + } else { + if (do_unlink(fname) == -1) { + rprintf(FERROR,"unlink \"%s\": %s\n", + full_fname(fname),...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 4).
...sprintf(&linkname, "%s/%ld", hashname, + last_fnbr + 1); + rprintf(FINFO, "(4) linkname = %s\n", linkname); + } + } + } + + if (!first) { + rprintf(FINFO, "link-by-hash (existing): \"%s\" -> %s\n", + linkname, full_fname(fname)); + rc = do_link(linkname, fname); + if (rc == -1) { + if (errno == EMLINK) { + first = 1; + free(linkname); + asprintf(&linkname,"%s/%ld",hashname, + last_fnbr + 1); + rprintf(FINFO, "(5) linkname = %s\n", linkname); + rprintf(FINFO,"link-by-hash: max link count...
2004 Feb 17
0
[patch] Add `--link-by-hash' option (rev 3).
...sprintf(&linkname, "%s/%ld", hashname, + last_fnbr + 1); + rprintf(FINFO, "(4) linkname = %s\n", linkname); + } + } + } + + if (!first) { + rprintf(FINFO, "link-by-hash (existing): \"%s\" -> %s\n", + linkname, full_fname(fname)); + rc = do_link(linkname, fname); + if (rc == -1) { + if (errno == EMLINK) { + first = 1; + free(linkname); + asprintf(&linkname,"%s/%ld",hashname, + last_fnbr + 1); + rprintf(FINFO, "(5) linkname = %s\n", linkname); + rprintf(FINFO,"link-by-hash: max link count...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 5).
...sprintf(&linkname, "%s/%ld", hashname, + last_fnbr + 1); + rprintf(FINFO, "(4) linkname = %s\n", linkname); + } + } + } + + if (!first) { + rprintf(FINFO, "link-by-hash (existing): \"%s\" -> %s\n", + linkname, full_fname(fname)); + rc = do_link(linkname, fname); + if (rc == -1) { + if (errno == EMLINK) { + first = 1; + free(linkname); + asprintf(&linkname,"%s/%ld",hashname, + last_fnbr + 1); + rprintf(FINFO, "(5) linkname = %s\n", linkname); + rprintf(FINFO,"link-by-hash: max link count...
2004 Feb 16
1
[patch] Add `--link-by-hash' option (rev 2).
...name); + kill_hashfile(hashfile); + } else { + first = 1; + asprintf(&linkname, "%s/%ld", hashname, + last_fnbr + 1); + } + } + } + + if (first) { + rprintf(FINFO, "link-by-hash (new): %s -> \"%s\"\n", + full_fname(fname),linkname); + if (do_link(fname, linkname) == -1) { + rprintf(FERROR,"link \"%s\" -> \"%s\": %s\n", + full_fname(fname),linkname, + strerror(errno)); + } + } else { + rprintf(FINFO, "link-by-hash (existing): \"%s\" -> %s\n", + linkname, full_fname(fname));...
2004 Mar 15
2
'Invalid cross-device link' message on sparc
...6 (0x70064000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x70000000) /tmp is on a SCSI hard disk. Any hints, any ideas what might go wrong? Btw. I had a look at the code in generator.c. Wouldn't it be a good idea to report a critical error and not only a message in verbose mode if do_link fails? bye, Werner Augustin
2002 Mar 08
1
[PATCH][RFC] space saving incrementals
..._gid != file->gid) { + return 0; + } + } + /* if always checksum is set then we use the checksum instead of the file time to determine whether to sync */ @@ -352,6 +363,17 @@ statret = -1; if (statret == -1) errno = saveerrno; +#if HAVE_LINK + else if (link_dest) + if (do_link(fnamecmpbuf, fname) != 0) { + if (verbose > 0) + rprintf(FINFO,"link %s => %s : %s\n", + fnamecmpbuf, + fname, + strerror(errno)); + fnamecmp = fnamecmpbuf; + } +#endif else fnamecmp = fnamecmpbuf; } Index: options.c =====================================...
2002 Mar 22
1
[PATCH] --link-dest option
..._gid != file->gid) { + return 0; + } + } + /* if always checksum is set then we use the checksum instead of the file time to determine whether to sync */ @@ -382,6 +392,17 @@ statret = -1; if (statret == -1) errno = saveerrno; +#if HAVE_LINK + else if (link_dest) + if (do_link(fnamecmpbuf, fname) != 0) { + if (verbose > 0) + rprintf(FINFO,"link %s => %s : %s\n", + fnamecmpbuf, + fname, + strerror(errno)); + fnamecmp = fnamecmpbuf; + } +#endif else fnamecmp = fnamecmpbuf; } Index: options.c =====================================...
2006 Sep 04
7
DO NOT REPLY [Bug 4079] New: rsync fails with --inplace, --link-dest and --no-whole-file
https://bugzilla.samba.org/show_bug.cgi?id=4079 Summary: rsync fails with --inplace, --link-dest and --no-whole- file Product: rsync Version: 2.6.8 Platform: x86 OS/Version: Linux Status: NEW Severity: major Priority: P3 Component: core AssignedTo: wayned@samba.org
2008 Mar 04
1
Several changes missing from [HEAD] fileflags.diff
...file_struct *file, > stat_x *sxp, > const char *fnamecmp, int flags); > RETSIGTYPE sig_int(UNUSED(int val)); > @@ -293,11 +295,12 @@ int sock_exec(const char *prog); > int do_unlink(const char *fname); > int do_symlink(const char *fname1, const char *fname2); > int do_link(const char *fname1, const char *fname2); > -int do_lchown(const char *path, uid_t owner, gid_t group); > +int do_lchown(const char *path, uid_t owner, gid_t group, mode_t > mode, uint32 fileflags); > int do_mknod(const char *pathname, mode_t mode, dev_t dev); > int do_rmdir(const...
2008 Feb 15
4
Revised flags patch
...6 +389,12 @@ int hard_link_check(struct file_struct * int hard_link_one(struct file_struct *file, const char *fname, const char *oldname, int terse) { +#if SUPPORT_FLAGS + STRUCT_STAT st2; + + link_stat(oldname, &st2, 0); + make_mutable(oldname, st2.st_mode, st2.st_flags); +#endif if (do_link(oldname, fname) < 0) { enum logcode code; if (terse) { @@ -401,6 +407,9 @@ int hard_link_one(struct file_struct *fi full_fname(fname), oldname); return 0; } +#if SUPPORT_FLAGS + undo_make_mutable(oldname, st2.st_mode, st2.st_flags); +#endif file->flags |= FLAG_HLINK_DONE;...