summaryrefslogtreecommitdiff
path: root/src/chmod.c
AgeCommit message (Collapse)Author
2006-01-17Now that fts no longer changes the current working directory, adjustJim Meyering
its clients accordingly -- note that du.c uses fts but doesn't need any adjustment, since it doesn't operate on the actual files, but rather just uses the stat buffers provided by fts. Include "openat.h". (process_file): Use chmodat (fts->fts_cwd_fd,... in place of chmod (...
2005-06-29(main): Use X2REALLOC rather than x2realloc.Jim Meyering
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-04Include quotearg.h.Paul Eggert
(diagnose_surprises): New var. (process_file): Diagnose surprises. Simplify the logic a bit, while we're at it. (main): Prepare to diagnose surprises. Remove useless code for '-' option.
2005-04-28(change, umask_value): New static vars.Paul Eggert
(reference_file): Move this static var to inside "main". (process_file, process_files): Remove CHANGES arg; now taken from static var. All uses changed. (usage): Fix incorrect description of MODE operand. (main): For invalid mode usages, output a brief usage message. Adjust to new modechange API.
2005-03-28(long_options): Use NULL, not `0'.Jim Meyering
2004-09-24(main): Revamp option processing to support "chmod -r -w file".Paul Eggert
2004-09-21Remove unused "case 0".Paul Eggert
2004-07-30(recurse, force_silent, process_file, process_files, main): Use boolPaul Eggert
when appropriate.
2004-06-21(main): Standardize on the diagnostics given when someone givesJim Meyering
too few operands ("missing operand after `xxx'") or too many operands ("extra operand `xxx'"). Include "quote.h" and/or "error.h" if it wasn't already being included.
2004-06-09(mode_changed): Return false, not 0, now that the function returns `bool'.Jim Meyering
2004-06-09Adjust chmod and chown to be similar if -c or -v are given. InJim Meyering
particular, a no-op chown is no longer reported as a change; this reverts to previous behavior. Also, fix both commands so that -v report failures even if the failure is not due to the chmod or chown syscalls. * src/chmod.c (CH_NOT_APPLIED): New constant. (describe_change): Handle it. (process_file): Use it, if a symlink wasn't changed. (mode_changed): Return bool, not int. Accept new argument NEW_MODE; all callers changed. This lets us avoid statting the file unless the new mode has unusual bits. (process_file): Return -1 on error. With -v, report all errors verbosely, not just some.
2004-03-27Don't include savedir.h -- no longer needed.Jim Meyering
2004-01-21(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
2003-11-09(usage): Describe new options.Jim Meyering
2003-11-09Include "root-dev-ino.h".Jim Meyering
(process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and ROOT_DEV_INO_WARN macros. (get_root_dev_ino): Remove function definition, now that it's been moved to a separate file.
2003-11-04(AUTHORS): Add my name.Jim Meyering
2003-10-19chmod now uses fts to perform a directory traversal when -R isJim Meyering
specified. Before, it operated on full path names, and as such would encounter the PATH_MAX (often 4096) limit. Include "xfts.h". (process_file): Rename from change_file_mode. Adapt to be used with fts. (process_files): New function.
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings. Update the call to parse_long_options so that `AUTHORS, NULL' are the last parameters. * src/true.c (main): Append NULL to version_etc argument list. * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-10-12New options: --preserve-root and --no-preserve-root.Jim Meyering
(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(change_file_mode): Don't #ifdef-out a simple use ofJim Meyering
S_ISLNK. The S_IS* macros are guaranteed to be defined via system.h.
2003-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-06-17(main): Call initialize_main.Jim Meyering
2002-12-15Remove all uses of `PARAMS'.Jim Meyering
2002-08-31Change `exit (0)' to `exit (EXIT_SUCCESS)',Jim Meyering
`exit (1)' to `exit (EXIT_FAILURE)', and `usage (1)' to `usage (EXIT_FAILURE)'.
2002-08-30Change `error (1, ...' to `error (EXIT_FAILURE, ...'.Jim Meyering
2002-07-02(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.Jim Meyering
2001-12-11split long lineJim Meyering
2001-12-11(change_file_mode, main):Jim Meyering
Include the word `fail' in some diagnostics to make it clearer that they indicate a failure. s/getting attributes/failed to get attributes/
2001-12-02Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTIONJim Meyering
instead of hard-coding --help and --version descriptions.
2001-11-23Split usage strings so that --help and --versionJim Meyering
descriptions are alone in their own string.
2001-11-23(usage): Split --help output into smaller pieces.Jim Meyering
Use fputs, not printf.
2001-09-15(main): Don't strip trailing slashes; POSIX doesn't allow it here.Jim Meyering
Don't include "dirname.h" when no longer needed.
2001-08-31(change_dir_mode): Remove statp arg; no longer needed.Jim Meyering
2001-05-12(strip_trailing_slashes): Remove declaration; now in dirname.h.Jim Meyering
2001-05-12(mode_changed, change_file_mode):Jim Meyering
There's no need to invoke both lstat and stat here, so call just one of the two functions.
2000-11-23(mode_changed): New function.Jim Meyering
(change_file_mode): Use it to determine accurately when -c should make chmod announce there's been a change.
2000-11-01(main): Better diagnostics.Jim Meyering
2000-09-30(change_file_mode): Perform the chmod even if theJim Meyering
file mode permission bits are the same as those that should be set. Omitting the chmod call would be alright with minimal 1003.1e DS17 ACLs, but eventually there will be other permissions in addition to rwx. E.g., add and delete for directories, and something analogous to NT's take ownership permission.
2000-08-08(main): Invoke xalloc_die instead of printing our own message.Jim Meyering
2000-07-30Convert "`%s'" in format strings to "%s", and wrap eachJim Meyering
corresponding argument in a `quote (...)' call. Add more precise diagnostics.
2000-07-25(change_file_mode): Save errno from a possibly failed chown,Jim Meyering
and use that later. Otherwise, errno itself could be clobbered before used.
2000-06-27(change_dir_mode): Don't set errno beforeJim Meyering
invoking savedir, and assume that errno is nonzero if savedir fails.
2000-05-13Arrange to call close_stdout only upon exit.Jim Meyering
1999-11-07Use REFERENCE_FILE_OPTION instead of bare `CHAR_MAX + 1'.Jim Meyering
1999-08-08(change_dir_mode): Remove cast of savedir arg.Jim Meyering
1999-04-26(describe_change, change_file_mode): Use proper mode_t types and macros.Jim Meyering
Don't assume the traditional Unix values for mode bits.
1999-03-31Don't include closeout.h or version-etc.h explicitly. Now, they're included ↵Jim Meyering
via sys2.h.
1999-03-26define and use AUTHORSJim Meyering