It was problematic in the light of file systems that ignore umask.
Problem reported by Sebastian Ungar in: http://bugs.gnu.org/21534
* NEWS: Document this.
* lib/mkancesdirs.c (mkancesdirs): MAKE_DIR now returns 0 if
successful, -1 (setting errno) on failure, rather than something
more complicated than that.
* lib/mkdir-p.c (make_dir_parents):
Do not use SAVEWD_CHDIR_READABLE.
* lib/savewd.c (savewd_chdir):
Remove support for SAVEWD_CHDIR_READABLE.
* lib/savewd.h (SAVEWD_CHDIR_READABLE): Remove.
2015-09-22 Paul Eggert <eggert@cs.ucla.edu>
+ savewd: remove SAVEWD_CHDIR_READABLE
+ It was problematic in the light of file systems that ignore umask.
+ Problem reported by Sebastian Ungar in: http://bugs.gnu.org/21534
+ * NEWS: Document this.
+ * lib/mkancesdirs.c (mkancesdirs): MAKE_DIR now returns 0 if
+ successful, -1 (setting errno) on failure, rather than something
+ more complicated than that.
+ * lib/mkdir-p.c (make_dir_parents):
+ Do not use SAVEWD_CHDIR_READABLE.
+ * lib/savewd.c (savewd_chdir):
+ Remove support for SAVEWD_CHDIR_READABLE.
+ * lib/savewd.h (SAVEWD_CHDIR_READABLE): Remove.
+
c-ctype: port better to EBCDIC
Problems reported by Daniel Richard G. in
http://lists.gnu.org/archive/html/bug-gnulib/2015-09/msg00020.html
Date Modules Changes
+2015-09-22 savewd SAVEWD_CHDIR_READABLE constant removed.
+
2015-07-24 fprintftime Exported functions' time zone arguments are now of
strftime type timezone_t (with NULL denoting UTC) instead of
type int (with nonzero denoting UTC). These
Create any ancestor directories that don't already exist, by
invoking MAKE_DIR (FILE, COMPONENT, MAKE_DIR_ARG). This function
- should return 0 if successful and the resulting directory is
- readable, 1 if successful but the resulting directory might not be
- readable, -1 (setting errno) otherwise. If COMPONENT is relative,
- it is relative to the temporary working directory, which may differ
- from *WD.
+ should return 0 if successful, -1 (setting errno) otherwise. If
+ COMPONENT is relative, it is relative to the temporary working
+ directory, which may differ from *WD.
Ordinarily MAKE_DIR is executed with the working directory changed
to reflect the already-made prefix, and mkancesdirs returns with
if (sep - component == 2
&& component[0] == '.' && component[1] == '.')
made_dir = false;
+ else if (make_dir (file, component, make_dir_arg) < 0)
+ make_dir_errno = errno;
else
- switch (make_dir (file, component, make_dir_arg))
- {
- case -1:
- make_dir_errno = errno;
- break;
-
- case 0:
- savewd_chdir_options |= SAVEWD_CHDIR_READABLE;
- /* Fall through. */
- case 1:
- made_dir = true;
- break;
- }
+ made_dir = true;
if (made_dir)
savewd_chdir_options |= SAVEWD_CHDIR_NOFOLLOW;
announce (dir, options);
preserve_existing = (keep_owner & keep_special_mode_bits
& umask_must_be_ok);
- savewd_chdir_options |=
- (SAVEWD_CHDIR_NOFOLLOW
- | (mode & S_IRUSR ? SAVEWD_CHDIR_READABLE : 0));
+ savewd_chdir_options |= SAVEWD_CHDIR_NOFOLLOW;
}
else
{
open_result[1] = errno;
}
- if (fd < 0 && (errno != EACCES || (options & SAVEWD_CHDIR_READABLE)))
+ if (fd < 0 && errno != EACCES)
result = -1;
}
}
-/* Options for savewd_chdir. */
+/* Options for savewd_chdir. Can be ORed together. */
enum
{
/* Do not follow symbolic links, if supported. */
SAVEWD_CHDIR_NOFOLLOW = 1,
- /* The directory should be readable, so fail if it happens to be
- discovered that the directory is not readable. (Unreadable
- directories are not necessarily diagnosed, though.) */
- SAVEWD_CHDIR_READABLE = 2,
-
/* Do not chdir if the directory is readable; simply succeed
without invoking chdir if the directory was opened. */
- SAVEWD_CHDIR_SKIP_READABLE = 4
+ SAVEWD_CHDIR_SKIP_READABLE = 2
};
/* Change the directory, and if successful, record into *WD the fact