platform/upstream/coreutils.git
18 years agoAlso allow a slightly different diagnostic -- the
Jim Meyering [Tue, 3 Jan 2006 14:12:16 +0000 (14:12 +0000)]
Also allow a slightly different diagnostic -- the
one you get when using openat-enabled fts.c and du (coming soon).

18 years agocorrect first-line comment
Jim Meyering [Tue, 3 Jan 2006 10:29:58 +0000 (10:29 +0000)]
correct first-line comment

18 years ago*** empty log message ***
Jim Meyering [Tue, 3 Jan 2006 07:41:12 +0000 (07:41 +0000)]
*** empty log message ***

18 years ago(O_DIRECTORY) [!defined O_DIRECTORY]: Define.
Jim Meyering [Tue, 3 Jan 2006 07:41:03 +0000 (07:41 +0000)]
(O_DIRECTORY) [!defined O_DIRECTORY]: Define.

18 years agoMake sure we can change the group of inaccessible files.
Paul Eggert [Tue, 3 Jan 2006 06:20:25 +0000 (06:20 +0000)]
Make sure we can change the group of inaccessible files.

18 years ago(RC_do_ordinary_chown): New enum value.
Paul Eggert [Tue, 3 Jan 2006 06:20:06 +0000 (06:20 +0000)]
(RC_do_ordinary_chown): New enum value.
(restricted_chown): Return it, if the file cannot be accessed due
to EPERM, or if no uid or gid are required, or if the file is
neither a directory nor a regular file.  Rewrite to avoid gotos.
(change_file_owner): Handle RC_do_ordinary_chown case.
Rewrite to avoid gotos.

18 years ago(General date syntax): Invalid dates are rejected.
Paul Eggert [Tue, 3 Jan 2006 06:00:10 +0000 (06:00 +0000)]
(General date syntax): Invalid dates are rejected.
(Time of day items): Mention the possibility of leap seconds.
Problem reported by Dr. David Alan Gilbert.

18 years agoExplain date %g, %G, and %V a bit better.
Paul Eggert [Tue, 3 Jan 2006 00:48:29 +0000 (00:48 +0000)]
Explain date %g, %G, and %V a bit better.

18 years agoExplain date %g, %G a bit better.
Paul Eggert [Tue, 3 Jan 2006 00:46:11 +0000 (00:46 +0000)]
Explain date %g, %G a bit better.

18 years agoUse @acronym around "ISO" uniformly.
Paul Eggert [Tue, 3 Jan 2006 00:45:06 +0000 (00:45 +0000)]
Use @acronym around "ISO" uniformly.
(Date conversion specifiers): Explain %g, %G, and %V a bit better.

18 years ago(usage): Explain %g, %G, and %V a bit better.
Paul Eggert [Tue, 3 Jan 2006 00:43:19 +0000 (00:43 +0000)]
(usage): Explain %g, %G, and %V a bit better.

18 years ago*** empty log message ***
Jim Meyering [Mon, 2 Jan 2006 21:35:00 +0000 (21:35 +0000)]
*** empty log message ***

18 years ago(set_owner): Correct a comment.
Jim Meyering [Mon, 2 Jan 2006 21:34:53 +0000 (21:34 +0000)]
(set_owner): Correct a comment.

18 years ago*** empty log message ***
Jim Meyering [Mon, 2 Jan 2006 19:11:27 +0000 (19:11 +0000)]
*** empty log message ***

18 years ago(parse_options): Change warning to say that --retry
Jim Meyering [Mon, 2 Jan 2006 19:11:22 +0000 (19:11 +0000)]
(parse_options): Change warning to say that --retry
is useful `mainly' (not `only') when following by name.
Reported here: http://bugs.debian.org/273781

18 years ago*** empty log message ***
Jim Meyering [Mon, 2 Jan 2006 19:10:45 +0000 (19:10 +0000)]
*** empty log message ***

18 years ago(tail invocation): Say that --retry
Jim Meyering [Mon, 2 Jan 2006 19:10:39 +0000 (19:10 +0000)]
(tail invocation): Say that --retry
is useful `mainly' (not `only') when following by name.

