From owner-freebsd-fs Mon Jun 26 23:44:23 2000 Delivered-To: freebsd-fs@freebsd.org Received: from gidora.zeta.org.au (gidora.zeta.org.au [203.26.10.25]) by hub.freebsd.org (Postfix) with SMTP id D700C37BFBA for ; Mon, 26 Jun 2000 23:44:17 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: (qmail 7966 invoked from network); 27 Jun 2000 06:44:14 -0000 Received: from unknown (HELO bde.zeta.org.au) (203.2.228.102) by gidora.zeta.org.au with SMTP; 27 Jun 2000 06:44:14 -0000 Date: Tue, 27 Jun 2000 16:44:11 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: clefevre@citeweb.net Cc: fs@FreeBSD.ORG, hacker@FreeBSD.ORG Subject: Re: strange symlink behaviour if / terminated In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 25 Jun 2000, Cyrille Lefevre wrote: This is mostly unstrange, intended behaviour. Putting a trailing slash on a symlink causes the symlink to be followed. However their are bugs in the slash handling code in rmdir -p. > preliminaries : > > # mkdir -p /path/name /path/to > # touch /path/name/file > # ln -s /path/name /path/to/symlink > > # mv /path/to/symlink/ /other/location > ^ note the terminating slash. > > move the target of the symlink instead of the symlink itself. > > same results w/ rm -r and cp -r. > > slightly different results w/ rm and cp. > > # rm /path/to/symlink/ > rm: /path/to/symlink/: is a directory > # cp /path/to/symlink/ /other/location > cp: /path/to/symlink/ is a directory (not copied). All normal results. > # rmdir -p /path/to/symlink/ > > remove the symlink itself instead of do nothing, such as in : > > # rmdir -p /path/to/symlink > rmdir: /path/to/symlink: Not a directory This actually (correctly) removes the directory and then apparently blunders on and attempts to remove the symlink. > also, strange output from rmdir -p : > > # mkdir -p /path/name > # rmdir -p /path/name > rmdir: : No such file or directory rmdir -p has the common bug of stripping the final "/". This bug is rarely seen since attempting to remove the root directory is a user error. > # mkdir -p /path/name/ > # rmdir -p /path/name/ > rmdir: /path/name: No such file or directory PR6521 is about at least some of these problems. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message