Commit Graph
18511 Commits
Author SHA1 Message Date
Jim Meyering 593aea0e97 *** empty log message *** 2004-05-28 21:04:15 +00:00
Jim Meyering bbe6051c33 *** empty log message *** 2004-05-28 21:01:53 +00:00
Jim Meyering 460f685be6 *** empty log message *** 2004-05-22 16:30:11 +00:00
Jim Meyering 3ba72c8b9c (rm): Use free rather than XFREE.
(remove_dir): Use xmalloc, not XMALLOC.
(ds_init): Likewise.
2004-05-22 16:29:20 +00:00
Jim Meyering e5e96abfd2 *** empty log message *** 2004-05-21 14:32:22 +00:00
Jim Meyering 19000dd0f1 (TESTS): Add inaccessible. 2004-05-21 14:32:20 +00:00
Jim Meyering b3d364fc9d *** empty log message *** 2004-05-21 14:28:45 +00:00
Jim Meyering e42baab490 # Ensure that rm works even when run from a directory
# for which the user has no access at all.
2004-05-21 13:59:31 +00:00
Jim Meyering c4083b0a9b *** empty log message *** 2004-05-21 07:50:53 +00:00
Jim Meyering 8492b24cfc update from gnulib 2004-05-21 07:50:27 +00:00
Jim Meyering 80bb79d05b *** empty log message *** 2004-05-21 07:49:01 +00:00
Jim Meyering 610a755701 update from gnulib 2004-05-21 07:48:44 +00:00
Jim Meyering ee2c5f05fd *** empty log message *** 2004-05-21 07:48:32 +00:00
Jim Meyering be5c1f5065 update from gnulib 2004-05-21 07:45:45 +00:00
Jim Meyering 29cb8457bc update from gnulib 2004-05-21 07:44:35 +00:00
Jim Meyering da45f1948e update from gnulib, again 2004-05-21 06:41:51 +00:00
Jim Meyering f40938936d *** empty log message *** 2004-05-21 06:40:36 +00:00
Jim Meyering 3b7026427d Update from gnulib (fix reversed test). 2004-05-21 06:40:31 +00:00
Jim Meyering aa1b76461d . 2004-05-20 11:39:58 +00:00
Jim Meyering 994e9be511 Update from gnulib. 2004-05-20 11:39:54 +00:00
Jim Meyering 142d646e01 *** empty log message *** 2004-05-20 11:37:11 +00:00
Jim Meyering 53416c2060 (sc_unmarked_diagnostics): Now that the unmarked
diagnostics in shred.c have been fixed, don't exempt shred.c from
this check.
2004-05-20 11:37:07 +00:00
Jim Meyering 4cd8ec52aa *** empty log message *** 2004-05-20 11:35:47 +00:00
Jim Meyering 84b82a4aa2 Use translatable diagnostics, e.g.
change "%s: remove" to _("%s: failed to remove") and
change "%s: close"  to _("%s: failed to close").
2004-05-20 11:35:40 +00:00
Jim Meyering a439f41352 *** empty log message *** 2004-05-20 06:49:55 +00:00
Jim Meyering 68fd92338e Update from gnulib. 2004-05-20 06:49:52 +00:00
Jim Meyering 2825db7efb *** empty log message *** 2004-05-18 15:28:38 +00:00
Jim Meyering 40d4847f4c (names): Bring back lower-case letters, "_", and
".".  But continue to omit +, =, %, @, #, as they're either
shell metacharacters (for some shells) or are not in some
character sets, or (in the case of '%') must be a
metacharacter somewhere.
2004-05-18 15:28:27 +00:00
Jim Meyering 9057c23a8b *** empty log message *** 2004-05-17 13:39:06 +00:00
Jim Meyering 54806e3dcc . 2004-05-17 13:21:40 +00:00
Jim Meyering c42d585298 Sync with gnulib. 2004-05-17 13:20:25 +00:00
Jim Meyering 4e88ae7892 Sync with gnulib. 2004-05-17 13:18:34 +00:00
Jim Meyering 37dfecb6e7 Sync with gnulib. 2004-05-17 13:17:45 +00:00
Jim Meyering 7f814a5e96 (cut_fields): Adjust to new signature of getndelim2. 2004-05-17 13:16:53 +00:00
Jim Meyering ee47cc09f6 (incname): Decrement `len' only once per loop iteration. 2004-05-17 12:34:36 +00:00
Jim Meyering c91f1d4a89 *** empty log message *** 2004-05-17 12:29:37 +00:00
Jim Meyering 85c13fad0c *** empty log message *** 2004-05-17 12:16:16 +00:00
Jim Meyering 039d3f9981 *** empty log message *** 2004-05-17 12:15:45 +00:00
Jim Meyering 26380c3504 . 2004-05-17 12:11:54 +00:00
Jim Meyering da9163d7b6 . 2004-05-17 12:11:19 +00:00
Jim Meyering 06dc5c8efa *** empty log message *** 2004-05-17 12:10:55 +00:00
Jim Meyering 58f134b649 Use -h where necessary to retain semantics. 2004-05-17 12:10:43 +00:00
Jim Meyering a432ab952a *** empty log message *** 2004-05-17 12:08:24 +00:00
Jim Meyering 636a950344 chgrp and chown now dereference symlinks by default, per POSIX.
(usage): Update to reflect this.
2004-05-17 12:08:09 +00:00
Jim Meyering c2740635cd (chopt_init): Affect each symlink referent by default. 2004-05-17 12:07:48 +00:00
Jim Meyering 36708ba6b5 *** empty log message *** 2004-05-17 12:07:30 +00:00
Jim Meyering 3591f10746 chgrp and chown now dereference symlinks by default, per POSIX.
(chgrp invocation, chown invocation): Document it.
2004-05-17 12:07:25 +00:00
Jim Meyering 37adce2680 chown --dereference did nothing when the owner/group of a
symlink matched the desired owner/group.  Reported by David Malone.
Also reported in 1999 as http://bugs.debian.org/39642.

(change_file_owner): When --dereference has
been specified, and when processing a symlink, stat it to get the
owner and group of the referent.
2004-05-16 21:39:35 +00:00
Jim Meyering 23e13a64a8 *** empty log message *** 2004-05-16 19:32:37 +00:00
Jim Meyering 3bb407ccf3 In shred, check for errors from fdatasync more carefully. If
fdatasync fails with errno==EINVAL, it means this implementation
does not support synchronized I/O for this file.  Do not report
this as an error, as (for example) AIX 5.2 fdatasync reports it
for raw disk devices.  Problem reported by Albert Chin in
<http://mail.gnu.org/archive/html/bug-gnu-utils/2004-05/msg00028.html>.

Check for write errors, though: the old code ignored them.
Improve error checking in a few other cases, too (e.g., close of a
directory).

Also, change several 'int' values to 'bool', so that the error
checking is a bit clearer.  Similarly, change unsigned values
to size_t where appropriate.

* src/shred.c: Include "dirname.h".
(datasync) [!HAVE_FDATASYNC]: Remove.
(dosync): New function.
(dopass): Use it.  Return 1 on write error, -1 on other error.
All callers changed.  Report write error if dosync does.
(do_wipefd, wipefd, wipename, wipefile): Return bool (true/false),
not int (0/-1).  All callers changed.  Return false if there's a
write error.
(incname): Return bool (true/false), not int (0/1).  Accept
size_t length, not unsigned.  All callers changed.  Do not
bother checking for non-digits; it can't happen.  Replace
recursion with iteration.
(wipename): Use dir_name, base_name, etc. instead of assuming
Unix file names.  Use size_t for length, not unsigned.
Report error if unlink or close fails.
(wipename, main): Use bool for booleans.

(names): Use only digits and uppercase letters, for greater
portability.
2004-05-16 19:32:30 +00:00