From owner-freebsd-bugs Wed Jul 5 11:40:12 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id LAA00910 for bugs-outgoing; Wed, 5 Jul 1995 11:40:12 -0700 Received: (from gnats@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id LAA00903 ; Wed, 5 Jul 1995 11:40:11 -0700 Date: Wed, 5 Jul 1995 11:40:11 -0700 Message-Id: <199507051840.LAA00903@freefall.cdrom.com> From: hohmuth@inf.tu-dresden.de Reply-To: hohmuth@inf.tu-dresden.de To: freebsd-bugs Subject: bin/594: "mkdir -p some/path/" fails to create last path component when path has trailing slash In-Reply-To: Your message of Wed, 5 Jul 1995 16:44:32 GMT <199507051644.QAA00587@irs201.inf.tu-dresden.de> Sender: bugs-owner@FreeBSD.org Precedence: bulk >Number: 594 >Category: bin >Synopsis: "mkdir -p some/path/" fails to create last path component when path has trailing slash >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs (FreeBSD bugs mailing list) >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 5 11:40:00 1995 >Originator: Michael Hohmuth >Organization: Dept. of Computer Science, TU Dresden, Germany >Release: FreeBSD 2.0-BUILT-19950603 i386 >Environment: olymp:~> uname -a FreeBSD olymp.inf.tu-dresden.de 2.0.5-RELEASE FreeBSD 2.0.5-RELEASE #0: Wed Jul 5 12:39:10 1995 root@olymp.inf.tu-dresden.de:/usr/src/sys/compile/OLYMP i386 otherwise nothing special >Description: "mkdir -p some/path/" fails to create last path component when path has trailing slash >How-To-Repeat: !10 olymp:~> /bin/mkdir -p foo/bar/ !11 olymp:~> /bin/ls -lFa foo/ total 4 drwxr-xr-x 2 hohmuth staff 512 Jul 5 16:29 ./ drwxr-xr-x 6 hohmuth staff 512 Jul 5 16:29 ../ !12 olymp:~> rm -rf foo !13 olymp:~> /bin/mkdir -p foo/bar !14 olymp:~> /bin/ls -lFa foo/ total 6 drwxr-xr-x 3 hohmuth staff 512 Jul 5 16:30 ./ drwxr-xr-x 6 hohmuth staff 512 Jul 5 16:30 ../ drwxr-xr-x 2 hohmuth staff 512 Jul 5 16:30 bar/ Note that in line "!11", the directory "foo" does not contain a directory "bar". When the directories have been created without a trailing slash ("!13"), the problem doesn't occur ("!14"). >Fix: Workaround: don't use "mkdir -p" with a trailing slash >Audit-Trail: >Unformatted: