Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site sri-tsc.UUCP Path: utzoo!linus!decvax!decwrl!sun!sri-terra!tsca!sri-tsc!dan From: dan@sri-tsc.UUCP (Dan Chernikoff) Newsgroups: net.bugs.2bsd Subject: bug in 2.9BSD TAR Message-ID: <2233@sri-tsc.UUCP> Date: Wed, 11-Jul-84 13:12:09 EDT Article-I.D.: sri-tsc.2233 Posted: Wed Jul 11 13:12:09 1984 Date-Received: Fri, 13-Jul-84 01:04:23 EDT Organization: SRI International Lines: 27 Subject: tar won't tar symlinks Index: cmd/tar.c 2.9bsd Description: When you try to tar a directory that contains symlinks, you get the error message "readlink: no such file or directory" for each symbolic link, and the link is not written on the tape. Note, this occurs only if the "-h" flag is NOT used, and you do NOT give an absolute pathname of the directory on the command line. Repeat-By: cd /usr tar c0 include (assuming your /usr/include has symlinks, e.g. /usr/include/net slinked to /usr/src/net). Fix: In the subroutine putfile, where tar is writing out the symlink, change the line i = readlink(longname, dblock.dbuf.linkname, NAMSIZ - 1); to be i = readlink(shortname, dblock.dbuf.linkname, NAMSIZ - 1); and all will be better.