X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/4548981fb45fbc917cc2c26b7c96b31cfa14bc9b..6bc64765f:/sbr/makedir.c?ds=sidebyside diff --git a/sbr/makedir.c b/sbr/makedir.c index bbeef80b..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 = m_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;