History log of /freebsd-current/bin/mkdir/mkdir.c
Revision Date Author Comments
# 0b8224d1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

Remove copyright strings ifdef'd out

We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by: Netflix


# 90aea514 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 28c3c137 02-Oct-2021 Elyes HAOUAS <ehaouas@noos.fr>

src/bin/mkdir: Spell occur correctly.

Pull Request: https://github.com/freebsd/freebsd-src/pull/544
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# bfefd421 27-Apr-2013 Eitan Adler <eadler@FreeBSD.org>

Add missing static qualifiers

Reviewed by: ed, jilles
MFC After: 3 days


# f9d4afb4 31-Oct-2011 Ed Schouten <ed@FreeBSD.org>

Put some static keywords in the source code.

For these simple utilities, it doesn't harm to make all global variables
static. In fact, this allows the compiler to perform better forms of
optimisation and analysis.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# cf39c97b 10-Oct-2006 Ruslan Ermilov <ru@FreeBSD.org>

Adhere to POSIX: the -m option only applies to the newly created
directories; it should not change the permission bits of already
existing directories.

Submitted by: Alex Unleashed (modified by me)


# a89237ae 09-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Sync program's usage() with manpage's SYNOPSIS.


# 3ac2b177 25-Jan-2005 Suleiman Souhlal <ssouhlal@FreeBSD.org>

- The first argument of getmode() is a void *
- Add WARNS?= 6

Approved by: stefanf, grehan (mentor)
Obtained from: DragonFlyBSD


# 9ddb49cb 10-Jan-2005 Warner Losh <imp@FreeBSD.org>

/*- or .\"- or #- to begin license clauses.


# 7f5685bb 24-Sep-2004 David Schultz <das@FreeBSD.org>

Don't read the byte at *argv[strlen(*argv) + 1].

PR: 71743


# 6195fb41 06-Apr-2004 Mark Murray <markm@FreeBSD.org>

Remove clause 3 from the UCB licenses.

OK'ed by: imp, core


# 09a80d48 01-May-2003 David E. O'Brien <obrien@FreeBSD.org>

Quiet warnings about copyright[].


# 5eb43ac2 29-Jun-2002 David E. O'Brien <obrien@FreeBSD.org>

Consistently use __FBSDID


# 42d6cdd3 25-Feb-2002 Maxim Sobolev <sobomax@FreeBSD.org>

Fix a bug introduced in rev.1.23 - for some reason mkdir("/", ...) system
call returns `EISDIR', not `EEXIST', so that be prepared for that. This should
fix number of ports, that often call `mkdir -p //usr/local/foobar'. This
is just a quick workaround, the real fix would be either to avoid calling
mkdir("/", ...) or fix VFS code to return consistent errno for this case.


# 4b4ed2fe 22-Feb-2002 Mark Murray <markm@FreeBSD.org>

Fix warnings inspired by lint, a commercial lint and WARNS=4.


# 076172c5 05-Feb-2002 Dave Zarzycki <zarzycki@FreeBSD.org>

Fix the race between the stat() and the mkdir().
Reviewed by: jkh


# 46251dde 01-Feb-2002 Warner Losh <imp@FreeBSD.org>

o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.


# 4ca63b7f 19-May-2001 Kris Kennaway <kris@FreeBSD.org>

Silence WARNS=2 and BDECFLAGS except for stupid mode_t warnings.

MFC after: 1 week


# c51117f5 13-Jan-2001 Alfred Perlstein <alfred@FreeBSD.org>

Special case the error reporting when errno is ENOTDIR or ENOENT.

This makes "mkdir /nonexistant/foo" complain that /nonexistant
doesn't exist rather than /nonexistant/foo which doesn't make much
sense.

Submitted (in a different form) by: W.H.Scholten <whs@xs4all.nl>


# 2f5f84c5 03-Sep-1999 Michael Haro <mharo@FreeBSD.org>

brucify and add comment about -v being non-standard to manpage

Reviewed by: obrien


# 1df89a60 28-Aug-1999 Michael Haro <mharo@FreeBSD.org>

add verbose flag

Reviewed by: obrien


# 2a456239 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# a4324714 15-Dec-1998 Warner Losh <imp@FreeBSD.org>

Free memory obtained from setmode.

Obtained from: OpenBSD


# e45520f7 23-Oct-1998 Mike Smith <msmith@FreeBSD.org>

Fix behaviour for 'mkdir -m 777 / /tmp/foo'. Play "guess the style bug"
with Bruce again.

Reported by: bde


# 16c0b519 22-Oct-1998 Mike Smith <msmith@FreeBSD.org>

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.


# 37a182e2 20-Oct-1998 Mike Smith <msmith@FreeBSD.org>

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


# 2426ecdf 20-Oct-1998 Mike Smith <msmith@FreeBSD.org>

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


# 06f62885 15-May-1998 Philippe Charnier <charnier@FreeBSD.org>

correct use of .Nm. Add rcsid.


# 1a8d9bc1 01-Apr-1997 Mike Pritchard <mpp@FreeBSD.org>

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.


# 93ef08af 28-Mar-1997 Warner Losh <imp@FreeBSD.org>

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# b97fa2ef 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

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.


# ca64f950 13-Dec-1996 Steve Price <steve@FreeBSD.org>

Cleanup man page and -Wall cleaning.


# 89730b29 23-Sep-1994 David Greenman <dg@FreeBSD.org>

Added $Id$


# 0e4885ff 21-Sep-1994 Bruce Evans <bde@FreeBSD.org>

Remove bogus cast that was introduced in the previous commit.


# d4daf998 20-Sep-1994 Poul-Henning Kamp <phk@FreeBSD.org>

Applied patch to make -Wall and -Dlint shut up.

Reviewed by: phk
Submitted by: Josef Grosch <joeg@gagme.wwa.com>


# d653487a 08-Sep-1994 Jordan K. Hubbard <jkh@FreeBSD.org>

[ 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


# 4b88c807 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite bin Sources