18 years agoFix typo in previous change.
Paul Eggert [Mon, 2 Jan 2006 07:42:35 +0000 (07:42 +0000)]
Fix typo in previous change.

18 years agoNew approach to safer chmod.
Paul Eggert [Mon, 2 Jan 2006 07:30:27 +0000 (07:30 +0000)]
New approach to safer chmod.

18 years agoClarify file mode bits versus file permission bits.
Paul Eggert [Mon, 2 Jan 2006 07:29:46 +0000 (07:29 +0000)]
Clarify file mode bits versus file permission bits.

18 years agoUpdate copyright year.
Paul Eggert [Mon, 2 Jan 2006 07:29:24 +0000 (07:29 +0000)]
Update copyright year.

18 years agoClarify file mode bits versus file permission bits.
Paul Eggert [Mon, 2 Jan 2006 07:28:38 +0000 (07:28 +0000)]
Clarify file mode bits versus file permission bits.
(mkfifo invocation, mknod invocation): -m affects only file permission bits.

18 years agoDocument that mkfifo and mknod -m no longer set special bits.
Paul Eggert [Mon, 2 Jan 2006 07:28:08 +0000 (07:28 +0000)]
Document that mkfifo and mknod -m no longer set special bits.

18 years agoNo longer used.
Paul Eggert [Mon, 2 Jan 2006 07:18:30 +0000 (07:18 +0000)]
No longer used.

18 years ago(usage): Clarify -m's operation.
Paul Eggert [Mon, 2 Jan 2006 06:39:06 +0000 (06:39 +0000)]
(usage): Clarify -m's operation.
(main): If -m is given, don't invoke chmod; use umask 0 instead.
Report an error if -m asks for bits outside the 777 range.

Undo 2005-12-19 changes.

18 years agoUpdate copyright year.
Paul Eggert [Mon, 2 Jan 2006 06:38:33 +0000 (06:38 +0000)]
Update copyright year.

18 years ago(usage): Clarify -m's operation.
Paul Eggert [Mon, 2 Jan 2006 06:38:06 +0000 (06:38 +0000)]
(usage): Clarify -m's operation.
(main): If -m is given, don't invoke chmod; use umask 0 instead.
Report an error if -m asks for bits outside the 777 range.

18 years agoInclude lchmod.h.
Paul Eggert [Mon, 2 Jan 2006 06:37:36 +0000 (06:37 +0000)]
Include lchmod.h.
(usage): Clarify -m's operation.
(main): Use lchmod rather than chmod.  Don't use lchmod unless the
new mode contains bits outside the 777 range.

18 years agoInclude lchmod.h.
Paul Eggert [Mon, 2 Jan 2006 06:36:55 +0000 (06:36 +0000)]
Include lchmod.h.
(re_protect, make_dir_parents_private): Use lchmod rather than chmod.

18 years agoInclude lchmod.h.
Paul Eggert [Mon, 2 Jan 2006 06:36:10 +0000 (06:36 +0000)]
Include lchmod.h.
(copy_internal): Use lchmod rather than chmod.

18 years agoNew file.
Paul Eggert [Mon, 2 Jan 2006 06:34:32 +0000 (06:34 +0000)]
New file.

18 years ago(gl_MACROS): Require gl_FUNC_LCHMOD.
Paul Eggert [Mon, 2 Jan 2006 06:34:13 +0000 (06:34 +0000)]
(gl_MACROS): Require gl_FUNC_LCHMOD.
Don't require gl_CHDIR_SAFER.

18 years agoInclude lchmod.h, lchmod.c.
Paul Eggert [Mon, 2 Jan 2006 06:33:12 +0000 (06:33 +0000)]
Include lchmod.h, lchmod.c.
(make_dir_parents): Use lchown rather than chown, and
lchmod rather than chmod.

18 years ago(sort invocation): Clarify that by default a blank is a space or a tab.
Paul Eggert [Thu, 29 Dec 2005 21:45:32 +0000 (21:45 +0000)]
(sort invocation): Clarify that by default a blank is a space or a tab.

