#include'd by h/nmh.h, with HAVE_SYS_PARAM_H protection.
#include <sys/file.h>
int
#include <sys/file.h>
int
if (!(folder_perms_ASCII = context_find ("folder-protect")))
folder_perms_ASCII = foldprot; /* defaults to "700" */
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
/* 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 ()) {
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;
while (!had_an_error && (c = strchr((c + 1), '/')) != NULL) {
*c = (char)0;
-- Dan Harkless <dan-nmh@dilvish.speed.net> */
switch (pid = fork()) {
-- Dan Harkless <dan-nmh@dilvish.speed.net> */
switch (pid = fork()) {
advise ("fork", "unable to");
return 0;
advise ("fork", "unable to");
return 0;
setgid (getgid ());
setuid (getuid ());
setgid (getgid ());
setuid (getuid ());
perror ("mkdir");
_exit (-1);
perror ("mkdir");
_exit (-1);
if (pidXwait(pid, "mkdir"))
return 0;
break;
if (pidXwait(pid, "mkdir"))
return 0;
break;