Commit Graph
17085 Commits
Author SHA1 Message Date
Jim Meyering feede2bf33 *** empty log message *** 2003-10-15 21:21:34 +00:00
Jim Meyering 0ebfdf25d1 Include "fts_.h".
(WRITTEN_BY): Add my name.
(MAXUID, MAXGID): Remove definitions.  Use GID_T_MAX instead of
the latter.
(usage): Update.
(main): Handle new options.
Call new function, chown_files rather than change_file_owner.
2003-10-15 21:21:29 +00:00
Jim Meyering fe9f5bdf77 chown now accepts POSIX-mandated -H, -L, -P options and uses
fts to perform a directory traversal when -R is specified.
Before, it used explicit recursion, and as such was limited by
the user's stack size to handling hierarchies no deeper than
about 30,000 levels.

Include "userspec.h" and "fts_.h".
(WRITTEN_BY): Add my name.
(getpwnam, getgrnam, getgrgid): Remove declarations.
(endpwent): Remove definition.
(usage): Update
(main): Handle new options.
Call new function, chown_files rather than change_file_owner.
2003-10-15 21:16:46 +00:00
Jim Meyering a2740f057a *** empty log message *** 2003-10-15 14:23:37 +00:00
Jim Meyering ec118e6018 Include "userspec.h". 2003-10-15 14:23:25 +00:00
Jim Meyering 130378f8c2 *** empty log message *** 2003-10-15 14:22:19 +00:00
Jim Meyering 7b60fac170 (libfetish_a_SOURCES): Add userspec.h. 2003-10-15 14:22:13 +00:00
Jim Meyering cf04b8d092 *** empty log message *** 2003-10-15 14:21:51 +00:00
Jim Meyering dcac334f28 [enum Dereference_symlink]: Remove declaration.
[struct Chown_option] (recurse, force_silent): Change type to `bool'.
[struct Chown_option] (dereference): Remove member with ambiguous name.
[struct Chown_option] (affect_symlink_referent): New member.
(chown_files): New prototype.
2003-10-15 13:57:21 +00:00
Jim Meyering 9c81925d00 Rewrite to iterate through hierarchies using fts rather than
via explicit recursion.

Include "fts_.h"
(change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
on a single file at a time.
(chown_files): New function.
2003-10-15 13:56:28 +00:00
Jim Meyering e50c7e853f *** empty log message *** 2003-10-15 08:39:41 +00:00
Jim Meyering 7d3d2fb075 *** empty log message *** 2003-10-15 07:43:07 +00:00
Jim Meyering 0d3c3801d6 (ln invocation): Note that --directory, -d, -F
probably won't work even for superuser.
2003-10-15 07:43:04 +00:00
Jim Meyering 38f68e78ae (usage): Clarify that --directory, -d, -F probably won't
work even for superuser.  Suggestion from Dan Jacobson.
2003-10-15 07:40:52 +00:00
Jim Meyering 0eab16782d *** empty log message *** 2003-10-15 07:27:00 +00:00
Jim Meyering c8043fb655 Sync with gnulib. 2003-10-15 07:26:36 +00:00
Jim Meyering 7edceab01c Sync with gnulib. 2003-10-15 07:26:01 +00:00
Jim Meyering 3cb9191034 *** empty log message *** 2003-10-15 07:25:53 +00:00
Jim Meyering a9825dd2a6 (parse_field_count): Handle the case where overflow
and invalid suffix char are both reported.
2003-10-15 07:24:39 +00:00
Jim Meyering 92f4be12b1 (decode_switches) [TIOCGWINSZ]: Comment out the
warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
true on Linux.
2003-10-14 20:59:50 +00:00
Jim Meyering 8061cc6dbc *** empty log message *** 2003-10-14 14:55:18 +00:00
Jim Meyering 150d562831 . 2003-10-14 14:44:28 +00:00
Jim Meyering e5bc5afc7b . 2003-10-14 14:43:59 +00:00
Jim Meyering 91e5e022c6 *** empty log message *** 2003-10-14 14:04:35 +00:00
Jim Meyering 5a3141adaa *** empty log message *** 2003-10-14 13:58:18 +00:00
Jim Meyering 25a26bee10 (TESTS): Add posix-H. 2003-10-14 13:22:32 +00:00
Jim Meyering 1c4bd21e70 add a blank line 2003-10-14 09:34:05 +00:00
Jim Meyering 94531ab4b7 *** empty log message *** 2003-10-14 09:09:47 +00:00
Jim Meyering d7bed21394 Fix to avoid a denial-of-service attack if the display width is
enormous.  Also, clean up the code a bit by removing duplicate code.

(init_column_info): Remove forward decl; no longer needed.
(calculate_columns): New function, that contains code that used
to be common to print_many_per_line and print_horizontal.
(print_many_per_line, print_horizontal): Use it.
(decode_switches): Set max_idx here, not in calculate_columns.
(print_current_files): Don't call init_column_info; calculate_columns
now does that.
(init_column_info): Don't allocate a lot more space than is needed
to represent the current set of files.  Allocate all the new
size_t cells in one call to xnmalloc, rather than a row at a time.
2003-10-14 09:09:43 +00:00
Jim Meyering 49c9c00c8a *** empty log message *** 2003-10-14 09:04:57 +00:00
Jim Meyering 26afdbc959 *** empty log message *** 2003-10-14 09:04:36 +00:00
Jim Meyering 6f46445e68 *** empty log message *** 2003-10-13 20:50:46 +00:00
Jim Meyering ae2e1ea1dc (init_column_info): Add another FIXME comment. 2003-10-13 20:50:40 +00:00
Jim Meyering 1b1fc9b9ee *** empty log message *** 2003-10-13 16:02:08 +00:00
Jim Meyering dbe372ab32 *** empty log message *** 2003-10-13 15:59:11 +00:00
Jim Meyering 12af30108d *** empty log message *** 2003-10-13 15:28:36 +00:00
Jim Meyering d8cb14e234 Import latest version from gnulib. 2003-10-13 15:28:29 +00:00
Jim Meyering 9255d03f39 *** empty log message *** 2003-10-13 15:27:18 +00:00
Jim Meyering 0e59370bc6 Import latest version from gnulib. 2003-10-13 15:27:11 +00:00
Jim Meyering ccfc4801cb Import latest version from gnulib. 2003-10-13 15:26:45 +00:00
Jim Meyering 7be8d88dd3 Import latest version from gnulib. 2003-10-13 15:17:05 +00:00
Jim Meyering a8e60e65f8 (struct bin_str.len, length_of_file_name_and_frills, indent,
nfiles, files_index, tabsize, line_length, struct column_info.line_len,
struct column_info.col_arr[0], max_idx):
Now size_t, not int.
(get_funky_string): Return bool indicating success, instead of
a negative count to indicate failure.  Store number of columns
through new parameter OUTPUT_COUNT; that way, they can never
go negative.  Change equals_end from int to bool.  All uses
changed.
(struct column_info.valid_len): Now bool, not int.  All uses changed.
(dired_dump_obstack, get_funky_string, clear_files,
extract_dirs_from_files, print_current_files,
print_many_per_line, print_horizontal, init_column_info,
put_indicator, length_of_file_name_and_frills,
print_with_commas): Use size_t, not int, for local variables
that count sizes.
(decode_switches): Decode sizes using xstrtoul, not xstrtol.
Check for TIOCGWINSZ returing negative values (or values greater
than SIZE_MAX!).
(visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
init_column_info):
Use xmalloc and xnmalloc, not XMALLOC.
(gobble_file): Use xnrealloc, not XREALLOC.
(print_color_indicator): Remove now-unnecessary cast to size_t.
2003-10-13 15:16:27 +00:00
Jim Meyering aa615387af (print_many_per_line): Add FIXME comment. 2003-10-13 14:26:50 +00:00
Jim Meyering 6e2f5aeeb6 Change wording of diagnostic to match latest du.c. 2003-10-13 06:56:47 +00:00
Jim Meyering 1d3f87109d *** empty log message *** 2003-10-13 06:56:40 +00:00
Jim Meyering bffa99072f *** empty log message *** 2003-10-13 06:54:23 +00:00
Jim Meyering f89cc866b3 Remove from CVS; assume that people
brave enough to check coreutils out from CVS can rebuild it.
2003-10-13 06:53:50 +00:00
Jim Meyering f28258e142 *** empty log message *** 2003-10-12 14:20:14 +00:00
Jim Meyering 9be74f6f12 New options: --preserve-root and --no-preserve-root.
(change_file_mode): Honor new option.
(change_file_mode): Strip trailing slashes on directory
argument passed to change_dir_mode.
(get_root_dev_ino): New function.
(main): Initialize global, root_dev_ino.
2003-10-12 14:19:25 +00:00
Jim Meyering 820a623d7d *** empty log message *** 2003-10-12 07:05:30 +00:00