diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-10-08 07:21:58 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-10-08 07:21:58 +0000 |
commit | 5ba0134aa31b2cd9a11772fcd9e39d722347467e (patch) | |
tree | 7f9d0ea0e20dcc8bc53fcc0035a3e955820c5ded /init | |
parent | 86b698306cdf09c9e8d4f1024199ea6ee78dc285 (diff) | |
download | busybox-w32-5ba0134aa31b2cd9a11772fcd9e39d722347467e.tar.gz busybox-w32-5ba0134aa31b2cd9a11772fcd9e39d722347467e.tar.bz2 busybox-w32-5ba0134aa31b2cd9a11772fcd9e39d722347467e.zip |
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.
git-svn-id: svn://busybox.net/trunk/busybox@9319 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions