delorie.com/archives/browse.cgi | search |
>>> On Fri, 17 Dec 1999 19:03:12 +1100 >>> Andrew Dalgleish <andrewd AT axonet DOT com DOT au> said: > There is a bug in symlink() if "path2" (SUSV2 docs) already exists. > If path2 is already a symlink, then the target of that symlink is > replaced instead of path2. (snip) > Here is a patch to make symlink() behave correctly. > (ie return -1 and set errno to EEXIST) This patch can't affect the case path2 is a symlink of which target is lost. The following session in the latest snapshot is almost the same as your example except for the initial `touch foo'. $ ln -s foo bar $ tar cf hum bar $ ls -l lrw-r--r-- 1 fujieda Domain U 14 Dec 23 22:49 bar -> foo -rw-r--r-- 1 fujieda Domain U 10240 Dec 23 22:49 hum $ tar xf hum $ ls -l lrw-r--r-- 1 fujieda Domain U 14 Dec 23 22:49 bar -> foo lrw-r--r-- 1 fujieda Domain U 14 Dec 23 22:50 foo -> foo -rw-r--r-- 1 fujieda Domain U 10240 Dec 23 22:49 hum ____ | AIST Kazuhiro Fujieda <fujieda AT jaist DOT ac DOT jp> | HOKURIKU School of Information Science o_/ 1990 Japan Advanced Institute of Science and Technology
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |