[Bug 8856] New: --hard-links does not handle hard-linked symlinks correctly on FreeBSD

Kevin Korb kmk at sanitarium.net
Tue Apr 10 20:03:05 MDT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

There is no such thing as a hard link of a symlink.  A "hard link" is
nothing more than an additional filename referencing an existing
inode.  A symlink is pointer to a link.  There is no such thing as a
filename that references a pointer to itself.

On 04/10/12 21:55, samba-bugs at samba.org wrote:
> https://bugzilla.samba.org/show_bug.cgi?id=8856
> 
> Summary: --hard-links does not handle hard-linked symlinks 
> correctly on FreeBSD Product: rsync Version: 3.0.7 Platform: All 
> OS/Version: FreeBSD Status: NEW Severity: normal Priority: P5 
> Component: core AssignedTo: wayned at samba.org ReportedBy:
> ronaldj at infoxchange.net.au QAContact: rsync-qa at samba.org
> 
> 
> Creating hard-linked symlinks fails on FreeBSD RELEASE-8.2.
> 
> Simple test case:
> 
> # uname -sr FreeBSD 8.2-RELEASE # ls -liR total 4 117761 drwxr-xr-x
> 2 root  wheel  512 Apr 11 10:31 a 117762 drwxr-xr-x  2 root  wheel
> 512 Apr 11 11:42 b
> 
> ./a: total 0 117763 -rw-r--r--  2 root  wheel  0 Apr 11 10:30 f 
> 117763 -rw-r--r--  2 root  wheel  0 Apr 11 10:30 lf 117764
> lrwxr-xr-x  2 root  wheel  1 Apr 11 10:30 ls1 -> f 117765
> lrwxr-xr-x  2 root  wheel  6 Apr 11 10:30 ls2 -> /x/y/z 117764
> lrwxr-xr-x  2 root  wheel  1 Apr 11 10:30 s1 -> f 117765 lrwxr-xr-x
> 2 root  wheel  6 Apr 11 10:30 s2 -> /x/y/z
> 
> ./b: total 0 # rsync -avH a/ b sending incremental file list ./ lf 
> s1 -> f rsync: link "/root/test/b/ls1" => s1 failed: No such file
> or directory (2) s2 -> /x/y/z rsync: link "/root/test/b/ls2" => s2
> failed: No such file or directory (2) f => lf
> 
> sent 155 bytes  received 50 bytes  410.00 bytes/sec total size is
> 14  speedup is 0.07 rsync error: some files/attrs were not
> transferred (see previous errors) (code 23) at main.c(1042)
> [sender=3.0.7] # ls -liR total 4 117761 drwxr-xr-x  2 root  wheel
> 512 Apr 11 10:31 a 117762 drwxr-xr-x  2 root  wheel  512 Apr 11
> 10:31 b
> 
> ./a: total 0 117763 -rw-r--r--  2 root  wheel  0 Apr 11 10:30 f 
> 117763 -rw-r--r--  2 root  wheel  0 Apr 11 10:30 lf 117764
> lrwxr-xr-x  2 root  wheel  1 Apr 11 10:30 ls1 -> f 117765
> lrwxr-xr-x  2 root  wheel  6 Apr 11 10:30 ls2 -> /x/y/z 117764
> lrwxr-xr-x  2 root  wheel  1 Apr 11 10:30 s1 -> f 117765 lrwxr-xr-x
> 2 root  wheel  6 Apr 11 10:30 s2 -> /x/y/z
> 
> ./b: total 0 117768 -rw-r--r--  2 root  wheel  0 Apr 11 10:30 f 
> 117768 -rw-r--r--  2 root  wheel  0 Apr 11 10:30 lf 117766
> lrwxr-xr-x  1 root  wheel  1 Apr 11 10:30 s1 -> f 117767 lrwxr-xr-x
> 1 root  wheel  6 Apr 11 10:30 s2 -> /x/y/z # rsync --version rsync
> version 3.0.7  protocol version 30 Copyright (C) 1996-2009 by
> Andrew Tridgell, Wayne Davison, and others. Web site:
> http://rsync.samba.org/ Capabilities: 64-bit files, 32-bit inums,
> 64-bit timestamps, 64-bit long ints, socketpairs, hardlinks,
> symlinks, IPv6, batchfiles, inplace, append, ACLs, xattrs, no
> iconv, symtimes
> 
> rsync comes with ABSOLUTELY NO WARRANTY.  This is free software,
> and you are welcome to redistribute it under certain conditions.
> See the GNU General Public Licence for details.
> 
> 
> So it not only doesn't hard-link the symlinks in the target
> directory, it does not even create any in the first place.
> 
> 
> Following the exact same steps on Debian squeeze for verification:
> 
> # uname -sr Linux 2.6.32-5-686-bigmem # ls -liR .: total 8 193954
> drwxr-xr-x 2 root root 4096 Apr 11 10:50 a 193955 drwxr-xr-x 2 root
> root 4096 Apr 11 11:49 b
> 
> ./a: total 0 193956 -rw-r--r-- 2 root root 0 Apr 11 10:49 f 193956
> -rw-r--r-- 2 root root 0 Apr 11 10:49 lf 193957 lrwxrwxrwx 2 root
> root 1 Apr 11 10:49 ls1 -> f 193958 lrwxrwxrwx 2 root root 6 Apr 11
> 10:49 ls2 -> /x/y/z 193957 lrwxrwxrwx 2 root root 1 Apr 11 10:49 s1
> -> f 193958 lrwxrwxrwx 2 root root 6 Apr 11 10:49 s2 -> /x/y/z
> 
> ./b: total 0 # rsync -avH a/ b sending incremental file list ./ lf 
> s1 -> f ls1 => s1 s2 -> /x/y/z ls2 => s2 f => lf
> 
> sent 175 bytes  received 70 bytes  490.00 bytes/sec total size is
> 14  speedup is 0.06 # ls -liR .: total 8 193954 drwxr-xr-x 2 root
> root 4096 Apr 11 10:50 a 193955 drwxr-xr-x 2 root root 4096 Apr 11
> 10:50 b
> 
> ./a: total 0 193956 -rw-r--r-- 2 root root 0 Apr 11 10:49 f 193956
> -rw-r--r-- 2 root root 0 Apr 11 10:49 lf 193957 lrwxrwxrwx 2 root
> root 1 Apr 11 10:49 ls1 -> f 193958 lrwxrwxrwx 2 root root 6 Apr 11
> 10:49 ls2 -> /x/y/z 193957 lrwxrwxrwx 2 root root 1 Apr 11 10:49 s1
> -> f 193958 lrwxrwxrwx 2 root root 6 Apr 11 10:49 s2 -> /x/y/z
> 
> ./b: total 0 193961 -rw-r--r-- 2 root root 0 Apr 11 10:49 f 193961
> -rw-r--r-- 2 root root 0 Apr 11 10:49 lf 193959 lrwxrwxrwx 2 root
> root 1 Apr 11 10:49 ls1 -> f 193960 lrwxrwxrwx 2 root root 6 Apr 11
> 10:49 ls2 -> /x/y/z 193959 lrwxrwxrwx 2 root root 1 Apr 11 10:49 s1
> -> f 193960 lrwxrwxrwx 2 root root 6 Apr 11 10:49 s2 -> /x/y/z #
> rsync --version rsync  version 3.0.7  protocol version 30 Copyright
> (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others. Web
> site: http://rsync.samba.org/ Capabilities: 64-bit files, 64-bit
> inums, 32-bit timestamps, 64-bit long ints, socketpairs, hardlinks,
> symlinks, IPv6, batchfiles, inplace, append, ACLs, xattrs, iconv,
> symtimes
> 
> rsync comes with ABSOLUTELY NO WARRANTY.  This is free software,
> and you are welcome to redistribute it under certain conditions.
> See the GNU General Public Licence for details.
> 
> 
> 
> Apologies if this has already been fixed or/and reported - I did
> search Bugzilla but could not find anything.
> 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
	Kevin Korb			Phone:    (407) 252-6853
	Systems Administrator		Internet:
	FutureQuest, Inc.		Kevin at FutureQuest.net  (work)
	Orlando, Florida		kmk at sanitarium.net (personal)
	Web page:			http://www.sanitarium.net/
	PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+E5lkACgkQVKC1jlbQAQft6wCfZwvUJL1gAcSRINYRCJh1iWIL
/m8AoMv8P5V0J9WbadcQP6jAU5GQbIqM
=0K7Z
-----END PGP SIGNATURE-----


More information about the rsync mailing list