1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-05-31 23:06:33 +02:00
Commit Graph

103 Commits

Author SHA1 Message Date
Paul Eggert 51050b62c8 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.
2006-01-02 06:37:36 +00:00
Jim Meyering 52893ffd2a (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.
2005-12-19 18:17:16 +00:00
Paul Eggert 0b2ac253e7 (create_parents): Remove static var (now local to 'main').
(main): Standardize on a diagnostic for restore_cwd failure,
and report errno.
Don't bother to check cwd_errno unless create_parents.
Use mkdir rather than make_dir; it's simpler.
2005-06-14 23:55:47 +00:00
Paul Eggert 7cc0d42200 (main): Adjust to new make_dir_parents convention. 2005-06-14 18:35:58 +00:00
Jim Meyering 19c47583a2 tweak diagnostic wording: Use `... return to working directory', rather
than `... restore working directory'.
2005-06-14 08:18:43 +00:00
Jim Meyering 4063f9696c (main): When make_dir_parents changes the current working
directory, give a diagnostic about each subsequent failure to create
a dot-relative directory.
2005-06-13 10:17:36 +00:00
Paul Eggert 97603a5d2a Don't use "path" or "filename". 2005-06-02 05:17:24 +00:00
Jim Meyering 44d59bb168 Update FSF postal mail address. 2005-05-14 07:58:31 +00:00
Jim Meyering c0c815af8d Update FSF postal mail address. 2005-05-14 06:57:06 +00:00
Paul Eggert 71a7e54b0d mode_free -> free 2005-05-01 14:27:51 +00:00
Paul Eggert b1fdaf5ac7 (main): Adjust to new modechange API.
Also, free the mode_change object when done.
2005-04-28 16:31:09 +00:00
Paul Eggert 5ce302fba5 (main): Compile mode with MODE_MASK_ALL and initial umask. 2005-04-22 23:52:35 +00:00
Paul Eggert 81ca57a91d Remove unused "case 0". 2004-09-21 22:26:42 +00:00
Paul Eggert 5c53a006eb (create_parents, main): Use bool when appropriate.
(main): Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
2004-07-30 20:29:29 +00:00
Jim Meyering 1ce7b61d0e (main): Standardize on the diagnostics given when someone gives
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-21 15:03:35 +00:00
Jim Meyering 312d661ada (usage): Use EXIT_SUCCESS, not 0, for clarity. 2004-01-21 23:21:31 +00:00
Jim Meyering cf4fdf373f Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
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-18 10:05:47 +00:00
Jim Meyering bafd927f03 (WRITTEN_BY): Rename from AUTHORS.
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
2003-09-18 22:19:03 +00:00
Jim Meyering 6bcd4b08ba (main): Call initialize_main. 2003-06-17 18:13:23 +00:00
Jim Meyering 8c10d25fd0 Fix things so `mkdir -p' can create very deep directories, e.g.,
mkdir -p $(perl -e 'print "a/" x 40000') now works.

(main): For --parents (-p), call make_path with the
entire directory name, so we don't ever require that file operations
like stat or chmod be performed on the entire command line argument.
2002-09-28 07:51:17 +00:00
Jim Meyering 4006f4e672 Change exit (0)' to exit (EXIT_SUCCESS)',
`exit (1)' to `exit (EXIT_FAILURE)', and
`usage (1)' to `usage (EXIT_FAILURE)'.
2002-08-31 08:52:10 +00:00
Jim Meyering 7488703199 Change error (1, ...' to error (EXIT_FAILURE, ...'. 2002-08-30 23:04:53 +00:00
Jim Meyering d23970e52e (usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it. 2002-07-02 09:05:33 +00:00
Jim Meyering f3ac2e7839 Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION
instead of hard-coding --help and --version descriptions.
2001-12-02 22:26:57 +00:00
Jim Meyering 072b27d4d2 (usage): Note that ``Mandatory arguments to long options are mandatory
for short options too.''
2001-11-23 20:29:56 +00:00
Jim Meyering b78de3e724 Split usage strings so that --help and --version
descriptions are alone in their own string.
2001-11-23 20:10:25 +00:00
Jim Meyering 08e983d3df (main): Don't strip trailing slashes; POSIX doesn't allow it here.
Don't include "dirname.h" when no longer needed.
2001-09-15 11:15:56 +00:00
Jim Meyering 4a94a06aa6 (strip_trailing_slashes): Remove declaration; now in dirname.h. 2001-05-12 09:51:23 +00:00
Jim Meyering 241297f40e (main): Remove assignment-in-if-expression.
In fact, remove t_errno altogether.
2001-02-21 10:56:06 +00:00
Jim Meyering cc27b86c60 (main): Remove any trailing slash unconditionally.
Reported by Volker Borchert.
2000-12-02 13:20:37 +00:00
Jim Meyering 8bbc00b147 (main): When failing to create a directory, give only
one diagnostic, not two.  Reported by Volker Borchert.
2000-11-18 13:49:44 +00:00
Jim Meyering caf54306a3 (main): With --parents, remove any trailing slashes
from the argument to the final mkdir call.  Required for NetBSD.
2000-11-18 13:36:24 +00:00
Jim Meyering 445485d9b8 Do not set the permissions of the final directory
component if it was not just created.
Based on a patch from Volker Borchert.
2000-11-09 22:21:59 +00:00
Jim Meyering 9b18c35ac9 (main): Use make_dir instead of using mkdir directly.
Diagnose as failure when mkdir tries to create (without the
--parent (-p) option) a directory that already exists.
2000-11-05 15:14:09 +00:00
Jim Meyering 50326157d9 remove const attribute for PARENTS 2000-11-01 17:53:35 +00:00
Jim Meyering 9e9f0846f8 Fix bad typo! free the string, PARENTS, not the function, dir_name. 2000-11-01 17:52:43 +00:00
Jim Meyering c8da0cbba6 `mkdir -p' would create parent directories with permissions
that did not account for the umask. [introduced with the
2000-09-30 change that became part of fileutils-4.0.28]

Include dirname.h.
Compute the parent directory `mode' unconditionally, effectively
as `$(umask -S),u+wx'.
Use make_path to create only the parent directories, thus using
the same code, both with and without -p, to create the final
component in each file name.  Reported by Bob Proulx.
2000-10-31 19:25:50 +00:00
Jim Meyering daf9d41918 (main): Rename local symbolic_mode' to specified_mode'. 2000-09-30 08:49:51 +00:00
Jim Meyering 105cbe3ea3 (main): Don't set the umask to 0 and hand-apply
the previously-set umask unconditionally.  Do that only when a
MODE has been specified.  Otherwise, call mkdir with the full
creation mask (0777 or 0666) and let the kernel apply the umask.
The difference shows up only on file systems with ACL support
when the containing directory has a default ACL.
Patch by Andreas Gruenbacher.
2000-09-30 08:49:17 +00:00
Jim Meyering 3a66ad8dcd (S_IRWXUGO): Remove definition. 2000-09-08 09:01:02 +00:00
Jim Meyering b99ee65d9f (main): Invoke xalloc_die instead of printing our own message. 2000-08-08 07:12:24 +00:00
Jim Meyering fb61cfca00 Convert "`%s'" in format strings to "%s", and wrap each
corresponding argument in a `quote (...)' call.
2000-07-30 16:26:43 +00:00
Jim Meyering 8cb9b753c5 Allow -v as synonym for --verbose, to be consistent with other fileutils. 2000-06-03 08:10:37 +00:00
Jim Meyering 81b16373ae Arrange to call close_stdout only upon exit. 2000-05-13 06:49:53 +00:00
Jim Meyering 5aeb94aeb4 Rename global: s/path_mode/create_parents/.
(main): No longer perform explicit chmod when creating
parent directories, since make_path now does the chmod.
2000-04-26 12:43:12 +00:00
Jim Meyering 06c06bd6f7 (S_IRWXUGO): Define if necessary.
(main): Use chmod to set the permissions if bits other than those
of S_IRWXUGO were requested.  Reported by Sami Farin.
1999-11-17 08:18:38 +00:00
Jim Meyering 9250d1a34f (main): Use better wording in diagnostic: `cannot
create directory' rather than `cannot make directory'.  The former
also matches the one in makepath.c.
1999-05-07 18:40:11 +00:00
Jim Meyering 750e5969ff (main): Use proper mode_t types and macros.
Don't assume the traditional Unix values for mode bits.
1999-04-26 12:49:59 +00:00
Jim Meyering c4cf0531ff (main): Qualify a char* with the `const' keyword. 1999-04-01 05:10:41 +00:00
Jim Meyering 667799f7e2 Don't include closeout.h or version-etc.h explicitly. Now, they're included via sys2.h. 1999-03-31 05:59:13 +00:00