X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fmakedir.c;h=89e90457072b59bbfcd405612411f14b8476855c;hp=1e03caac910a832edf13cf4e023a2004951161d8;hb=ced6090a330d3d83d0bce709f756aa3d7d65fea4;hpb=337338b404931f06f0db2119c9e145e8ca5a9860 diff --git a/sbr/makedir.c b/sbr/makedir.c index 1e03caa..89e9045 100644 --- a/sbr/makedir.c +++ b/sbr/makedir.c @@ -1,14 +1,14 @@ /* - * makedir.c -- make a directory - * - * This code is Copyright (c) 2002, by the authors of nmh. See the - * COPYRIGHT file in the root directory of the nmh distribution for - * complete copyright information. - */ +** makedir.c -- make a directory +** +** This code is Copyright (c) 2002, by the authors of nmh. See the +** COPYRIGHT file in the root directory of the nmh distribution for +** complete copyright information. +*/ /* - * Modified to try recursive create. - */ +** Modified to try recursive create. +*/ #include #include @@ -31,17 +31,22 @@ 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 - strtoul(folder_perms_ASCII, NULL, 0). Therefore, if anyone ever tries to - specify a mode in say, hex, they'll get garbage. (I guess nmh uses its - atooi() function rather than calling strtoul() with a radix of 8 because - some ancient platforms are missing that functionality. */ + /* + ** 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 strtoul(folder_perms_ASCII, NULL, 0). Therefore, + ** if anyone ever tries to specify a mode in say, hex, they'll + ** get garbage. (I guess nmh uses its atooi() function rather + ** than calling strtoul() with a radix of 8 because some ancient + ** platforms are missing that functionality. + */ folder_perms = atooi(folder_perms_ASCII); - /* Folders have definite desired permissions that are set -- we don't want - to interact with the umask. Clear it temporarily. */ + /* + ** Folders have definite desired permissions that are set -- we + ** don't want to interact with the umask. Clear it temporarily. + */ saved_umask = umask(0); if (getuid () == geteuid ()) { @@ -64,8 +69,10 @@ makedir (char *dir) } if (!had_an_error) { - /* Create the innermost nested subdirectory of the - * path we're being asked to create. */ + /* + ** Create the innermost nested subdirectory of the + ** path we're being asked to create. + */ if (mkdir (dir, folder_perms) == -1) { advise (dir, "unable to create directory"); had_an_error = 1;