Commit Graph

22 Commits

Author SHA1 Message Date
mharo
1fbe854d9a brucify and add comment about -v being non-standard to manpage
Reviewed by:	obrien
1999-09-04 03:19:38 +00:00
mpp
9d8b3b4e1b Fix typo in previous commit that documented the -v option. 1999-08-28 21:38:36 +00:00
mharo
94c239d059 add verbose flag
Reviewed by:	obrien
1999-08-28 20:46:00 +00:00
peter
3b7c52fb9a $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
kris
935bd87c22 Various spelling/formatting changes.
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
1999-05-08 10:22:15 +00:00
imp
5a0cdbeff2 Free memory obtained from setmode.
Obtained from: OpenBSD
1998-12-16 04:42:33 +00:00
msmith
65733af597 Fix behaviour for 'mkdir -m 777 / /tmp/foo'. Play "guess the style bug"
with Bruce again.

Reported by:	bde
1998-10-23 06:28:40 +00:00
msmith
f6d3d7d6d5 Honour the spirit rather than the implementation of the previous changes;
if we are invoked with -m, use chmod() on the final directory component
in order to ensure the mode is correctly set.
1998-10-22 21:42:20 +00:00
msmith
ab2f649a67 Make this compile, and honour the spirit of the original design while
incorporating the intended fix.  Attempt to address some of the
putative style bugs introduced.  Others doubtless remain.

Embarrassed by: bde
1998-10-20 08:04:15 +00:00
msmith
1f0ecb9ee1 - mkdir -m should call chmod because the high-order bits get ignored
by the kernel as a security feature of some sort.

Submitted by:	Wilfredo Sanchez <wsanchez@apple.com>
1998-10-20 06:37:01 +00:00
charnier
3d38367e08 correct use of .Nm. Add rcsid. 1998-05-15 06:23:45 +00:00
mpp
b886336680 Fix several problems with mkdir:
1)  Fix mkdir -p to exit with the proper exit status and issue an error
    message if it was unable to create all of the specified directories
    and they did not previously exist.  POSIX says:

    The mkdir utility shall exit with one of the following values:

    0  All the specified directories were created successfully or the
       -p option was specified and all the specified directories now
       exist.

    E.g.

    % mkdir -p /var/mkdir
    mkdir: /var/mkdir: Permission denied

    % touch /tmp/file
    % mkdir -p /tmp/file/dir
    mkdir: /tmp/file: Not a directory

    Previously the above examples would exit with a zero exit status
    and no error message.  Something like the following run as a
    normal user will still not produce an error:

    % id
    uid=629(mpp) gid=629(mpp)....
    % mkdir -p /usr/local/etc
    % ls -ld /usr/local/etc
    drwxr-xr-x  4 bin  bin  512 Dec 26 14:55 /usr/local/etc/

2)  Cleaned up the mode handling to be more efficient when multiple
    directories are being created.

3) Fixed a problem where directories could be created with the wrong mode
   if the the -p option was specified and the build() routine returned
   and error.  It would leave the umask set incorrectly at this point.

4) Removed an unused variable.

Closes PR# 2304.
1997-04-01 23:46:22 +00:00
imp
cdc0e920d8 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-28 15:24:41 +00:00
peter
34fd560164 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
jkh
9c0cd3f9df Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
steve
db2a5afcb0 Cleanup man page and -Wall cleaning. 1996-12-14 06:04:06 +00:00
wosch
d4a1c1cff8 [HISTORY] command appeared in Version 1 AT&T UNIX
Obtained from: A Quarter Century of UNIX, Peter H. Salus, page 41
1996-08-29 18:06:19 +00:00
dg
00eb2a4dc0 Added $Id$ 1994-09-24 02:59:15 +00:00
bde
cb7ffba15d Remove bogus cast that was introduced in the previous commit. 1994-09-21 22:34:38 +00:00
phk
a1aa4c1dd2 Applied patch to make -Wall and -Dlint shut up.
Reviewed by:	phk
Submitted by:	Josef Grosch <joeg@gagme.wwa.com>
1994-09-20 06:24:56 +00:00
jkh
cd27908e60 [ From Dave Tweten ]
POSIX.2 looks pretty unequivocal to me, and it agrees with you.

Under the explanation of the "-p" option, it says, "Each dir operand that
names an existing directory shall be ignored without error."  Under the
explanation of exit status zero, it says, "All the specified directories were
created successfully, or the-p option was specified and all the specified
directories now exist."

Seems to me POSIX requires exactly the behavior you want.

[ And I've made the change, which is also now compatible with 1.x - jkh ]

Reviewed by:	jkh
Submitted by:	jkh/tweten
1994-09-08 21:34:33 +00:00
rgrimes
e3cfc8ce61 BSD 4.4 Lite bin Sources 1994-05-26 06:18:55 +00:00