From owner-freebsd-hackers Sat Feb 3 18: 8:24 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.theinternet.com.au (zeus.theinternet.com.au [203.34.176.2]) by hub.freebsd.org (Postfix) with ESMTP id 188D037B503 for ; Sat, 3 Feb 2001 18:08:04 -0800 (PST) Received: (from akm@localhost) by mail.theinternet.com.au (8.9.3/8.9.3) id MAA12000; Sun, 4 Feb 2001 12:15:08 +1000 (EST) (envelope-from akm) Date: Sun, 4 Feb 2001 12:15:08 +1000 From: Andrew Kenneth Milton To: Greg Black Cc: hackers@FreeBSD.ORG Subject: Re: Trailing slashes and rmdir - POLA broken Message-ID: <20010204121508.C1511@zeus.theinternet.com.au> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: ; from Greg Black on Sun, Feb 04, 2001 at 06:46:32AM +1000 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG +-------[ Greg Black ]---------------------- | Observe the following: | | $ uname -rs | FreeBSD 4.1-RELEASE | $ ls -l | $ mkdir foo | $ ln -s foo bar | $ rmdir bar | rmdir: bar: Not a directory | | So far, so good -- but look at this: | | $ rmdir bar/ | $ ls -l | total 0 | lrwxrwx--- 1 gjb wheel 3 Feb 4 06:35 bar -> foo | $ for kicks notice the difference between cp -R foo and cp -R foo/ foo doesn't have to be a symlink. the cp manpage doesn't mention this; -R If source_file designates a directory, cp copies the directory and the entire subtree connected at that point. This option also caus- es symbolic links to be copied, rather than indirected through, and for cp to create special files rather than copying them as normal files. Created directories have the same mode as the corresponding source directory, unmodified by the process' umask. foo and foo/ both designate a directory (if foo is not a symlink). thank god for setopt auto_remove_slash in zsh d8) -- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 ABN: 83 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au| To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message