18 years ago(sort invocation): Clarify that a blank is a space
Paul Eggert [Thu, 29 Dec 2005 21:44:35 +0000 (21:44 +0000)]
(sort invocation): Clarify that a blank is a space
or a tab.

18 years agoadd src/system.h
Jim Meyering [Thu, 29 Dec 2005 15:03:57 +0000 (15:03 +0000)]
add src/system.h

18 years ago.
Jim Meyering [Wed, 28 Dec 2005 10:27:47 +0000 (10:27 +0000)]
.

18 years ago*** empty log message ***
Jim Meyering [Wed, 28 Dec 2005 10:27:34 +0000 (10:27 +0000)]
*** empty log message ***

18 years ago(EXTRA_DIST): Add .x-sc_prohibit_assert_without_use.
Jim Meyering [Wed, 28 Dec 2005 10:26:58 +0000 (10:26 +0000)]
(EXTRA_DIST): Add .x-sc_prohibit_assert_without_use.

18 years ago(sc_obsolete_symbols): Prohibit use of O_NDELAY.
Jim Meyering [Wed, 28 Dec 2005 10:26:10 +0000 (10:26 +0000)]
(sc_obsolete_symbols): Prohibit use of O_NDELAY.
(sc_prohibit_assert_without_use): New rule.
(syntax-check-rules): Add it to the list.

(CVS_LIST): Define in terms of $(srcdir).

18 years agoDon't include <assert.h>; it wasn't used.
Jim Meyering [Wed, 28 Dec 2005 10:22:41 +0000 (10:22 +0000)]
Don't include <assert.h>; it wasn't used.

18 years agochdir-related fixes
Paul Eggert [Tue, 27 Dec 2005 08:00:42 +0000 (08:00 +0000)]
chdir-related fixes

18 years ago(wipename): Use similar open flags to other places we open directories.
Paul Eggert [Tue, 27 Dec 2005 08:00:12 +0000 (08:00 +0000)]
(wipename): Use similar open flags to other places we open directories.
Don't bother trying to open dir for writing, since POSIX prohibits it.

