X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/88b27ae07f694e90637c2a852b754539c2f70172..0c50c669:/sbr/makedir.c diff --git a/sbr/makedir.c b/sbr/makedir.c index 4337b7ce..67f69c86 100644 --- a/sbr/makedir.c +++ b/sbr/makedir.c @@ -12,8 +12,6 @@ */ #include -#include -#include #include int @@ -31,7 +29,7 @@ makedir (char *dir) if (!(folder_perms_ASCII = context_find ("folder-protect"))) folder_perms_ASCII = foldprot; /* defaults to "700" */ - + /* Because mh-profile.man documents "Folder-Protect:" as an octal constant, and we don't want to force the user to remember to include a leading zero, we call atooi(folder_perms_ASCII) here rather than @@ -46,7 +44,7 @@ makedir (char *dir) saved_umask = umask(0); if (getuid () == geteuid ()) { - c = strncpy(path, dir, sizeof(path)); + c = strncpy(path, dir, sizeof(path)); while (!had_an_error && (c = strchr((c + 1), '/')) != NULL) { *c = (char)0; @@ -85,22 +83,22 @@ makedir (char *dir) nested directories like the above code can. -- Dan Harkless */ - switch (pid = vfork()) { - case -1: + switch (pid = fork()) { + case -1: advise ("fork", "unable to"); return 0; - case 0: + case 0: setgid (getgid ()); setuid (getuid ()); - execl ("/bin/mkdir", "mkdir", dir, NULL); - execl ("/usr/bin/mkdir", "mkdir", dir, NULL); + execl ("/bin/mkdir", "mkdir", dir, (void *) NULL); + execl ("/usr/bin/mkdir", "mkdir", dir, (void *) NULL); fprintf (stderr, "unable to exec "); perror ("mkdir"); _exit (-1); - default: + default: if (pidXwait(pid, "mkdir")) return 0; break;