Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Jul 1995 11:40:11 -0700
From:      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
Message-ID:  <199507051840.LAA00903@freefall.cdrom.com>
In-Reply-To: Your message of Wed, 5 Jul 1995 16:44:32 GMT <199507051644.QAA00587@irs201.inf.tu-dresden.de>

next in thread | previous in thread | raw e-mail | index | archive | help

>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:





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507051840.LAA00903>