18 years ago(fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY
Paul Eggert [Tue, 27 Dec 2005 07:59:27 +0000 (07:59 +0000)]
(fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY
| O_NOFOLLOW too, for consistency with other dir-openers.
Use POSIX-preferred O_NONBLOCK rather than O_NDELAY.
(is_empty_dir): Likewise.

18 years ago(restricted_chown):
Paul Eggert [Tue, 27 Dec 2005 07:59:00 +0000 (07:59 +0000)]
(restricted_chown):
Don't try O_WRONLY unless O_RDONLY failed wth EACCES.

18 years ago(save_cwd): Don't bother trying to open directory
Paul Eggert [Tue, 27 Dec 2005 07:57:14 +0000 (07:57 +0000)]
(save_cwd): Don't bother trying to open directory
for write access: POSIX says that must fail.

18 years ago(rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
Paul Eggert [Tue, 27 Dec 2005 07:56:33 +0000 (07:56 +0000)]
(rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
Fall back on chown if open failed with EACCES.

18 years ago(defined_S_IFMT): New macro.
Paul Eggert [Tue, 27 Dec 2005 07:55:50 +0000 (07:55 +0000)]
(defined_S_IFMT): New macro.
Include stat-macros.h.
Include stdlib.h, for abort().
Don't include stdio.h or assert.h; no longer needed.
(same_file_type): Don't assume S_IFMT is defined, as POSIX
does not require this.  Don't assume S_IFCHR and S_IFBLK have
their usual sort of bit pattern.
(fchmod_new): Open with O_NOCTTY for as well, for minor
improvement on hosts where that matters.  Don't bother to assert,
since the caller (in this source file) checks the same thing.
Discard any errno from a close failure, for consistency with other
code.

18 years ago(diropen): Don't bother trying to open directory for write access:
Paul Eggert [Tue, 27 Dec 2005 07:55:03 +0000 (07:55 +0000)]
(diropen): Don't bother trying to open directory for write access:
POSIX says that must fail.

18 years ago(chdir_no_follow): Don't bother trying to open directory for write
Paul Eggert [Tue, 27 Dec 2005 07:54:37 +0000 (07:54 +0000)]
(chdir_no_follow): Don't bother trying to open directory for write
access: POSIX says that must fail.

18 years ago(cdb_free): Don't bother trying to open directory
Paul Eggert [Tue, 27 Dec 2005 07:53:50 +0000 (07:53 +0000)]
(cdb_free): Don't bother trying to open directory
for write access: POSIX says that must fail.
(cdb_free): Open with O_NOCTTY | O_NONBLOCK as
well, for minor improvements on hosts that lack O_DIRECTORY.

18 years ago(chdir_no_follow): Move declaration of local,
Jim Meyering [Mon, 26 Dec 2005 18:53:58 +0000 (18:53 +0000)]
(chdir_no_follow): Move declaration of local,
sb2, `down' into the scope where it is used.
Note that on some systems this function also fails when DIR
is a writable-yet-unreadable directory.

18 years ago*** empty log message ***
Jim Meyering [Mon, 26 Dec 2005 18:53:46 +0000 (18:53 +0000)]
*** empty log message ***

18 years agochdir-safer.c still needs unistd.h
Paul Eggert [Sun, 25 Dec 2005 21:40:01 +0000 (21:40 +0000)]
chdir-safer.c still needs unistd.h

18 years agoWhoops; don't remove the include for unistd.h, since it defines fchdir.
Paul Eggert [Sun, 25 Dec 2005 21:38:43 +0000 (21:38 +0000)]
Whoops; don't remove the include for unistd.h, since it defines fchdir.

18 years agochdir-safer cleanup
Paul Eggert [Sun, 25 Dec 2005 21:35:51 +0000 (21:35 +0000)]
chdir-safer cleanup

18 years ago(chdir_no_follow): Don't include stdio.h, assert.h,
Paul Eggert [Sun, 25 Dec 2005 21:35:38 +0000 (21:35 +0000)]
(chdir_no_follow): Don't include stdio.h, assert.h,
unistd.h, fcntl--.h; not needed.
(O_DIRECTORY): Define if not already defined.
(chdir_no_follow): Revamp describing comment to match code more
closely.  Redo use of internal vars to avoid lint complaints.
Work even if directory is writeable but not readable.
Open with O_DIRECTORY | O_NOCTTY, for benefit of hosts that
don't have O_NOFOLLOW.  Use O_NONBLOCK (POSIX spelling) rather
than O_NDELAY.  Don't bother invoking fstat if open does not
dereference symlink, since the result isn't used then.
Don't assume file descriptor is positive; it might be zero
now that we no longer include fcntl--.h (we don't need fcntl--.h
since we immediately close the descriptor).

18 years ago(FCHMOD_SAFER_H): Remove: it was misnamed, and wasn't needed anyay.
Paul Eggert [Sun, 25 Dec 2005 21:35:21 +0000 (21:35 +0000)]
(FCHMOD_SAFER_H): Remove: it was misnamed, and wasn't needed anyay.

18 years ago*** empty log message ***
Jim Meyering [Sun, 25 Dec 2005 17:34:04 +0000 (17:34 +0000)]
*** empty log message ***

18 years ago(chdir_no_follow): Remove unnecessary test of S_ISDIR (sb_init.st_mode).
Jim Meyering [Sun, 25 Dec 2005 17:33:57 +0000 (17:33 +0000)]
(chdir_no_follow): Remove unnecessary test of S_ISDIR (sb_init.st_mode).

18 years ago(TESTS): Add p-thru-slink
Jim Meyering [Fri, 23 Dec 2005 18:17:39 +0000 (18:17 +0000)]
(TESTS): Add p-thru-slink

18 years agoNew file. Test for today's mkdir-p.c fix.
Jim Meyering [Fri, 23 Dec 2005 18:16:40 +0000 (18:16 +0000)]
New file.  Test for today's mkdir-p.c fix.

18 years ago*** empty log message ***
Jim Meyering [Fri, 23 Dec 2005 18:15:38 +0000 (18:15 +0000)]
*** empty log message ***

18 years ago(make_dir_parents): Use chdir_no_follow only
Jim Meyering [Fri, 23 Dec 2005 18:15:33 +0000 (18:15 +0000)]
(make_dir_parents): Use chdir_no_follow only
if we've just created the directory.

18 years ago*** empty log message ***
Jim Meyering [Fri, 23 Dec 2005 17:14:37 +0000 (17:14 +0000)]
*** empty log message ***

18 years ago*** empty log message ***
Jim Meyering [Fri, 23 Dec 2005 12:00:37 +0000 (12:00 +0000)]
*** empty log message ***

18 years ago(chdir_no_follow): Rewrite to use fchdir even
Jim Meyering [Fri, 23 Dec 2005 12:00:26 +0000 (12:00 +0000)]
(chdir_no_follow): Rewrite to use fchdir even
when O_NOFOLLOW is not defined.  Suggested by Eric Blake.

18 years ago*** empty log message ***
Jim Meyering [Fri, 23 Dec 2005 08:28:19 +0000 (08:28 +0000)]
*** empty log message ***

18 years ago(O_NOFOLLOW): Define, if necessary.
Jim Meyering [Fri, 23 Dec 2005 08:28:14 +0000 (08:28 +0000)]
(O_NOFOLLOW): Define, if necessary.

18 years ago(O_NOFOLLOW): Define.
Jim Meyering [Fri, 23 Dec 2005 08:27:44 +0000 (08:27 +0000)]
(O_NOFOLLOW): Define.

18 years ago*** empty log message ***
Jim Meyering [Thu, 22 Dec 2005 15:43:25 +0000 (15:43 +0000)]
*** empty log message ***

18 years ago*** empty log message ***
Jim Meyering [Thu, 22 Dec 2005 15:42:17 +0000 (15:42 +0000)]
*** empty log message ***

18 years agoredirect stderr to /dev/full, too (to suppress write error diagnostic)
Jim Meyering [Thu, 22 Dec 2005 15:40:00 +0000 (15:40 +0000)]
redirect stderr to /dev/full, too (to suppress write error diagnostic)

18 years ago*** empty log message ***
Jim Meyering [Thu, 22 Dec 2005 14:36:22 +0000 (14:36 +0000)]
*** empty log message ***

18 years agoInclude "fcntl--.h" and "unistd--.h", to map open
Jim Meyering [Thu, 22 Dec 2005 14:34:20 +0000 (14:34 +0000)]
Include "fcntl--.h" and "unistd--.h", to map open
and dup to open_safer and dup_safer, respectively.
(openat_permissive): Fix typo in comment.

18 years ago.
Jim Meyering [Wed, 21 Dec 2005 10:23:51 +0000 (10:23 +0000)]
.

18 years ago*** empty log message ***
Jim Meyering [Wed, 21 Dec 2005 10:21:20 +0000 (10:21 +0000)]
*** empty log message ***

18 years agoRequire gl_CHDIR_SAFER.
Jim Meyering [Wed, 21 Dec 2005 10:21:04 +0000 (10:21 +0000)]
Require gl_CHDIR_SAFER.

18 years ago.
Jim Meyering [Wed, 21 Dec 2005 09:48:41 +0000 (09:48 +0000)]
.

18 years ago*** empty log message ***
Jim Meyering [Wed, 21 Dec 2005 09:43:44 +0000 (09:43 +0000)]
*** empty log message ***

18 years agolike chdir(2), but safer, if possible
Jim Meyering [Wed, 21 Dec 2005 09:42:36 +0000 (09:42 +0000)]
like chdir(2), but safer, if possible

18 years ago*** empty log message ***
Jim Meyering [Tue, 20 Dec 2005 14:23:25 +0000 (14:23 +0000)]
*** empty log message ***

18 years ago(RW_USR): Remove definition.
Jim Meyering [Tue, 20 Dec 2005 14:23:20 +0000 (14:23 +0000)]
(RW_USR): Remove definition.
(make_dir_parents): Use S_IRWXU, now that read access is also required.

Avoid a race condition, on systems where open honors O_NOFOLLOW.

(make_dir_parents): Include chdir-safer.h.
Use chdir_no_follow in place of chdir.

18 years ago*** empty log message ***
Jim Meyering [Tue, 20 Dec 2005 10:28:58 +0000 (10:28 +0000)]
*** empty log message ***

18 years ago(make_dir_parents): Remove unnecessary casts of alloca,
Jim Meyering [Tue, 20 Dec 2005 10:28:53 +0000 (10:28 +0000)]
(make_dir_parents): Remove unnecessary casts of alloca,
since now it's guaranteed to be (void *).

18 years ago*** empty log message ***
Jim Meyering [Tue, 20 Dec 2005 10:24:43 +0000 (10:24 +0000)]
*** empty log message ***

18 years ago(fchmod_new): Don't try to close fd if it's < 0.
Jim Meyering [Tue, 20 Dec 2005 10:24:37 +0000 (10:24 +0000)]
(fchmod_new): Don't try to close fd if it's < 0.

18 years ago.
Jim Meyering [Mon, 19 Dec 2005 18:21:11 +0000 (18:21 +0000)]
.

18 years ago.
Jim Meyering [Mon, 19 Dec 2005 18:19:38 +0000 (18:19 +0000)]
.

18 years ago(TESTS): Add mknod.
Jim Meyering [Mon, 19 Dec 2005 18:18:57 +0000 (18:18 +0000)]
(TESTS): Add mknod.

18 years ago(main) Avoid a minor race condition when `-m MODE' is specified, by using
Jim Meyering [Mon, 19 Dec 2005 18:18:03 +0000 (18:18 +0000)]
(main) Avoid a minor race condition when `-m MODE' is specified, by using
open, fchown, and close rather than just chown.  To do that reliably
(even with an overly restrictive umask), ensure that each
mknod call uses a mode including at least owner-read access.

(main): When `-m MODE' is specified, exit nonzero if
the subsequent chown (or equivalent open,fchown,close) fails.

18 years ago(main) Avoid a minor race condition when `-m MODE' is specified, by using
Jim Meyering [Mon, 19 Dec 2005 18:17:16 +0000 (18:17 +0000)]
(main) Avoid a minor race condition when `-m MODE' is specified, by using
open, fchown, and close rather than just chown.  To do that reliably
(even with an overly restrictive umask), ensure that each
mkdir call uses a mode including at least owner-read access.

18 years ago(main) Avoid a minor race condition when `-m MODE' is specified, by using
Jim Meyering [Mon, 19 Dec 2005 18:16:07 +0000 (18:16 +0000)]
(main) Avoid a minor race condition when `-m MODE' is specified, by using
open, fchown, and close rather than just chown.  To do that reliably
(even with an overly restrictive umask), ensure that each mknod/mkfifo
call uses a mode including at least owner-read access.

18 years ago.
Jim Meyering [Mon, 19 Dec 2005 18:13:00 +0000 (18:13 +0000)]
.

18 years ago.
Jim Meyering [Mon, 19 Dec 2005 18:12:30 +0000 (18:12 +0000)]
.

18 years ago.
Jim Meyering [Mon, 19 Dec 2005 18:05:55 +0000 (18:05 +0000)]
.

18 years agoRequire gl_CHMOD_SAFER.
Jim Meyering [Mon, 19 Dec 2005 18:05:11 +0000 (18:05 +0000)]
Require gl_CHMOD_SAFER.

18 years ago*** empty log message ***
Jim Meyering [Sat, 17 Dec 2005 13:46:34 +0000 (13:46 +0000)]
*** empty log message ***

18 years ago(is_empty_dir): Open with O_NDELAY, so we don't hang, e.g., on a named pipe.
Jim Meyering [Sat, 17 Dec 2005 13:46:27 +0000 (13:46 +0000)]
(is_empty_dir): Open with O_NDELAY, so we don't hang, e.g., on a named pipe.
(OPEN_NO_FOLLOW_SYMLINK): Remove definition.  Use O_NOFOLLOW in
place of all uses, since it is guaranteed (system.h) to be defined.

18 years ago*** empty log message ***
Jim Meyering [Sat, 17 Dec 2005 10:56:25 +0000 (10:56 +0000)]
*** empty log message ***