+Wed Mar 15 14:20:20 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
+
+ * When I fixed the long-standing makedir() bugs in January, I had
+ the code call strtoul(..., 0), which I believed to be safe as all
+ modes specified as ASCII constants in the nmh code started with a
+ leading zero (signifying octal), which I did as it would work if
+ internal constants were ever changed to hex. Unfortunately I was
+ unaware of the "Folder-Protect:" .mh_profile entry, which
+ mh-profile.man documents as an octal-only constant, with no
+ leading zero required. I've changed the strtoul() call to an
+ atooi() call and removed the misleading leading zeroes on the
+ ASCII octal constants in the code and man pages. Also changed the
+ "Folder-Protect:" example in the man page to something more
+ interesting than a duplication of the default.
+
Tue Mar 14 12:41:48 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
* Applied, after some finessing,
Thu Jan 27 12:22:25 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
- * makedir() had multiple bugs dating back to MH. It passed an
- octal constant to atoi(), which interpreted it as decimal,
- resulting in directories with no user read or execute permissions,
- making nested directory creation fail. Also, when creating a
- nested directory, correct permissions were only set on the inner one.
+ * makedir() had multiple bugs dating back to MH. An octal
+ constant was apparently being interpreted as decimal, resulting in
+ directories with no user read or execute permissions, making
+ nested directory creation fail. And there wasn't even an
+ _attempt_ to set desired permissions (e.g. from "Folder-Protect:"
+ in .mh_profile) on the outer directories of a nested directory.
* A second `make install' would always fail because the check for
whether mh_profile.5 existed was written incorrectly.
/*
* Define the default creation modes for folders and messages.
*/
-#define DEFAULT_FOLDER_MODE "0700"
-#define DEFAULT_MESSAGE_MODE "0600"
+#define DEFAULT_FOLDER_MODE "700"
+#define DEFAULT_MESSAGE_MODE "600"
/*
* The prefix which is prepended to the name of messages when they
/*
* Define the default creation modes for folders and messages.
*/
-#define DEFAULT_FOLDER_MODE "0700"
-#define DEFAULT_MESSAGE_MODE "0600"
+#define DEFAULT_FOLDER_MODE "700"
+#define DEFAULT_MESSAGE_MODE "600"
/*
* The prefix which is prepended to the name of messages when they
(profile, default: 0644)
.ti -1i
-Folder\-Protect:\ 700
+Folder\-Protect:\ 750
.br
An octal number which defines the permission bits for new folder
directories. See \fIchmod\fR\0(1) for an explanation of the octal number.
-(profile, default: 0700)
+(profile, default: 700)
.ti -1i
\fIprogram\fR:\ default switches
fflush(stdout);
if (!(folder_perms_ASCII = context_find ("folder-protect")))
- folder_perms_ASCII = foldprot; /* defaults to "0700" */
+ folder_perms_ASCII = foldprot; /* defaults to "700" */
- /* Call strtoul() with radix=0, which means it'll determine the base by
- looking at the first digit. That way it'll know "0700" is an octal
- constant (and if someone gets wacky and changes the representation to hex
- it'll still work). */
- folder_perms = strtoul(folder_perms_ASCII, NULL, 0);
+ /* 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. */
-Tue Mar 14 12:00:13 PST 2000
+Wed Mar 15 14:05:18 PST 2000