X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/bacd74669e1b6614519259f7eaba98da54f9c97c..035c5db34:/sbr/makedir.c?ds=sidebyside diff --git a/sbr/makedir.c b/sbr/makedir.c index 2a8cbfc5..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; @@ -86,21 +84,21 @@ makedir (char *dir) -- Dan Harkless */ switch (pid = fork()) { - case -1: + 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;