Jim Meyering [Wed, 26 Jul 2006 13:47:41 +0000 (13:47 +0000)]
Checking in a change from Paul.
2006-07-25 Paul Eggert <eggert@cs.ucla.edu>
* src/ls.c (DT_INIT): Remove. All uses removed.
(enum filetype): Use an ordinary enum rather than trying to keep
the values in sync with DT_FIFO etc. That way, we don't have
to make special assumptions about them. All uses changed.
(whiteout): New constant member of enum filetype.
(filetype_letter): New constant, for use with enum filetype.
(FILETYPE_INDICATORS): New initializer list.
(print_dir): Add case for DT_WHT.
(gobble_file): If stat fails, don't discard information from
readdir; instead, preserve it so it can be printed.
(print_long_format): Fall back on readdir result if stat info
is not available. Use "?" to denote each unknown mode char,
instead of an overall "?", since we now know some of the mode
typically.
(print_type_indicator): Now that MODE isn't necessarily
useful, guard all uses.
Now that two blocks in the type-checking tree can set "type = C_FILE",
move the suffix-handling code out and down.
Jim Meyering [Wed, 26 Jul 2006 13:33:07 +0000 (13:33 +0000)]
Prepare for the above change.
* src/ls.c [struct fileinfo] (stat_ok): Rename from stat_failed,
and adjust uses. From a patch by Paul Eggert.
Jim Meyering [Wed, 26 Jul 2006 09:52:43 +0000 (09:52 +0000)]
* src/ls.c: Correct indentation/formatting in a few places.
Paul Eggert [Tue, 25 Jul 2006 18:38:58 +0000 (18:38 +0000)]
Clarify the "chmod 0500" news, and correct the vague
statements about compatibility with BSD.
Paul Eggert [Tue, 25 Jul 2006 18:38:25 +0000 (18:38 +0000)]
Use "chmod 0500" rather than "chmod 500".
Paul Eggert [Tue, 25 Jul 2006 18:37:55 +0000 (18:37 +0000)]
(Directory Setuid and Setgid): Explain that this is a
GNU extension, and that other systems behave differently here.
Jim Meyering [Tue, 25 Jul 2006 16:35:59 +0000 (16:35 +0000)]
* src/ls.c (gobble_file): When handling a stat-failed entry,
print the entry name not the absolute_name -- to be consistent
with the usual case.
* tests/ls/stat-failed: Update accordingly.
Jim Meyering [Tue, 25 Jul 2006 15:40:02 +0000 (15:40 +0000)]
* tests/ls-2/tests (no-a-isdir-b): Update to reflect addition
of "cannot access " to diagnostic.
Jim Meyering [Tue, 25 Jul 2006 15:36:07 +0000 (15:36 +0000)]
*** empty log message ***
Jim Meyering [Tue, 25 Jul 2006 15:34:58 +0000 (15:34 +0000)]
* src/dircolors.hin: Mention that ORPHAN refers not just to dangling symlinks.
Jim Meyering [Tue, 25 Jul 2006 15:33:57 +0000 (15:33 +0000)]
* src/dircolors.hin: Mention that ORPHAN refers not just to dangling symlinks.
Jim Meyering [Tue, 25 Jul 2006 15:30:27 +0000 (15:30 +0000)]
Get --dired offsets right when handling stat-failed entries.
* src/ls.c (print_long_format): Be careful to increment P by the
appropriate amount, even when inode_number_width and nlink_width
are zero.
* tests/ls/stat-failed: Test for the above.
Jim Meyering [Tue, 25 Jul 2006 15:25:37 +0000 (15:25 +0000)]
* src/ls.c (gobble_file) [USE_ACL]: Don't use-uninitialized the
have_acl member. That would happen for a directory with both a
non-stat'able entry and one with an ACL.
Jim Meyering [Tue, 25 Jul 2006 15:23:59 +0000 (15:23 +0000)]
* src/ls.c (gobble_file): Make it so failure to stat a
non-command-line file provokes an exit status of 1, not 0.
Say "cannot access" rather than "cannot stat".
* tests/ls/stat-failed: New file/test, for the above.
* tests/ls/Makefile.am (TESTS): Add stat-failed.
Jim Meyering [Tue, 25 Jul 2006 15:13:56 +0000 (15:13 +0000)]
* src/ls.c: Declare stat_failed to be "bool", not "int" everywhere.
Jim Meyering [Tue, 25 Jul 2006 15:12:26 +0000 (15:12 +0000)]
* src/ls.c [enum filetype] (command_line): Remove member. Not needed.
Replace all occurrences of "type == command_line" with the
equivalent, "command_line_arg".
Jim Meyering [Tue, 25 Jul 2006 15:09:56 +0000 (15:09 +0000)]
* src/ls.c: Apply the stat-failed parts of Red Hat's
coreutils-selinux.patch. From Ulrich Drepper.
This makes it so files not mentioned on the command line (e.g.,
names read from a directory that *is* mentioned on the command
line) for which stat fails are still listed. With --color,
such files are colored just like ORPHANs (aka dangling symlinks).
Jim Meyering [Tue, 25 Jul 2006 14:34:39 +0000 (14:34 +0000)]
.
Jim Meyering [Tue, 25 Jul 2006 14:10:12 +0000 (14:10 +0000)]
vc-list-files: Handle git repositories, too.
Jim Meyering [Tue, 25 Jul 2006 14:06:21 +0000 (14:06 +0000)]
* src/df.c (n_valid_args): Declare global to be static.
Jim Meyering [Mon, 24 Jul 2006 14:02:35 +0000 (14:02 +0000)]
Skip this test on reiserfs, since that file system lacks d_type support.
Paul Eggert [Sun, 23 Jul 2006 01:27:27 +0000 (01:27 +0000)]
Update to reflect recent changes to coreutils.texi.
Paul Eggert [Sun, 23 Jul 2006 01:26:56 +0000 (01:26 +0000)]
(Mode Structure, Symbolic Modes, Numeric Modes): Be more careful
about distinguishing file mode bits from permissions bits,
and about execute versus search permission. The FreeBSD command
is chflags, not chrflags.
Paul Eggert [Sat, 22 Jul 2006 23:42:19 +0000 (23:42 +0000)]
(Mode Structure): The restricted deletion flag
restricts only unprivileged users.
Paul Eggert [Sat, 22 Jul 2006 23:41:43 +0000 (23:41 +0000)]
(What information is listed): Clarify that the restricted deletion
flag is another name for the sticky bit.
Paul Eggert [Sat, 22 Jul 2006 22:28:53 +0000 (22:28 +0000)]
Split closeout into close-stream and closeout.
Paul Eggert [Sat, 22 Jul 2006 22:27:17 +0000 (22:27 +0000)]
(close_stdout): Use new function close_stream.
Paul Eggert [Sat, 22 Jul 2006 22:26:04 +0000 (22:26 +0000)]
Initial revision.
Paul Eggert [Sat, 22 Jul 2006 22:23:43 +0000 (22:23 +0000)]
(gl_PREREQ): Require gl_CLOSE_STREAM.
Jim Meyering [Fri, 21 Jul 2006 13:32:40 +0000 (13:32 +0000)]
* src/su.c (usage): Correct typo in --help output: s/commmand/command/
Reported by Tim Waugh.
Also remove the comment duplicating much of --help output.
Jim Meyering [Fri, 21 Jul 2006 09:14:43 +0000 (09:14 +0000)]
*** empty log message ***
Jim Meyering [Fri, 21 Jul 2006 09:14:39 +0000 (09:14 +0000)]
(FILE_TYPE_INDICATOR_OPTION): Reposition this new name so the list remains alphabetized.
Jim Meyering [Fri, 21 Jul 2006 08:58:00 +0000 (08:58 +0000)]
mention yesterday's other ls bugfix
Jim Meyering [Fri, 21 Jul 2006 08:57:47 +0000 (08:57 +0000)]
*** empty log message ***
Jim Meyering [Fri, 21 Jul 2006 08:49:24 +0000 (08:49 +0000)]
Fix another bug: ls --indicator-style=file-type would call
stat for a symlink, even though it wasn't always needed.
In some cases, that unnecessary stat would cause ls to fail.
* src/ls.c (gobble_file): Don't treat symlinks specially (in
requiring a stat syscall). Remove the offending exclusion.
* NEWS: Mention the fix.
* tests/ls/stat-dtype: New file/test, for the above fix.
Also exercises the new df feature, below.
Jim Meyering [Thu, 20 Jul 2006 15:42:26 +0000 (15:42 +0000)]
* src/df.c (main): Fail and don't print the headers if no
file system is processed. This makes it easy to test whether
a specified directory is on a file system of a given type or types.
Otherwise, applications would have had to parse df's output.
E.g., is "." either ext3 or reiserfs: df -t ext3 -t reiserfs .
Jim Meyering [Thu, 20 Jul 2006 10:31:48 +0000 (10:31 +0000)]
*** empty log message ***
Jim Meyering [Thu, 20 Jul 2006 10:30:42 +0000 (10:30 +0000)]
(file-type): New test:
For 5.97 and earlier, --file-type acted like --indicator-style=slash.
Jim Meyering [Thu, 20 Jul 2006 10:20:23 +0000 (10:20 +0000)]
Fix a bug: ls --file-type worked like --indicator-style=slash,
rather than like --indicator-style=file-type.
(FILE_TYPE_INDICATOR_OPTION): New enum member.
(long_options): Map "file-type" to FILE_TYPE_INDICATOR_OPTION,
not to 'p'.
(decode_switches): Handle new case: FILE_TYPE_INDICATOR_OPTION.
Jim Meyering [Thu, 20 Jul 2006 08:34:22 +0000 (08:34 +0000)]
*** empty log message ***
Jim Meyering [Thu, 20 Jul 2006 08:34:15 +0000 (08:34 +0000)]
[ME_REMOTE]: Filter out cifs.
Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
Jim Meyering [Thu, 20 Jul 2006 08:33:19 +0000 (08:33 +0000)]
*** empty log message ***
Jim Meyering [Thu, 20 Jul 2006 07:57:10 +0000 (07:57 +0000)]
*** empty log message ***
Jim Meyering [Thu, 20 Jul 2006 07:57:06 +0000 (07:57 +0000)]
(ME_REMOTE): Compare strchr's result to NULL, not 0, for better readability.
Jim Meyering [Wed, 19 Jul 2006 10:36:02 +0000 (10:36 +0000)]
* src/ls.c (print_dir): Give a better diagnostic for failed opendir.
Jim Meyering [Wed, 19 Jul 2006 09:56:03 +0000 (09:56 +0000)]
*** empty log message ***
Jim Meyering [Wed, 19 Jul 2006 09:54:53 +0000 (09:54 +0000)]
(EXTRA_DIST): Add build-aux/vc-list-files.
Jim Meyering [Wed, 19 Jul 2006 09:54:32 +0000 (09:54 +0000)]
*** empty log message ***
Jim Meyering [Wed, 19 Jul 2006 09:54:28 +0000 (09:54 +0000)]
Command line args correspond to an "include" list, not an exclude list.
Jim Meyering [Wed, 19 Jul 2006 08:43:27 +0000 (08:43 +0000)]
tweak spacing to align backslashes
Paul Eggert [Mon, 17 Jul 2006 05:56:28 +0000 (05:56 +0000)]
In comment: bits bits -> bits.
Paul Eggert [Mon, 17 Jul 2006 03:52:18 +0000 (03:52 +0000)]
Regenerate.
Paul Eggert [Mon, 17 Jul 2006 03:51:25 +0000 (03:51 +0000)]
Regenerate.
Paul Eggert [Mon, 17 Jul 2006 03:35:18 +0000 (03:35 +0000)]
Fix typo in previous checkin; some file names were wrong.
Paul Eggert [Mon, 17 Jul 2006 03:13:14 +0000 (03:13 +0000)]
chmod, install, and mkdir now leave setgid and setuid bits
of directories alone unless you specify them explicitly.
install and mkdir now implement X correctly.
install now creates parent directories with mode 755, without
changing their owner or group.
Paul Eggert [Mon, 17 Jul 2006 03:12:44 +0000 (03:12 +0000)]
Add a test for the X bug.
Paul Eggert [Mon, 17 Jul 2006 03:12:22 +0000 (03:12 +0000)]
Remove re_protect case that no longer applies.
GNU chmod now behaves like other versions of chmod.
Paul Eggert [Mon, 17 Jul 2006 03:11:51 +0000 (03:11 +0000)]
Do the setgid test instead of bailing.
Paul Eggert [Mon, 17 Jul 2006 03:11:01 +0000 (03:11 +0000)]
(main): Adjust to new mode_adjust API.
Paul Eggert [Mon, 17 Jul 2006 03:10:29 +0000 (03:10 +0000)]
(main): Adjust to new mode_adjust API.
Paul Eggert [Mon, 17 Jul 2006 03:10:10 +0000 (03:10 +0000)]
(struct mkdir_options): New struct.
(announce_mkdir, make_ancestor): New functions.
(main): Use them. Adjust to mode_adjust API change. Stick with
umask 0. Use make_dir_parents for all the work.
Paul Eggert [Mon, 17 Jul 2006 03:09:49 +0000 (03:09 +0000)]
Include mkancesdirs.h.
(announce_mkdir, make_ancestor): New functions.
(DEFAULT_MODE): New macro, specifying initial value of 'mode'.
(mode): Use it.
(dir_mode, dir_mode_bits): New vars.
(main): Set dir modes separately from nondir, so that the X
op of -m works correctly.
(main): Remove cwd_errno cruft, since make_dir_parents no longer
affects cwd. Adjust to new make_dir_parents API.
(install_file_in_file_parents): 2nd arg is now char *, not char
const *. Use mkancesdirs instead of rolling our own code.
(change_attributes): Don't worry about AFS, since that kludge
should not be needed any more.
Paul Eggert [Mon, 17 Jul 2006 03:09:26 +0000 (03:09 +0000)]
(process_file): Adjust to mode_adjust API change.
Paul Eggert [Mon, 17 Jul 2006 03:09:09 +0000 (03:09 +0000)]
(gl_PREREQ): Require gl_MKANCESDIRS.
Paul Eggert [Mon, 17 Jul 2006 03:08:42 +0000 (03:08 +0000)]
(gl_MKDIR_PARENTS): Mention dirchownmod.c, dirchownmod.h.
Don't require AC_FUNC_ALLOCA, gl_AFS, gl_CHDIR_SAFER; no longer needed.
Require gl_FUNC_LCHOWN, since dirchownmod.c needs it.
Paul Eggert [Mon, 17 Jul 2006 03:08:18 +0000 (03:08 +0000)]
Remove; no longer needed.
Paul Eggert [Mon, 17 Jul 2006 03:08:04 +0000 (03:08 +0000)]
(gl_MACROS): Remove gl_AFS.
Paul Eggert [Mon, 17 Jul 2006 03:07:41 +0000 (03:07 +0000)]
(mode_adjust): New API.
Paul Eggert [Mon, 17 Jul 2006 03:07:23 +0000 (03:07 +0000)]
(octal_to_mode): New function.
(struct mode_change): New member mentioned.
(make_node_op_equals): New arg mentioned. All callers changed.
(mode_compile): Keep track of which mode bits the user has explicitly
mentioned.
(mode_adjust): New arg DIR, so that we implement the X op correctly.
New arg PMODE_BITS, to keep track of which mode bits the user
mentioned; it treats S_ISUID and S_ISGID speciall.
All callers changed.
Paul Eggert [Mon, 17 Jul 2006 03:07:04 +0000 (03:07 +0000)]
Adjust to new make_dir_parents API.
Paul Eggert [Mon, 17 Jul 2006 03:06:48 +0000 (03:06 +0000)]
Don't include alloca.h, stdio.h, sys/types.h,
unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
(make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
callers changed. Revamp internals significantly, by not
attempting to create directories that are temporarily more
permissive than the final results. Do not attempt to use
save_cwd/restore_cwd; it isn't worth it for mkdir and install.
This removes some race conditions, fixes some bugs, and simplifies
things. Use new dirchownmod function to do owner and mode changes.
Paul Eggert [Mon, 17 Jul 2006 03:06:25 +0000 (03:06 +0000)]
(Mode Structure): Modernize the explanation of the
setuid and setgid bits on directories.
(Changing Special Mode Bits): Mention that a implies both u and g
for s. Cross reference to new node.
(Numeric Modes): Don't claim that 0055 is the same as 55; this isn't
true any more. Mention new node.
4755 is now like u=rwxs,go=rx,g-s, not like u=rwxs,go=rx.
(Directory Setuid and Setgid): New node.
Paul Eggert [Mon, 17 Jul 2006 03:06:03 +0000 (03:06 +0000)]
Change GNU to @acronym{GNU} in a few places.
Use "set-user-ID" and "set-group-ID" a bit more consistently.
Use "appropriate privileges" rather than "super-user" a bit
more consistently.
(install invocation): Parent directories are now 755 without uid
or gid changing. The default mode is now 0755, not 755.
(mkdir invocation): Rewrite the top-level usage description, since
I couldn't easily follow the old one. It's now 3 lines not 8.
For -m, describe file permission bits versus other bits, and note
that mkdir is atomic if you don't mention special bits.
(chmod invocation): Mention what chmod does to setgid and setuid bits.
Paul Eggert [Mon, 17 Jul 2006 03:05:23 +0000 (03:05 +0000)]
Initial version.
Paul Eggert [Mon, 17 Jul 2006 03:02:45 +0000 (03:02 +0000)]
chmod, install, and mkdir now leave setgid and setuid bits
of directories alone unless you specify them explicitly.
install and mkdir now implement X correctly.
install now creates parent directories with mode 755, without
changing their owner or group.
Jim Meyering [Sun, 16 Jul 2006 07:13:07 +0000 (07:13 +0000)]
* userspec.c (parse_with_separator): Say "invalid spec" rather than
the sometimes erroneous "cannot get the login group of a numeric UID"
for a spec like "not-a-username:" or "1:". Reported by
suckfish@ihug.co.nz in https://bugzilla.redhat.com/bugzilla/199027.
Paul Eggert [Fri, 14 Jul 2006 17:54:54 +0000 (17:54 +0000)]
(do_decode): Output to parameter OUT, not to stdout.
Jim Meyering [Fri, 14 Jul 2006 14:42:27 +0000 (14:42 +0000)]
* Makefile.maint (CVS_LIST): Use new file, build-aux/vc-list-files,
rather than open-coding it. Now supports mercurial, too.
* .hgignore: New file.
* Makefile.am (EXTRA_DIST): Add .hgignore, which ignores nearly
all generated files, including ones like configure and po/*.po
that are currently version-controlled in cvs.
* build-aux/vc-list-files: New file.
Jim Meyering [Fri, 14 Jul 2006 14:27:38 +0000 (14:27 +0000)]
* Makefile.am (EXTRA_DIST): Add a few more .??* files.
They've been in CVS, just haven't been distributed before this.
Distribute ChangeLog-2005, too.
(MAINTAINERCLEANFILES): Add THANKS-to-translators.
Paul Eggert [Tue, 11 Jul 2006 17:22:15 +0000 (17:22 +0000)]
Assume <dirent.h> exists, since gnulib assumes this now as well.
Paul Eggert [Tue, 11 Jul 2006 17:19:48 +0000 (17:19 +0000)]
Sync from gnulib.
Paul Eggert [Tue, 11 Jul 2006 03:29:56 +0000 (03:29 +0000)]
(gl_STDINT_H): Like yesterday's change to
absolute-header.m4. Also, set ABSOLUTE_STDINT_H to a string
"no/such/file/stdint.h" when there is no such file, so that
the resulting C code can be parsed by dodgy compilers.
Problems reported by Bob Proulx.
Paul Eggert [Mon, 10 Jul 2006 04:37:33 +0000 (04:37 +0000)]
(gl_ABSOLUTE_HEADER): Use "" rather than <>
around the absolute name, to work around a problem with the HP-UX
11.23 native C compiler, reported by Bob Proulx.
Jim Meyering [Sun, 9 Jul 2006 17:49:28 +0000 (17:49 +0000)]
*** empty log message ***
Jim Meyering [Sun, 9 Jul 2006 17:49:24 +0000 (17:49 +0000)]
(TESTS): Add dir2dir.
Jim Meyering [Sun, 9 Jul 2006 17:48:13 +0000 (17:48 +0000)]
*** empty log message ***
Jim Meyering [Sun, 9 Jul 2006 17:48:08 +0000 (17:48 +0000)]
Adjust so failing with ENOTEMPTY is ok, too.
That happens with Linux/tmpfs.
Paul Eggert [Sun, 9 Jul 2006 17:20:26 +0000 (17:20 +0000)]
Regenerate.
Paul Eggert [Sun, 9 Jul 2006 17:09:48 +0000 (17:09 +0000)]
Adjust to recent updates from gnulib.
Paul Eggert [Sun, 9 Jul 2006 17:08:55 +0000 (17:08 +0000)]
Adjust to today's renaming changes in system.h.
Paul Eggert [Sun, 9 Jul 2006 17:07:12 +0000 (17:07 +0000)]
(print_it): Don't assume char is unsigned.
Paul Eggert [Sun, 9 Jul 2006 17:06:35 +0000 (17:06 +0000)]
(print_esc): Don't assume char is unsigned.
Paul Eggert [Sun, 9 Jul 2006 17:06:06 +0000 (17:06 +0000)]
(create_fullname): Don't assume char is unsigned.
Paul Eggert [Sun, 9 Jul 2006 17:05:33 +0000 (17:05 +0000)]
(is_blank): Remove; no longer needed. All uses
replaced by isblank (to_uchar (...)).
Paul Eggert [Sun, 9 Jul 2006 17:05:13 +0000 (17:05 +0000)]
(unexpand): Don't assume that isprint etc. return
booleans (needed for pre-C99 hosts).
Paul Eggert [Sun, 9 Jul 2006 17:04:48 +0000 (17:04 +0000)]
(is_char_class_member): Don't assume that isprint etc. return
booleans (needed for pre-C99 hosts).
Paul Eggert [Sun, 9 Jul 2006 17:04:06 +0000 (17:04 +0000)]
(initialize_regex, fix_output_parameters): Don't assume that isprint
etc. return booleans (needed for pre-C99 hosts).
(SKIP_NON_WHITE, SKIP_WHITE, SKIP_WHITE_BACKWARDS):
(copy_unescaped_string): Don't assume char is unsigned.
Paul Eggert [Sun, 9 Jul 2006 17:03:20 +0000 (17:03 +0000)]
(check_punctuation): Don't assume that isprint etc. return
booleans (needed for pre-C99 hosts).
Paul Eggert [Sun, 9 Jul 2006 17:02:53 +0000 (17:02 +0000)]
(expand): Don't assume that isprint etc. return
booleans (needed for pre-C99 hosts).
Paul Eggert [Sun, 9 Jul 2006 17:02:17 +0000 (17:02 +0000)]
(inittables): Use toupper rather than
islower followed by toupper; it's simpler and typically
faster now that we assume at least C89 semantics. Similarly
for tolower.