NetBSD Problem Report #8155

Received: (qmail 20439 invoked from network); 6 Aug 1999 12:52:10 -0000
Message-Id: <199908061251.OAA10101@rfhpc8002.fh-regensburg.de>
Date: Fri, 6 Aug 1999 14:51:55 +0200 (MEST)
From: Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de>
Reply-To: hubert.feyrer@rz.uni-regensburg.de
To: gnats-bugs@gnats.netbsd.org
Subject: mkdir(1) and mkdir(2) behave different w/ trailing "/"
X-Send-Pr-Version: 3.95

>Number:         8155
>Category:       kern
>Synopsis:       mkdir(1) and mkdir(2) behave different w/ trailing "/"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 06 06:05:00 +0000 1999
>Closed-Date:    Thu Sep 11 17:49:02 +0000 2003
>Last-Modified:  Thu Sep 11 17:49:02 +0000 2003
>Originator:     Hubert Feyrer
>Release:        1.4
>Organization:
Hubert Feyrer <hubertf@channel.regensburg.org>
>Environment:

System: NetBSD yui 1.4 NetBSD 1.4 (YUI) #22: Thu May 6 16:35:01 MEST 1999 feyrer@yui:/usr/cvs/src-1.4/sys/arch/i386/compile/YUI i386

	mkdir(1) checked in current as of 19990806

>Description:
	mkdir(2) will fail if given "foo/", mkdir(1) won't:

  9672 myth2_demo_2.1 CALL  mkdir(0x8307840,0x1c0)
  9672 myth2_demo_2.1 NAMI  "./.loki/"
  9672 myth2_demo_2.1 RET   mkdir -1 errno -2 No such file or directory

% ls -lad ./.loki
ls: ./.loki: No such file or directory
yui% mkdir ./.loki/



>How-To-Repeat:
	Try myth2-demo (http://209.223.115.151/products/myth2/)

>Fix:
	Dunno.

	mkdir(1) strips off trailing spaces, though:

                /* Remove trailing slashes, per POSIX. */
                slash = strrchr(*argv, '\0');
                while (--slash > *argv && *slash == '/')
                        *slash = '\0';

	Maybe the kernel should do so, too? 
>Release-Note:
>Audit-Trail:

From: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
To: gnats-bugs@netbsd.org
Cc:  
Subject: Re: kern/8155
Date: Fri, 30 May 2003 03:50:13 +0200 (MEST)

 See also PR 18764.

 IMHO mkdir(2) should be adjusted to rmdir(2) to allow (ignore) trailing
 slashes. Would make some life easier. (I remember when I took a first stab
 at KDE3 and they mkdir'd everything and it's mother with a trailing slash.
 It turned out that KDE use their own mkdir-wrapper function, so that was
 easy to patch in that case, it would have been hell otherwise.)


  - Hubert

 -- 
 Want to get a clue on IPv6 but don't know where to start? Try this:
 * Basics -> http://www.onlamp.com/pub/a/onlamp/2001/05/24/ipv6_tutorial.html
 * Setup  -> http://www.onlamp.com/pub/a/onlamp/2001/06/01/ipv6_tutorial.html
 Of course with your #1 IPv6 ready operating system -> http://www.NetBSD.org/
State-Changed-From-To: open->closed 
State-Changed-By: christos 
State-Changed-When: Thu Sep 11 13:48:39 EDT 2003 
State-Changed-Why:  
fixed, thanks 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.