*/
#include <h/mh.h>
-#include <errno.h>
-#include <sys/param.h>
#include <sys/file.h>
int
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
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;
nested directories like the above code can.
-- Dan Harkless <dan-nmh@dilvish.speed.net> */
- 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;