Eric Andersen 2842659cc0 Patch from Michael Tokarev:
Scenario:

  touch x -- creates plain file name `x'
  mkdir x -- exits successefully

libbb/make_directory.c, bb_make_directory(), contains
the following code:

        if (mkdir(path, 0777) < 0) {
            /* If we failed for any other reason than the directory
             * already exists, output a diagnostic and return -1.*/
            if (errno != EEXIST) {
                fail_msg = "create";
                umask(mask);
                break;
            }
            /* Since the directory exists, don't attempt to change
             * permissions if it was the full target.  Note that
             * this is not an error conditon. */
            if (!c) {
                umask(mask);
                return 0;
            }
        }

The assumption that EEXIST error is due to that the *directory*
already exists is wrong: any file type with that name will cause
this error to be returned.  Proper way IMHO will be is to stat()
the path and check whenever this is really a directory.  Below
(attached) is a patch to fix this issue.
2004-10-08 07:21:58 +00:00
..
2004-05-01 01:27:30 +00:00
2003-05-26 14:07:50 +00:00
2004-04-14 17:51:38 +00:00
2004-04-14 17:51:38 +00:00
2004-04-14 17:51:38 +00:00
2004-04-14 17:51:38 +00:00
2004-02-05 13:49:29 +00:00
2004-08-26 21:45:21 +00:00
2004-04-14 17:51:38 +00:00
2004-10-08 07:21:58 +00:00
2004-09-15 03:04:08 +00:00
2004-09-15 03:04:08 +00:00
2004-09-15 03:04:08 +00:00
2004-09-15 03:04:08 +00:00
2004-03-27 11:26:32 +00:00
2004-04-14 17:51:38 +00:00
2004-08-26 22:18:59 +00:00
2004-04-07 17:59:04 +00:00
2003-05-26 14:07:50 +00:00
2004-04-14 17:51:38 +00:00
2004-03-06 22:11:45 +00:00
2004-04-14 17:51:38 +00:00
2004-04-14 17:51:38 +00:00
2004-04-14 17:51:38 +00:00
2003-05-26 14:07:50 +00:00

Please see the LICENSE file for copyright information (GPLv2)

libbb is BusyBox's utility library.  All of this stuff used to be stuffed into
a single file named utility.c.  When I split utility.c to create libbb, some of
the very oldest stuff ended up without their original copyright and licensing
information (which is now lost in the mists of time).  If you see something
that you wrote that is mis-attributed, do let me know so we can fix that up.

	Erik Andersen
	<andersen@codepoet.org>