mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
Merge branch 'master' of /cu
This commit is contained in:
commit
0f63eebd1e
114 files changed
+439
-960
No files matched your search
+1
-1
@@ -1 +1 @@
|
||||
6.7
|
||||
6.9
|
||||
@@ -1,5 +1,129 @@
|
||||
2007-03-28 Jim Meyering <jim@meyering.net>
|
||||
|
||||
Help translators include translation team's web or email address.
|
||||
* src/system.h (emit_bug_reporting_address): New function.
|
||||
* src/base64.c: Use it rather than a literal printf.
|
||||
* src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c:
|
||||
* src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c:
|
||||
* src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c:
|
||||
* src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c:
|
||||
* src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c:
|
||||
* src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c:
|
||||
* src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c:
|
||||
* src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c:
|
||||
* src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c:
|
||||
* src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c:
|
||||
* src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c:
|
||||
* src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c:
|
||||
* src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c:
|
||||
* src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c:
|
||||
* src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c:
|
||||
* src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c:
|
||||
* src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c:
|
||||
* src/who.c, src/whoami.c, src/yes.c: Likewise.
|
||||
|
||||
* src/stty.c: Don't include "vasprintf.h", now that its
|
||||
declarations are guaranteed to be in gnulib's stdio.h.
|
||||
* src/who.c: Likewise.
|
||||
|
||||
2007-03-27 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* README: Use "install", not "ginstall" in the list of program names.
|
||||
* src/Makefile.am (check-README): Substitute s/ginstall/install/.
|
||||
|
||||
2007-03-25 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/c99-to-c89.diff: Regenerate.
|
||||
|
||||
2007-03-25 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Avoid the need for euidaccess and/or lstat on every directory entry
|
||||
with 'rm -r dir' (without -f), if we are root, or if we are removing
|
||||
a directory tree that is full of symbolic links.
|
||||
* bootstrap.conf (gnulib_modules): Add write-any-file.
|
||||
* src/copy.c: Include write-any-file.h.
|
||||
(UNWRITABLE): Remove macro, replacing with....
|
||||
(writable_destination): New function, which uses can_write_any_file
|
||||
to avoid the need for euidaccess when we are privileged.
|
||||
(overwrite_prompt, abandon_move): Use it.
|
||||
* src/remove.c: Include write-any-file.h.
|
||||
(D_TYPE): New macro.
|
||||
(DT_UNKNOWN, DT_DIR, DT_LNK) [!HAVE_STRUCT_DIRENT_D_TYPE]: New macros.
|
||||
(write_protected_non_symlink): Don't bother to stat if we can write
|
||||
any file.
|
||||
(prompt): New arg PDIRENT_TYPE. All callers changed.
|
||||
Use readdir dirent type to avoid the need for 'lstat' on each directory
|
||||
entry in cases like 'rm -r dir', if we are root, or if the tree is
|
||||
full of symbolic links.
|
||||
(DT_IS_KNOWN, DT_MUST_BE): Remove.
|
||||
(remove_entry): New arg DIRENT_TYPE_ARG. All callers changed.
|
||||
|
||||
2007-03-24 Jim Meyering <jim@meyering.net>
|
||||
|
||||
If strace malfunctions, skip the test rather than failing it.
|
||||
* tests/mv/atomic: Required on a mips-unknown-linux-gnu system
|
||||
running the aging linux-2.4.27-mipscvs-20040814.
|
||||
|
||||
2007-03-23 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* src/pathchk.c: Don't include euidaccess.h, as we don't call
|
||||
euidaccess.
|
||||
|
||||
2007-03-23 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* README-package-renamed-to-coreutils: Add a URL for the FAQ,
|
||||
and a couple more archive links.
|
||||
|
||||
2007-03-22 Jim Meyering <jim@meyering.net>
|
||||
|
||||
Post-release version change.
|
||||
* NEWS: Add a line for 6.9+.
|
||||
* configure.ac (AC_INIT): Set new version string.
|
||||
|
||||
Version 6.9.
|
||||
* NEWS: Record release date and new version number.
|
||||
* configure.ac (AC_INIT): New version number.
|
||||
|
||||
* tests/mv/hard-3: Correct the preceding change: $3 -> $2.
|
||||
|
||||
2007-03-22 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Improve a test script.
|
||||
* tests/mv/hard-3: Check for 'ls' failure, too.
|
||||
Generate more-useful debugging output when 'ls' fails.
|
||||
|
||||
2007-03-21 Jim Meyering <jim@meyering.net>
|
||||
|
||||
Fix a test script not to claim an ext2 file system is of type xfs.
|
||||
* tests/du/slink: When using df --local and df --type=TYPE,
|
||||
test only the exit code. Don't bother with stdout.
|
||||
Prompted by a report by Thomas Schwinge of an inaccurate diagnostic.
|
||||
|
||||
* gl/lib/savewd.c: Remove this file, since the savewd_save change
|
||||
is now in gnulib. The other wasn't useful.
|
||||
|
||||
2007-03-20 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* gl/lib/acl.c: Remove this file, now that gnulib's version subsumes it.
|
||||
|
||||
Skip part of this test when "." is not a local file system.
|
||||
* tests/install/basic-1: Otherwise, it would fail on some NFS
|
||||
file systems.
|
||||
* tests/mkdir/p-3: Likewise.
|
||||
|
||||
2007-03-19 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD):
|
||||
Add $(LIB_ACL_TRIVIAL).
|
||||
|
||||
2007-03-18 Jim Meyering <jim@meyering.net>
|
||||
|
||||
Fix a generic NFS-related test failure.
|
||||
* tests/mkdir/p-3: When setting up an unreadable "." in an
|
||||
inaccessible parent, make the parent inaccessible *after* making "."
|
||||
unreadable. Otherwise, running "chmod a-r ." in an already-
|
||||
inaccessible parent would fail on NFS with "Stale NFS file handle".
|
||||
|
||||
Fix a bug in how pr -m -s works.
|
||||
* NEWS: Describe how the fix affects pr.
|
||||
* src/pr.c (init_parameters): The --merge (-m) option does
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
GNU coreutils NEWS -*- outline -*-
|
||||
|
||||
* Noteworthy changes in release 6.8+ (????-??-??) [not-unstable]
|
||||
* Noteworthy changes in release 6.9+ (????-??-??) [stable]
|
||||
|
||||
|
||||
* Noteworthy changes in release 6.9 (2007-03-22) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ The programs that can be built with this package are:
|
||||
|
||||
[ base64 basename cat chgrp chmod chown chroot cksum comm cp csplit cut date
|
||||
dd df dir dircolors dirname du echo env expand expr factor false fmt fold
|
||||
ginstall groups head hostid hostname id join kill link ln logname ls
|
||||
groups head hostid hostname id install join kill link ln logname ls
|
||||
md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr
|
||||
printenv printf ptx pwd readlink rm rmdir seq sha1sum sha224sum sha256sum
|
||||
sha384sum sha512sum shred shuf sleep sort split stat stty su sum sync tac
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
As of 2002-09-01, the GNU fileutils, textutils, and sh-utils
|
||||
packages have been merged into one, called the GNU coreutils.
|
||||
See http://www.gnu.org/software/coreutils/ for a description.
|
||||
Here's the FAQ list:
|
||||
|
||||
http://www.gnu.org/software/coreutils/faq/
|
||||
|
||||
For information on the mailing lists associated with the
|
||||
coreutils package, see these:
|
||||
@@ -10,4 +13,6 @@ coreutils package, see these:
|
||||
|
||||
mailing list archives are here:
|
||||
|
||||
http://mail.gnu.org/pipermail/bug-coreutils/
|
||||
http://news.gmane.org/gmane.comp.gnu.coreutils.announce
|
||||
http://news.gmane.org/gmane.comp.gnu.core-utils.bugs (up to the minute)
|
||||
http://mail.gnu.org/pipermail/bug-coreutils/ (updated every 12 hours)
|
||||
+2
-1
@@ -65,7 +65,8 @@ gnulib_modules="
|
||||
strpbrk strtoimax strtoumax strverscmp sys_stat timespec tzset
|
||||
unicodeio unistd-safer unlink-busy unlinkdir unlocked-io
|
||||
uptime userspec utimecmp utimens vasprintf verify version-etc-fsf
|
||||
wcwidth winsz-ioctl winsz-termios xalloc xgetcwd xgethostname
|
||||
wcwidth winsz-ioctl winsz-termios write-any-file
|
||||
xalloc xgetcwd xgethostname
|
||||
xmemcoll xnanosleep xreadlink xreadlink-with-size xstrtod xstrtoimax
|
||||
xstrtol xstrtold xstrtoumax yesno
|
||||
"
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
dnl Written by Jim Meyering.
|
||||
|
||||
AC_PREREQ(2.61)
|
||||
AC_INIT([GNU coreutils],[6.8+],[bug-coreutils@gnu.org])
|
||||
AC_INIT([GNU coreutils],[6.9+],[bug-coreutils@gnu.org])
|
||||
AC_CONFIG_SRCDIR(src/ls.c)
|
||||
|
||||
AC_CONFIG_AUX_DIR(build-aux)
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2007-03-21 Eric Blake <ebb9@byu.net>
|
||||
|
||||
* coreutils.texi (md5sum invocation): Document escapes in output
|
||||
format. Reported by Armijn Hemel.
|
||||
|
||||
2007-03-15 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Fix manual in response to bug reports by Dan Jacobson.
|
||||
|
||||
@@ -3203,6 +3203,10 @@ md5sum [@var{option}]@dots{} [@var{file}]@dots{}
|
||||
|
||||
For each @var{file}, @samp{md5sum} outputs the MD5 checksum, a flag
|
||||
indicating a binary or text input file, and the file name.
|
||||
If @var{file} contains a backslash or newline, the
|
||||
line is started with a backslash, and each problematic character in
|
||||
the file name is escaped with a backslash, making the output
|
||||
unambiguous even in the presence of arbitrary file names.
|
||||
If @var{file} is omitted or specified as @samp{-}, standard input is read.
|
||||
|
||||
The program accepts the following options. Also see @ref{Common options}.
|
||||
|
||||
-426
@@ -1,426 +0,0 @@
|
||||
/* acl.c - access control lists
|
||||
|
||||
Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Written by Paul Eggert and Andreas Gruenbacher. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "acl.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifndef S_ISLNK
|
||||
# define S_ISLNK(Mode) 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ACL_LIBACL_H
|
||||
# include <acl/libacl.h>
|
||||
#endif
|
||||
|
||||
#include "error.h"
|
||||
#include "quote.h"
|
||||
|
||||
#include <errno.h>
|
||||
#ifndef ENOSYS
|
||||
# define ENOSYS (-1)
|
||||
#endif
|
||||
#ifndef ENOTSUP
|
||||
# define ENOTSUP (-1)
|
||||
#endif
|
||||
|
||||
#if ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
# define _(Text) gettext (Text)
|
||||
#else
|
||||
# define _(Text) Text
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FCHMOD
|
||||
# define HAVE_FCHMOD false
|
||||
# define fchmod(fd, mode) (-1)
|
||||
#endif
|
||||
|
||||
/* POSIX 1003.1e (draft 17) */
|
||||
#ifndef HAVE_ACL_GET_FD
|
||||
# define HAVE_ACL_GET_FD false
|
||||
# define acl_get_fd(fd) (NULL)
|
||||
#endif
|
||||
|
||||
/* POSIX 1003.1e (draft 17) */
|
||||
#ifndef HAVE_ACL_SET_FD
|
||||
# define HAVE_ACL_SET_FD false
|
||||
# define acl_set_fd(fd, acl) (-1)
|
||||
#endif
|
||||
|
||||
/* Linux-specific */
|
||||
#ifndef HAVE_ACL_EXTENDED_FILE
|
||||
# define HAVE_ACL_EXTENDED_FILE false
|
||||
# define acl_extended_file(name) (-1)
|
||||
#endif
|
||||
|
||||
/* Linux-specific */
|
||||
#ifndef HAVE_ACL_FROM_MODE
|
||||
# define HAVE_ACL_FROM_MODE false
|
||||
# define acl_from_mode(mode) (NULL)
|
||||
#endif
|
||||
|
||||
#define ACL_NOT_WELL_SUPPORTED(Errno) \
|
||||
(Errno == ENOTSUP || Errno == ENOSYS || Errno == EINVAL)
|
||||
|
||||
/* We detect the presence of POSIX 1003.1e (draft 17 -- abandoned) support
|
||||
by checking for HAVE_ACL_GET_FILE, HAVE_ACL_SET_FILE, and HAVE_ACL_FREE.
|
||||
Systems that have acl_get_file, acl_set_file, and acl_free must also
|
||||
have acl_to_text, acl_from_text, and acl_delete_def_file (all defined
|
||||
in the draft); systems that don't would hit #error statements here. */
|
||||
|
||||
#if USE_ACL && HAVE_ACL_GET_FILE && !HAVE_ACL_ENTRIES
|
||||
# ifndef HAVE_ACL_TO_TEXT
|
||||
# error Must have acl_to_text (see POSIX 1003.1e draft 17).
|
||||
# endif
|
||||
|
||||
/* Return the number of entries in ACL. Linux implements acl_entries
|
||||
as a more efficient extension than using this workaround. */
|
||||
|
||||
static int
|
||||
acl_entries (acl_t acl)
|
||||
{
|
||||
char *text = acl_to_text (acl, NULL), *t;
|
||||
int entries;
|
||||
if (text == NULL)
|
||||
return -1;
|
||||
for (entries = 0, t = text; ; t++, entries++) {
|
||||
t = strchr (t, '\n');
|
||||
if (t == NULL)
|
||||
break;
|
||||
}
|
||||
acl_free (text);
|
||||
return entries;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If DESC is a valid file descriptor use fchmod to change the
|
||||
file's mode to MODE on systems that have fchown. On systems
|
||||
that don't have fchown and if DESC is invalid, use chown on
|
||||
NAME instead. */
|
||||
|
||||
int
|
||||
chmod_or_fchmod (const char *name, int desc, mode_t mode)
|
||||
{
|
||||
if (HAVE_FCHMOD && desc != -1)
|
||||
return fchmod (desc, mode);
|
||||
else
|
||||
return chmod (name, mode);
|
||||
}
|
||||
|
||||
#if USE_ACL && HAVE_ACL_GET_FILE && HAVE_ACL_SET_FILE && HAVE_ACL_FREE
|
||||
/* FIXME: use acl_trivial instead, once we have a replacement function */
|
||||
static bool
|
||||
is_trivial_acl (acl_t acl)
|
||||
{
|
||||
int n = acl_entries (acl);
|
||||
if (n <= 3)
|
||||
return true;
|
||||
if (5 <= n)
|
||||
return false;
|
||||
|
||||
/* Here, we know there are exactly 4 entries.
|
||||
If they are for user, group, mask, and other, then return true; */
|
||||
/* FIXME */
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Return 1 if NAME has a nontrivial access control list, 0 if
|
||||
NAME only has no or a base access control list, and -1 on
|
||||
error. SB must be set to the stat buffer of FILE. */
|
||||
|
||||
int
|
||||
file_has_acl (char const *name, struct stat const *sb)
|
||||
{
|
||||
#if USE_ACL && HAVE_ACL && defined GETACLCNT
|
||||
/* This implementation should work on recent-enough versions of HP-UX,
|
||||
Solaris, and Unixware. */
|
||||
|
||||
# ifndef MIN_ACL_ENTRIES
|
||||
# define MIN_ACL_ENTRIES 4
|
||||
# endif
|
||||
|
||||
if (! S_ISLNK (sb->st_mode))
|
||||
{
|
||||
int n = acl (name, GETACLCNT, 0, NULL);
|
||||
return n < 0 ? (errno == ENOSYS ? 0 : -1) : (MIN_ACL_ENTRIES < n);
|
||||
}
|
||||
#elif USE_ACL && HAVE_ACL_GET_FILE && HAVE_ACL_FREE
|
||||
/* POSIX 1003.1e (draft 17 -- abandoned) specific version. */
|
||||
|
||||
if (! S_ISLNK (sb->st_mode))
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (HAVE_ACL_EXTENDED_FILE)
|
||||
ret = acl_extended_file (name);
|
||||
else
|
||||
{
|
||||
acl_t acl = acl_get_file (name, ACL_TYPE_ACCESS);
|
||||
if (acl)
|
||||
{
|
||||
ret = !is_trivial_acl (acl);
|
||||
acl_free (acl);
|
||||
if (ret == 0 && S_ISDIR (sb->st_mode))
|
||||
{
|
||||
acl = acl_get_file (name, ACL_TYPE_DEFAULT);
|
||||
if (acl)
|
||||
{
|
||||
ret = (0 < acl_entries (acl));
|
||||
acl_free (acl);
|
||||
}
|
||||
else
|
||||
ret = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
ret = -1;
|
||||
}
|
||||
if (ret < 0)
|
||||
return ACL_NOT_WELL_SUPPORTED (errno) ? 0 : -1;
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* FIXME: Add support for AIX, Irix, and Tru64. Please see Samba's
|
||||
source/lib/sysacls.c file for fix-related ideas. */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Copy access control lists from one file to another. If SOURCE_DESC is
|
||||
a valid file descriptor, use file descriptor operations, else use
|
||||
filename based operations on SRC_NAME. Likewise for DEST_DESC and
|
||||
DEST_NAME.
|
||||
If access control lists are not available, fchmod the target file to
|
||||
MODE. Also sets the non-permission bits of the destination file
|
||||
(S_ISUID, S_ISGID, S_ISVTX) to those from MODE if any are set.
|
||||
System call return value semantics. */
|
||||
|
||||
int
|
||||
copy_acl (const char *src_name, int source_desc, const char *dst_name,
|
||||
int dest_desc, mode_t mode)
|
||||
{
|
||||
int ret;
|
||||
|
||||
#if USE_ACL && HAVE_ACL_GET_FILE && HAVE_ACL_SET_FILE && HAVE_ACL_FREE
|
||||
/* POSIX 1003.1e (draft 17 -- abandoned) specific version. */
|
||||
|
||||
acl_t acl;
|
||||
if (HAVE_ACL_GET_FD && source_desc != -1)
|
||||
acl = acl_get_fd (source_desc);
|
||||
else
|
||||
acl = acl_get_file (src_name, ACL_TYPE_ACCESS);
|
||||
if (acl == NULL)
|
||||
{
|
||||
if (ACL_NOT_WELL_SUPPORTED (errno))
|
||||
return set_acl (dst_name, dest_desc, mode);
|
||||
else
|
||||
{
|
||||
error (0, errno, "%s", quote (src_name));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (HAVE_ACL_SET_FD && dest_desc != -1)
|
||||
ret = acl_set_fd (dest_desc, acl);
|
||||
else
|
||||
ret = acl_set_file (dst_name, ACL_TYPE_ACCESS, acl);
|
||||
if (ret != 0)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
|
||||
if (ACL_NOT_WELL_SUPPORTED (errno))
|
||||
{
|
||||
bool trivial = is_trivial_acl (acl);
|
||||
acl_free (acl);
|
||||
if (trivial)
|
||||
{
|
||||
if (chmod_or_fchmod (dst_name, dest_desc, mode) != 0)
|
||||
saved_errno = errno;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
chmod_or_fchmod (dst_name, dest_desc, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
acl_free (acl);
|
||||
chmod_or_fchmod (dst_name, dest_desc, mode);
|
||||
}
|
||||
error (0, saved_errno, _("preserving permissions for %s"),
|
||||
quote (dst_name));
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
acl_free (acl);
|
||||
|
||||
if (mode & (S_ISUID | S_ISGID | S_ISVTX))
|
||||
{
|
||||
/* We did not call chmod so far, so the special bits have not yet
|
||||
been set. */
|
||||
|
||||
if (chmod_or_fchmod (dst_name, dest_desc, mode) != 0)
|
||||
{
|
||||
error (0, errno, _("preserving permissions for %s"),
|
||||
quote (dst_name));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (S_ISDIR (mode))
|
||||
{
|
||||
acl = acl_get_file (src_name, ACL_TYPE_DEFAULT);
|
||||
if (acl == NULL)
|
||||
{
|
||||
error (0, errno, "%s", quote (src_name));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (acl_set_file (dst_name, ACL_TYPE_DEFAULT, acl))
|
||||
{
|
||||
error (0, errno, _("preserving permissions for %s"),
|
||||
quote (dst_name));
|
||||
acl_free (acl);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
acl_free (acl);
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
ret = chmod_or_fchmod (dst_name, dest_desc, mode);
|
||||
if (ret != 0)
|
||||
error (0, errno, _("preserving permissions for %s"), quote (dst_name));
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Set the access control lists of a file. If DESC is a valid file
|
||||
descriptor, use file descriptor operations where available, else use
|
||||
filename based operations on NAME. If access control lists are not
|
||||
available, fchmod the target file to MODE. Also sets the
|
||||
non-permission bits of the destination file (S_ISUID, S_ISGID, S_ISVTX)
|
||||
to those from MODE if any are set. System call return value
|
||||
semantics. */
|
||||
|
||||
int
|
||||
set_acl (char const *name, int desc, mode_t mode)
|
||||
{
|
||||
#if USE_ACL && HAVE_ACL_SET_FILE && HAVE_ACL_FREE
|
||||
/* POSIX 1003.1e draft 17 (abandoned) specific version. */
|
||||
|
||||
/* We must also have have_acl_from_text and acl_delete_def_file.
|
||||
(acl_delete_def_file could be emulated with acl_init followed
|
||||
by acl_set_file, but acl_set_file with an empty acl is
|
||||
unspecified.) */
|
||||
|
||||
# ifndef HAVE_ACL_FROM_TEXT
|
||||
# error Must have acl_from_text (see POSIX 1003.1e draft 17).
|
||||
# endif
|
||||
# ifndef HAVE_ACL_DELETE_DEF_FILE
|
||||
# error Must have acl_delete_def_file (see POSIX 1003.1e draft 17).
|
||||
# endif
|
||||
|
||||
acl_t acl;
|
||||
int ret;
|
||||
|
||||
if (HAVE_ACL_FROM_MODE)
|
||||
{
|
||||
acl = acl_from_mode (mode);
|
||||
if (!acl)
|
||||
{
|
||||
error (0, errno, "%s", quote (name));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
char acl_text[] = "u::---,g::---,o::---";
|
||||
|
||||
if (mode & S_IRUSR) acl_text[ 3] = 'r';
|
||||
if (mode & S_IWUSR) acl_text[ 4] = 'w';
|
||||
if (mode & S_IXUSR) acl_text[ 5] = 'x';
|
||||
if (mode & S_IRGRP) acl_text[10] = 'r';
|
||||
if (mode & S_IWGRP) acl_text[11] = 'w';
|
||||
if (mode & S_IXGRP) acl_text[12] = 'x';
|
||||
if (mode & S_IROTH) acl_text[17] = 'r';
|
||||
if (mode & S_IWOTH) acl_text[18] = 'w';
|
||||
if (mode & S_IXOTH) acl_text[19] = 'x';
|
||||
|
||||
acl = acl_from_text (acl_text);
|
||||
if (!acl)
|
||||
{
|
||||
error (0, errno, "%s", quote (name));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (HAVE_ACL_SET_FD && desc != -1)
|
||||
ret = acl_set_fd (desc, acl);
|
||||
else
|
||||
ret = acl_set_file (name, ACL_TYPE_ACCESS, acl);
|
||||
if (ret != 0)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
acl_free (acl);
|
||||
|
||||
if (ACL_NOT_WELL_SUPPORTED (errno))
|
||||
{
|
||||
if (chmod_or_fchmod (name, desc, mode) != 0)
|
||||
saved_errno = errno;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
error (0, saved_errno, _("setting permissions for %s"), quote (name));
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
acl_free (acl);
|
||||
|
||||
if (S_ISDIR (mode) && acl_delete_def_file (name))
|
||||
{
|
||||
error (0, errno, _("setting permissions for %s"), quote (name));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (mode & (S_ISUID | S_ISGID | S_ISVTX))
|
||||
{
|
||||
/* We did not call chmod so far, so the special bits have not yet
|
||||
been set. */
|
||||
|
||||
if (chmod_or_fchmod (name, desc, mode))
|
||||
{
|
||||
error (0, errno, _("preserving permissions for %s"), quote (name));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
int ret = chmod_or_fchmod (name, desc, mode);
|
||||
if (ret)
|
||||
error (0, errno, _("setting permissions for %s"), quote (name));
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
-308
@@ -1,308 +0,0 @@
|
||||
/* Save and restore the working directory, possibly using a child process.
|
||||
|
||||
Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "savewd.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "dirname.h"
|
||||
#include "fcntl-safer.h"
|
||||
|
||||
|
||||
/* Save the working directory into *WD, if it hasn't been saved
|
||||
already. Return true if a child has been forked to do the real
|
||||
work. */
|
||||
static bool
|
||||
savewd_save (struct savewd *wd)
|
||||
{
|
||||
switch (wd->state)
|
||||
{
|
||||
case INITIAL_STATE:
|
||||
/* Save the working directory, or prepare to fall back if possible. */
|
||||
{
|
||||
int fd = open_safer (".", O_RDONLY);
|
||||
if (0 <= fd)
|
||||
{
|
||||
wd->state = FD_STATE;
|
||||
wd->val.fd = fd;
|
||||
break;
|
||||
}
|
||||
if (errno != EACCES && errno != ESTALE)
|
||||
{
|
||||
wd->state = ERROR_STATE;
|
||||
wd->val.errnum = errno;
|
||||
break;
|
||||
}
|
||||
}
|
||||
wd->state = FORKING_STATE;
|
||||
wd->val.child = -1;
|
||||
/* Fall through. */
|
||||
case FORKING_STATE:
|
||||
if (wd->val.child < 0)
|
||||
{
|
||||
/* "Save" the initial working directory by forking a new
|
||||
subprocess that will attempt all the work from the chdir
|
||||
until until the next savewd_restore. */
|
||||
wd->val.child = fork ();
|
||||
if (wd->val.child != 0)
|
||||
{
|
||||
if (0 < wd->val.child)
|
||||
return true;
|
||||
wd->state = ERROR_STATE;
|
||||
wd->val.errnum = errno;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case FD_STATE:
|
||||
case FD_POST_CHDIR_STATE:
|
||||
case ERROR_STATE:
|
||||
case FINAL_STATE:
|
||||
break;
|
||||
|
||||
default:
|
||||
assert (false);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int
|
||||
savewd_chdir (struct savewd *wd, char const *dir, int options,
|
||||
int open_result[2])
|
||||
{
|
||||
int fd = -1;
|
||||
int result = 0;
|
||||
|
||||
/* Open the directory if requested, or if avoiding a race condition
|
||||
is requested and possible. */
|
||||
if (open_result
|
||||
|| (options & (HAVE_WORKING_O_NOFOLLOW ? SAVEWD_CHDIR_NOFOLLOW : 0)))
|
||||
{
|
||||
fd = open (dir,
|
||||
(O_RDONLY | O_DIRECTORY | O_NOCTTY | O_NONBLOCK
|
||||
| (options & SAVEWD_CHDIR_NOFOLLOW ? O_NOFOLLOW : 0)));
|
||||
|
||||
if (open_result)
|
||||
{
|
||||
open_result[0] = fd;
|
||||
open_result[1] = errno;
|
||||
}
|
||||
|
||||
if (fd < 0 && ((errno != EACCES && errno != ESTALE)
|
||||
|| (options & SAVEWD_CHDIR_READABLE)))
|
||||
result = -1;
|
||||
}
|
||||
|
||||
if (result == 0 && ! (0 <= fd && options & SAVEWD_CHDIR_SKIP_READABLE))
|
||||
{
|
||||
if (savewd_save (wd))
|
||||
{
|
||||
open_result = NULL;
|
||||
result = -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = (fd < 0 ? chdir (dir) : fchdir (fd));
|
||||
|
||||
if (result == 0)
|
||||
switch (wd->state)
|
||||
{
|
||||
case FD_STATE:
|
||||
wd->state = FD_POST_CHDIR_STATE;
|
||||
break;
|
||||
|
||||
case ERROR_STATE:
|
||||
case FD_POST_CHDIR_STATE:
|
||||
case FINAL_STATE:
|
||||
break;
|
||||
|
||||
case FORKING_STATE:
|
||||
assert (wd->val.child == 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
assert (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (0 <= fd && ! open_result)
|
||||
{
|
||||
int e = errno;
|
||||
close (fd);
|
||||
errno = e;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
savewd_restore (struct savewd *wd, int status)
|
||||
{
|
||||
switch (wd->state)
|
||||
{
|
||||
case INITIAL_STATE:
|
||||
case FD_STATE:
|
||||
/* The working directory is the desired directory, so there's no
|
||||
work to do. */
|
||||
break;
|
||||
|
||||
case FD_POST_CHDIR_STATE:
|
||||
/* Restore the working directory using fchdir. */
|
||||
if (fchdir (wd->val.fd) == 0)
|
||||
{
|
||||
wd->state = FD_STATE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
int chdir_errno = errno;
|
||||
close (wd->val.fd);
|
||||
wd->state = ERROR_STATE;
|
||||
wd->val.errnum = chdir_errno;
|
||||
}
|
||||
/* Fall through. */
|
||||
case ERROR_STATE:
|
||||
/* Report an error if asked to restore the working directory. */
|
||||
errno = wd->val.errnum;
|
||||
return -1;
|
||||
|
||||
case FORKING_STATE:
|
||||
/* "Restore" the working directory by waiting for the subprocess
|
||||
to finish. */
|
||||
{
|
||||
pid_t child = wd->val.child;
|
||||
if (child == 0)
|
||||
_exit (status);
|
||||
if (0 < child)
|
||||
{
|
||||
int child_status;
|
||||
while (waitpid (child, &child_status, 0) < 0)
|
||||
assert (errno == EINTR);
|
||||
wd->val.child = -1;
|
||||
if (! WIFEXITED (child_status))
|
||||
raise (WTERMSIG (child_status));
|
||||
return WEXITSTATUS (child_status);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
assert (false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
savewd_finish (struct savewd *wd)
|
||||
{
|
||||
switch (wd->state)
|
||||
{
|
||||
case INITIAL_STATE:
|
||||
case ERROR_STATE:
|
||||
break;
|
||||
|
||||
case FD_STATE:
|
||||
case FD_POST_CHDIR_STATE:
|
||||
close (wd->val.fd);
|
||||
break;
|
||||
|
||||
case FORKING_STATE:
|
||||
assert (wd->val.child < 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
assert (false);
|
||||
}
|
||||
|
||||
wd->state = FINAL_STATE;
|
||||
}
|
||||
|
||||
/* Return true if the actual work is currently being done by a
|
||||
subprocess.
|
||||
|
||||
A true return means that the caller and the subprocess should
|
||||
resynchronize later with savewd_restore, using only their own
|
||||
memory to decide when to resynchronize; they should not consult the
|
||||
file system to decide, because that might lead to race conditions.
|
||||
This is why savewd_chdir is broken out into another function;
|
||||
savewd_chdir's callers _can_ inspect the file system to decide
|
||||
whether to call savewd_chdir. */
|
||||
static inline bool
|
||||
savewd_delegating (struct savewd const *wd)
|
||||
{
|
||||
return wd->state == FORKING_STATE && 0 < wd->val.child;
|
||||
}
|
||||
|
||||
int
|
||||
savewd_process_files (int n_files, char **file,
|
||||
int (*act) (char *, struct savewd *, void *),
|
||||
void *options)
|
||||
{
|
||||
int i = 0;
|
||||
int last_relative;
|
||||
int exit_status = EXIT_SUCCESS;
|
||||
struct savewd wd;
|
||||
savewd_init (&wd);
|
||||
|
||||
for (last_relative = n_files - 1; 0 <= last_relative; last_relative--)
|
||||
if (! IS_ABSOLUTE_FILE_NAME (file[last_relative]))
|
||||
break;
|
||||
|
||||
for (; i < last_relative; i++)
|
||||
{
|
||||
if (! savewd_delegating (&wd))
|
||||
{
|
||||
int s = act (file[i], &wd, options);
|
||||
if (exit_status < s)
|
||||
exit_status = s;
|
||||
}
|
||||
|
||||
if (! IS_ABSOLUTE_FILE_NAME (file[i + 1]))
|
||||
{
|
||||
int r = savewd_restore (&wd, exit_status);
|
||||
if (exit_status < r)
|
||||
exit_status = r;
|
||||
}
|
||||
}
|
||||
|
||||
savewd_finish (&wd);
|
||||
|
||||
for (; i < n_files; i++)
|
||||
{
|
||||
int s = act (file[i], &wd, options);
|
||||
if (exit_status < s)
|
||||
exit_status = s;
|
||||
}
|
||||
|
||||
return exit_status;
|
||||
}
|
||||
@@ -3,8 +3,10 @@ Makefile
|
||||
Makefile.in
|
||||
__fpending.c
|
||||
__fpending.h
|
||||
acl-internal.h
|
||||
acl.c
|
||||
acl.h
|
||||
acl_entries.c
|
||||
alloca.c
|
||||
alloca.h
|
||||
alloca_.h
|
||||
@@ -84,6 +86,7 @@ fcntl-safer.h
|
||||
fcntl.h
|
||||
fcntl_.h
|
||||
fd-safer.c
|
||||
file-has-acl.c
|
||||
file-type.c
|
||||
file-type.h
|
||||
fileblocks.c
|
||||
@@ -93,6 +96,7 @@ filenamecat.c
|
||||
filenamecat.h
|
||||
findprog.c
|
||||
findprog.h
|
||||
float+.h
|
||||
fnmatch.c
|
||||
fnmatch.h
|
||||
fnmatch_.h
|
||||
@@ -380,6 +384,8 @@ wchar_.h
|
||||
wctype.h
|
||||
wctype_.h
|
||||
wcwidth.h
|
||||
write-any-file.c
|
||||
write-any-file.h
|
||||
xalloc-die.c
|
||||
xalloc.h
|
||||
xgetcwd.c
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
__fpending.c
|
||||
__fpending.h
|
||||
acl-internal.h
|
||||
acl.c
|
||||
acl.h
|
||||
acl_entries.c
|
||||
alloca.c
|
||||
alloca.h
|
||||
alloca_.h
|
||||
@@ -79,6 +81,7 @@ fcntl-safer.h
|
||||
fcntl.h
|
||||
fcntl_.h
|
||||
fd-safer.c
|
||||
file-has-acl.c
|
||||
file-type.c
|
||||
file-type.h
|
||||
fileblocks.c
|
||||
@@ -88,6 +91,7 @@ filenamecat.c
|
||||
filenamecat.h
|
||||
findprog.c
|
||||
findprog.h
|
||||
float+.h
|
||||
fnmatch.c
|
||||
fnmatch.h
|
||||
fnmatch_.h
|
||||
@@ -371,6 +375,8 @@ wchar_.h
|
||||
wctype.h
|
||||
wctype_.h
|
||||
wcwidth.h
|
||||
write-any-file.c
|
||||
write-any-file.h
|
||||
xalloc-die.c
|
||||
xalloc.h
|
||||
xgetcwd.c
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2007-03-20 Jim Meyering <jim@meyering.net>
|
||||
|
||||
Fix a typo in the handling of %x and %X.
|
||||
* vasnprintf.c (VASNPRINTF): When adding 2 to buffer length,
|
||||
don't double it.
|
||||
|
||||
2007-03-04 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* vasnprintf.c (VASNPRINTF): Add missing semicolon.
|
||||
|
||||
+3
-2
@@ -415,8 +415,9 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
|
||||
if (tmp_length < precision)
|
||||
tmp_length = precision;
|
||||
/* Add 2, to account for a leading sign or alternate form. */
|
||||
if (tmp_length <= SIZE_MAX / 2)
|
||||
tmp_length *= 2;
|
||||
tmp_length += 2;
|
||||
if (tmp_length < 2)
|
||||
goto out_of_memory;
|
||||
break;
|
||||
|
||||
case 'f': case 'F':
|
||||
|
||||
@@ -246,6 +246,7 @@ wchar_t.m4
|
||||
wctype.m4
|
||||
wcwidth.m4
|
||||
wint_t.m4
|
||||
write-any-file.m4
|
||||
xalloc.m4
|
||||
xgetcwd.m4
|
||||
xnanosleep.m4
|
||||
|
||||
@@ -235,6 +235,7 @@ wchar_t.m4
|
||||
wctype.m4
|
||||
wcwidth.m4
|
||||
wint_t.m4
|
||||
write-any-file.m4
|
||||
xalloc.m4
|
||||
xgetcwd.m4
|
||||
xnanosleep.m4
|
||||
|
||||
+4
-4
@@ -104,9 +104,9 @@ uptime_LDADD = $(LDADD) $(POW_LIB) $(GETLOADAVG_LIBS)
|
||||
|
||||
su_LDADD = $(LDADD) $(LIB_CRYPT)
|
||||
|
||||
dir_LDADD += $(LIB_ACL)
|
||||
ls_LDADD += $(LIB_ACL)
|
||||
vdir_LDADD += $(LIB_ACL)
|
||||
dir_LDADD += $(LIB_ACL_TRIVIAL) $(LIB_ACL)
|
||||
ls_LDADD += $(LIB_ACL_TRIVIAL) $(LIB_ACL)
|
||||
vdir_LDADD += $(LIB_ACL_TRIVIAL) $(LIB_ACL)
|
||||
cp_LDADD += $(LIB_ACL)
|
||||
mv_LDADD += $(LIB_ACL)
|
||||
ginstall_LDADD += $(LIB_ACL)
|
||||
@@ -269,7 +269,7 @@ check: check-README check-misc
|
||||
check-README:
|
||||
rm -rf $(pr) $(pm)
|
||||
echo $(all_programs) \
|
||||
| tr -s ' ' '\n' | sed -e 's,$(EXEEXT)$$,,' \
|
||||
| tr -s ' ' '\n' | sed -e 's,$(EXEEXT)$$,,;s/ginstall/install/' \
|
||||
| $(ASSORT) -u > $(pm) && \
|
||||
sed -n '/^The programs .* are:/,/^[a-zA-Z]/p' $(top_srcdir)/README \
|
||||
| sed -n '/^ */s///p' | tr -s ' ' '\n' > $(pr)
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ When decoding, the input may contain newlines in addition to the bytes of\n\
|
||||
the formal base64 alphabet. Use --ignore-garbage to attempt to recover\n\
|
||||
from any other non-alphabet bytes in the encoded stream.\n"),
|
||||
stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
|
||||
exit (status);
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ Examples:\n\
|
||||
%s include/stdio.h .h Output \"stdio\".\n\
|
||||
"),
|
||||
program_name, program_name);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+25
-26
@@ -4,9 +4,9 @@ RCS file: /fetish/cu/src/remove.c,v
|
||||
retrieving revision 1.158
|
||||
diff --git a/src/remove.c b/src/remove.c
|
||||
index 4728bdd..7477da5 100644
|
||||
--- a/src/remove.c
|
||||
+++ b/src/remove.c
|
||||
@@ -236,9 +236,10 @@ pop_dir (Dirstack_state *ds)
|
||||
--- a/src/remove.c 2007-03-23 21:49:33.000000000 +0100
|
||||
+++ b/src/remove.c 2007-03-25 09:58:29.000000000 +0200
|
||||
@@ -254,9 +254,10 @@ pop_dir (Dirstack_state *ds)
|
||||
{
|
||||
size_t n_lengths = obstack_object_size (&ds->len_stack) / sizeof (size_t);
|
||||
size_t *length = obstack_base (&ds->len_stack);
|
||||
@@ -18,7 +18,7 @@ index 4728bdd..7477da5 100644
|
||||
assert (top_len >= 2);
|
||||
|
||||
/* Pop the specified length of file name. */
|
||||
@@ -370,10 +371,11 @@ AD_stack_top (Dirstack_state const *ds)
|
||||
@@ -388,10 +389,11 @@ AD_stack_top (Dirstack_state const *ds)
|
||||
static void
|
||||
AD_stack_pop (Dirstack_state *ds)
|
||||
{
|
||||
@@ -31,24 +31,23 @@ index 4728bdd..7477da5 100644
|
||||
if (top->unremovable)
|
||||
hash_free (top->unremovable);
|
||||
obstack_blank (&ds->Active_dir, -(int) sizeof (struct AD_ent));
|
||||
@@ -815,6 +817,7 @@ prompt (int fd_cwd, Dirstack_state const *ds, char const *filename,
|
||||
@@ -873,6 +875,7 @@ prompt (int fd_cwd, Dirstack_state const
|
||||
break;
|
||||
}
|
||||
|
||||
if (write_protected || x->interactive == RMI_ALWAYS)
|
||||
{
|
||||
+ char const *quoted_name = quote (full_filename (filename));
|
||||
if (write_protected <= 0
|
||||
&& cache_fstatat (fd_cwd, filename, sbuf, AT_SYMLINK_NOFOLLOW) != 0)
|
||||
{
|
||||
@@ -832,8 +835,6 @@ prompt (int fd_cwd, Dirstack_state const *ds, char const *filename,
|
||||
write_protected = EISDIR;
|
||||
}
|
||||
+ {
|
||||
char const *quoted_name = quote (full_filename (filename));
|
||||
|
||||
- char const *quoted_name = quote (full_filename (filename));
|
||||
-
|
||||
if (0 < write_protected)
|
||||
{
|
||||
error (0, write_protected, _("cannot remove %s"), quoted_name);
|
||||
@@ -1487,6 +1488,7 @@ rm_1 (Dirstack_state *ds, char const *filename,
|
||||
@@ -912,6 +915,7 @@ prompt (int fd_cwd, Dirstack_state const
|
||||
: _("%s: remove %s %s? ")),
|
||||
program_name, file_type (sbuf), quoted_name);
|
||||
}
|
||||
+ }
|
||||
|
||||
if (!yesno ())
|
||||
return RM_USER_DECLINED;
|
||||
@@ -1512,6 +1516,7 @@ rm_1 (Dirstack_state *ds, char const *fi
|
||||
return RM_ERROR;
|
||||
}
|
||||
|
||||
@@ -56,23 +55,23 @@ index 4728bdd..7477da5 100644
|
||||
struct stat st;
|
||||
cache_stat_init (&st);
|
||||
cycle_check_init (&ds->cycle_check_state);
|
||||
@@ -1509,6 +1511,7 @@ rm_1 (Dirstack_state *ds, char const *filename,
|
||||
@@ -1534,6 +1539,7 @@ rm_1 (Dirstack_state *ds, char const *fi
|
||||
AD_push_initial (ds);
|
||||
AD_INIT_OTHER_MEMBERS ();
|
||||
|
||||
+ {
|
||||
enum RM_status status = remove_entry (AT_FDCWD, ds, filename, &st, x, NULL);
|
||||
enum RM_status status = remove_entry (AT_FDCWD, ds, filename,
|
||||
DT_UNKNOWN, &st, x);
|
||||
if (status == RM_NONEMPTY_DIR)
|
||||
{
|
||||
@@ -1525,6 +1528,8 @@ rm_1 (Dirstack_state *ds, char const *filename,
|
||||
|
||||
@@ -1552,6 +1558,8 @@ rm_1 (Dirstack_state *ds, char const *fi
|
||||
ds_clear (ds);
|
||||
return status;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
+ }
|
||||
+}
|
||||
|
||||
/* Remove all files and/or directories specified by N_FILES and FILE.
|
||||
Apply the options in X. */
|
||||
Index: src/rm.c
|
||||
===================================================================
|
||||
RCS file: /fetish/cu/src/rm.c,v
|
||||
|
||||
@@ -125,7 +125,7 @@ Examples:\n\
|
||||
%s Copy standard input to standard output.\n\
|
||||
"),
|
||||
program_name, program_name);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -160,7 +160,7 @@ Examples:\n\
|
||||
%s -hR staff /u Change the group of /u and subfiles to \"staff\".\n\
|
||||
"),
|
||||
program_name, program_name);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -369,7 +369,7 @@ Change the mode of each FILE to MODE.\n\
|
||||
\n\
|
||||
Each MODE is of the form `[ugoa]*([-+=]([rwxXst]*|[ugo]))+'.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -155,7 +155,7 @@ Examples:\n\
|
||||
%s -hR root /u Change the owner of /u and subfiles to \"root\".\n\
|
||||
"),
|
||||
program_name, program_name, program_name);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ Run COMMAND with root directory set to NEWROOT.\n\
|
||||
\n\
|
||||
If no command is given, run ``${SHELL} -i'' (default: /bin/sh).\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -273,7 +273,7 @@ Print CRC checksum and byte counts of each FILE.\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ and column three contains lines common to both files.\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+13
-7
@@ -51,6 +51,7 @@
|
||||
#include "stat-time.h"
|
||||
#include "utimecmp.h"
|
||||
#include "utimens.h"
|
||||
#include "write-any-file.h"
|
||||
#include "xreadlink.h"
|
||||
#include "yesno.h"
|
||||
|
||||
@@ -63,11 +64,6 @@
|
||||
#define SAME_GROUP(A, B) ((A).st_gid == (B).st_gid)
|
||||
#define SAME_OWNER_AND_GROUP(A, B) (SAME_OWNER (A, B) && SAME_GROUP (A, B))
|
||||
|
||||
#define UNWRITABLE(File_name, File_mode) \
|
||||
( /* euidaccess is not meaningful for symlinks */ \
|
||||
! S_ISLNK (File_mode) \
|
||||
&& euidaccess (File_name, W_OK) != 0)
|
||||
|
||||
struct dir_list
|
||||
{
|
||||
struct dir_list *parent;
|
||||
@@ -793,10 +789,20 @@ same_file_ok (char const *src_name, struct stat const *src_sb,
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Return true if FILE, with mode MODE, is writable in the sense of 'mv'.
|
||||
Always consider a symbolic link to be writable. */
|
||||
static bool
|
||||
writable_destination (char const *file, mode_t mode)
|
||||
{
|
||||
return (S_ISLNK (mode)
|
||||
|| can_write_any_file ()
|
||||
|| euidaccess (file, W_OK) == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
overwrite_prompt (char const *dst_name, struct stat const *dst_sb)
|
||||
{
|
||||
if (euidaccess (dst_name, W_OK) != 0)
|
||||
if (! writable_destination (dst_name, dst_sb->st_mode))
|
||||
{
|
||||
char perms[12]; /* "-rwxrwxrwx " ls-style modes. */
|
||||
strmode (dst_sb->st_mode, perms);
|
||||
@@ -978,7 +984,7 @@ abandon_move (const struct cp_options *x,
|
||||
|| ((x->interactive == I_ASK_USER
|
||||
|| (x->interactive == I_UNSPECIFIED
|
||||
&& x->stdin_tty
|
||||
&& UNWRITABLE (dst_name, dst_sb->st_mode)))
|
||||
&& ! writable_destination (dst_name, dst_sb->st_mode)))
|
||||
&& (overwrite_prompt (dst_name, dst_sb), 1)
|
||||
&& ! yesno ()));
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ As a special case, cp makes a backup of SOURCE when the force and backup\n\
|
||||
options are given and SOURCE and DEST are the same name for an existing,\n\
|
||||
regular file.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1509,7 +1509,7 @@ Read standard input if FILE is -. Each PATTERN may be:\n\
|
||||
\n\
|
||||
A line OFFSET is a required `+' or `-' followed by a positive integer.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
@@ -234,7 +234,7 @@ Each range is one of:\n\
|
||||
\n\
|
||||
With no FILE, or when FILE is -, read standard input.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -245,7 +245,7 @@ then an optional modifier, which is either\n\
|
||||
E to use the locale's alternate representations if available, or\n\
|
||||
O to use the locale's alternate numeric symbols if available.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -507,7 +507,7 @@ Options are:\n\
|
||||
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -772,7 +772,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
SIZE may be (or may be an integer optionally followed by) one of following:\n\
|
||||
kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ If FILE is specified, read it to determine which colors to use for which\n\
|
||||
file types and extensions. Otherwise, a precompiled database is used.\n\
|
||||
For details on the format of these files, run `dircolors --print-database'.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
|
||||
exit (status);
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ Examples:\n\
|
||||
%s stdio.h Output \".\".\n\
|
||||
"),
|
||||
program_name, program_name);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
SIZE may be (or may be an integer optionally followed by) one of following:\n\
|
||||
kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ If -e is in effect, the following sequences are recognized:\n\
|
||||
\\v vertical tab\n\
|
||||
"), stdout);
|
||||
printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ Set each NAME to VALUE in the environment and run COMMAND.\n\
|
||||
\n\
|
||||
A mere - implies -i. If no COMMAND, print the resulting environment.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -163,7 +163,7 @@ Pattern matches return the string matched between \\( and \\) or null; if\n\
|
||||
Exit status is 0 if EXPRESSION is neither null nor 0, 1 if EXPRESSION is null\n\
|
||||
or 0, 2 if EXPRESSION is syntactically invalid, and 3 if an error occurred.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ Print the prime factors of each NUMBER.\n\
|
||||
Print the prime factors of all specified integer NUMBERs. If no arguments\n\
|
||||
are specified on the command line, they are read from standard input.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
\n\
|
||||
With no FILE, or when FILE is -, read standard input.\n"),
|
||||
stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -137,7 +137,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
\n\
|
||||
N may have a multiplier suffix: b 512, k 1024, m 1024*1024.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ Print the numeric identifier (in hexadecimal) for the current host.\n\
|
||||
program_name, program_name);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ Print or set the hostname of the current system.\n\
|
||||
program_name, program_name);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ Print information for USERNAME, or the current user.\n\
|
||||
\n\
|
||||
Without any OPTION, print some useful set of identified information.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -702,7 +702,7 @@ the VERSION_CONTROL environment variable. Here are the values:\n\
|
||||
existing, nil numbered if numbered backups exist, simple otherwise\n\
|
||||
simple, never always make simple backups\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
+1
-1
@@ -169,7 +169,7 @@ separated by CHAR.\n\
|
||||
Important: FILE1 and FILE2 must be sorted on the join fields.\n\
|
||||
E.g., use `sort -k 1b,1' if `join' has no options.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ or an exit status of a process terminated by a signal.\n\
|
||||
PID is an integer; if negative it identifies a process group.\n\
|
||||
"), stdout);
|
||||
printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ Usage: %s FILE1 FILE2\n\
|
||||
stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ the VERSION_CONTROL environment variable. Here are the values:\n\
|
||||
existing, nil numbered if numbered backups exist, simple otherwise\n\
|
||||
simple, never always make simple backups\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ Print the name of the current user.\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -4424,7 +4424,7 @@ colors, and can be set easily by the dircolors command.\n\
|
||||
\n\
|
||||
Exit status is 0 if OK, 1 if minor problems, 2 if serious trouble.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
+1
-1
@@ -191,7 +191,7 @@ should be a former output of this program. The default mode is to print\n\
|
||||
a line with checksum, a character indicating type (`*' for binary, ` ' for\n\
|
||||
text), and name for each FILE.\n"),
|
||||
DIGEST_REFERENCE);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
|
||||
exit (status);
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ otherwise, as decimal. TYPE may be:\n\
|
||||
c, u create a character (unbuffered) special file\n\
|
||||
p create a FIFO\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@ the VERSION_CONTROL environment variable. Here are the values:\n\
|
||||
existing, nil numbered if numbered backups exist, simple otherwise\n\
|
||||
simple, never always make simple backups\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ With no COMMAND, print the current niceness. Nicenesses range from\n\
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ FORMAT is one of:\n\
|
||||
rz right justified, leading zeros\n\
|
||||
\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ Run COMMAND, ignoring hangup signals.\n\
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ of output. \
|
||||
--string without a number implies 3. --width without a number\n\
|
||||
implies 32. By default, od uses -A o -t d2 -w16.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -434,7 +434,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
/* FIXME: add a couple of examples. */
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,5 +1,5 @@
|
||||
/* pathchk -- check whether file names are valid or portable
|
||||
Copyright (C) 1991-2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991-2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
#include "system.h"
|
||||
#include "error.h"
|
||||
#include "euidaccess.h"
|
||||
#include "quote.h"
|
||||
#include "quotearg.h"
|
||||
|
||||
@@ -106,7 +105,7 @@ Diagnose unportable constructs in NAME.\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -530,7 +530,7 @@ usage (int status)
|
||||
A lightweight `finger' program; print user information.\n\
|
||||
The utmp file will be %s.\n\
|
||||
"), UTMP_FILE);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -2872,7 +2872,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
-T implied by -l nn when nn <= 10 or <= 3 with -F. With no FILE, or when\n\
|
||||
FILE is -, read standard input.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
+1
-1
@@ -68,7 +68,7 @@ If no environment VARIABLE specified, print them all.\n\
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -135,7 +135,7 @@ and all C format specifications ending with one of diouxXfeEgGcs, with\n\
|
||||
ARGUMENTs converted to proper type first. Variable widths are handled.\n\
|
||||
"), stdout);
|
||||
printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -1922,7 +1922,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
\n\
|
||||
With no FILE or if FILE is -, read Standard Input. `-F /' by default.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ Print the full filename of the current working directory.\n\
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ usage (int status)
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+89
-63
@@ -39,6 +39,7 @@
|
||||
#include "remove.h"
|
||||
#include "root-dev-ino.h"
|
||||
#include "unlinkdir.h"
|
||||
#include "write-any-file.h"
|
||||
#include "yesno.h"
|
||||
|
||||
/* Avoid shadowing warnings because these are functions declared
|
||||
@@ -112,6 +113,23 @@ struct AD_ent
|
||||
struct dev_ino dev_ino;
|
||||
};
|
||||
|
||||
/* D_TYPE(D) is the type of directory entry D if known, DT_UNKNOWN
|
||||
otherwise. */
|
||||
#if HAVE_STRUCT_DIRENT_D_TYPE
|
||||
# define D_TYPE(d) ((d)->d_type)
|
||||
#else
|
||||
# define D_TYPE(d) DT_UNKNOWN
|
||||
|
||||
/* Any int values will do here, so long as they're distinct.
|
||||
Undef any existing macros out of the way. */
|
||||
# undef DT_UNKNOWN
|
||||
# undef DT_DIR
|
||||
# undef DT_LNK
|
||||
# define DT_UNKNOWN 0
|
||||
# define DT_DIR 1
|
||||
# define DT_LNK 2
|
||||
#endif
|
||||
|
||||
extern char *program_name;
|
||||
|
||||
struct dirstack_state
|
||||
@@ -715,6 +733,8 @@ write_protected_non_symlink (int fd_cwd,
|
||||
Dirstack_state const *ds,
|
||||
struct stat *buf)
|
||||
{
|
||||
if (can_write_any_file ())
|
||||
return 0;
|
||||
if (cache_fstatat (fd_cwd, file, buf, AT_SYMLINK_NOFOLLOW) != 0)
|
||||
return errno;
|
||||
if (S_ISLNK (buf->st_mode))
|
||||
@@ -791,6 +811,9 @@ write_protected_non_symlink (int fd_cwd,
|
||||
return RM_USER_DECLINED. If not ignoring missing files and we
|
||||
cannot lstat FILENAME, then return RM_ERROR.
|
||||
|
||||
*PDIRENT_TYPE is the type of the directory entry; update it to DT_DIR
|
||||
or DT_LNK as needed. *SBUF is the file's status.
|
||||
|
||||
Depending on MODE, ask whether to `descend into' or to `remove' the
|
||||
directory FILENAME. MODE is ignored when FILENAME is not a directory.
|
||||
Set *IS_EMPTY to T_YES if FILENAME is an empty directory, and it is
|
||||
@@ -798,11 +821,12 @@ write_protected_non_symlink (int fd_cwd,
|
||||
Don't even try to set *IS_EMPTY when MODE == PA_REMOVE_DIR. */
|
||||
static enum RM_status
|
||||
prompt (int fd_cwd, Dirstack_state const *ds, char const *filename,
|
||||
struct stat *sbuf,
|
||||
int *pdirent_type, struct stat *sbuf,
|
||||
struct rm_options const *x, enum Prompt_action mode,
|
||||
Ternary *is_empty)
|
||||
{
|
||||
int write_protected = 0;
|
||||
int dirent_type = *pdirent_type;
|
||||
|
||||
*is_empty = T_UNKNOWN;
|
||||
|
||||
@@ -810,27 +834,44 @@ prompt (int fd_cwd, Dirstack_state const *ds, char const *filename,
|
||||
return RM_OK;
|
||||
|
||||
if (!x->ignore_missing_files
|
||||
& ((x->interactive == RMI_ALWAYS) | x->stdin_tty))
|
||||
&& ((x->interactive == RMI_ALWAYS) || x->stdin_tty)
|
||||
&& dirent_type != DT_LNK)
|
||||
write_protected = write_protected_non_symlink (fd_cwd, filename, ds, sbuf);
|
||||
|
||||
if (write_protected || x->interactive == RMI_ALWAYS)
|
||||
{
|
||||
if (write_protected <= 0
|
||||
&& cache_fstatat (fd_cwd, filename, sbuf, AT_SYMLINK_NOFOLLOW) != 0)
|
||||
if (write_protected <= 0 && dirent_type == DT_UNKNOWN)
|
||||
{
|
||||
/* This happens, e.g., with `rm '''. */
|
||||
write_protected = errno;
|
||||
if (cache_fstatat (fd_cwd, filename, sbuf, AT_SYMLINK_NOFOLLOW) == 0)
|
||||
{
|
||||
if (S_ISLNK (sbuf->st_mode))
|
||||
dirent_type = DT_LNK;
|
||||
else if (S_ISDIR (sbuf->st_mode))
|
||||
dirent_type = DT_DIR;
|
||||
/* Otherwise it doesn't matter, so leave it DT_UNKNOWN. */
|
||||
*pdirent_type = dirent_type;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This happens, e.g., with `rm '''. */
|
||||
write_protected = errno;
|
||||
}
|
||||
}
|
||||
|
||||
if (write_protected <= 0)
|
||||
{
|
||||
/* Using permissions doesn't make sense for symlinks. */
|
||||
if (S_ISLNK (sbuf->st_mode) && x->interactive != RMI_ALWAYS)
|
||||
return RM_OK;
|
||||
switch (dirent_type)
|
||||
{
|
||||
case DT_LNK:
|
||||
/* Using permissions doesn't make sense for symlinks. */
|
||||
if (x->interactive != RMI_ALWAYS)
|
||||
return RM_OK;
|
||||
break;
|
||||
|
||||
if (S_ISDIR (sbuf->st_mode) && !x->recursive)
|
||||
write_protected = EISDIR;
|
||||
}
|
||||
case DT_DIR:
|
||||
if (!x->recursive)
|
||||
write_protected = EISDIR;
|
||||
break;
|
||||
}
|
||||
|
||||
char const *quoted_name = quote (full_filename (filename));
|
||||
|
||||
@@ -844,8 +885,7 @@ prompt (int fd_cwd, Dirstack_state const *ds, char const *filename,
|
||||
/* FIXME: use a variant of error (instead of fprintf) that doesn't
|
||||
append a newline. Then we won't have to declare program_name in
|
||||
this file. */
|
||||
if (S_ISDIR (sbuf->st_mode)
|
||||
&& x->recursive
|
||||
if (dirent_type == DT_DIR
|
||||
&& mode == PA_DESCEND_INTO_DIR
|
||||
&& ((*is_empty = (is_empty_dir (fd_cwd, filename) ? T_YES : T_NO))
|
||||
== T_NO))
|
||||
@@ -856,6 +896,12 @@ prompt (int fd_cwd, Dirstack_state const *ds, char const *filename,
|
||||
program_name, quoted_name);
|
||||
else
|
||||
{
|
||||
if (cache_fstatat (fd_cwd, filename, sbuf, AT_SYMLINK_NOFOLLOW) != 0)
|
||||
{
|
||||
error (0, errno, _("cannot remove %s"), quoted_name);
|
||||
return RM_ERROR;
|
||||
}
|
||||
|
||||
/* TRANSLATORS: You may find it more convenient to translate
|
||||
the equivalent of _("%s: remove %s (write-protected) %s? ").
|
||||
It should avoid grammatical problems with the output
|
||||
@@ -888,19 +934,6 @@ is_dir_lstat (char const *filename, struct stat *st)
|
||||
return is_dir;
|
||||
}
|
||||
|
||||
#if HAVE_STRUCT_DIRENT_D_TYPE
|
||||
|
||||
/* True if the type of the directory entry D is known. */
|
||||
# define DT_IS_KNOWN(d) ((d)->d_type != DT_UNKNOWN)
|
||||
|
||||
/* True if the type of the directory entry D must be T. */
|
||||
# define DT_MUST_BE(d, t) ((d)->d_type == (t))
|
||||
|
||||
#else
|
||||
# define DT_IS_KNOWN(d) false
|
||||
# define DT_MUST_BE(d, t) false
|
||||
#endif
|
||||
|
||||
#define DO_UNLINK(Fd_cwd, Filename, X) \
|
||||
do \
|
||||
{ \
|
||||
@@ -970,14 +1003,14 @@ ignorable_missing (struct rm_options const *x, int errnum)
|
||||
|
||||
static enum RM_status
|
||||
remove_entry (int fd_cwd, Dirstack_state const *ds, char const *filename,
|
||||
struct stat *st,
|
||||
struct rm_options const *x, struct dirent const *dp)
|
||||
int dirent_type_arg, struct stat *st,
|
||||
struct rm_options const *x)
|
||||
{
|
||||
Ternary is_empty_directory;
|
||||
enum RM_status s = prompt (fd_cwd, ds, filename, st, x, PA_DESCEND_INTO_DIR,
|
||||
enum RM_status s = prompt (fd_cwd, ds, filename, &dirent_type_arg, st, x,
|
||||
PA_DESCEND_INTO_DIR,
|
||||
&is_empty_directory);
|
||||
bool known_to_be_dir = (cache_stat_ok (st) && S_ISDIR (st->st_mode));
|
||||
|
||||
int dirent_type = dirent_type_arg;
|
||||
if (s != RM_OK)
|
||||
return s;
|
||||
|
||||
@@ -997,7 +1030,7 @@ remove_entry (int fd_cwd, Dirstack_state const *ds, char const *filename,
|
||||
|
||||
if (cannot_unlink_dir ())
|
||||
{
|
||||
if (known_to_be_dir && ! x->recursive)
|
||||
if (dirent_type == DT_DIR && ! x->recursive)
|
||||
{
|
||||
error (0, EISDIR, _("cannot remove %s"),
|
||||
quote (full_filename (filename)));
|
||||
@@ -1013,10 +1046,11 @@ remove_entry (int fd_cwd, Dirstack_state const *ds, char const *filename,
|
||||
|
||||
/* If we happen to know that FILENAME is a directory, return now
|
||||
and let the caller remove it -- this saves the overhead of a failed
|
||||
unlink call. If FILENAME is a command-line argument, then dp is NULL,
|
||||
so we'll first try to unlink it. Using unlink here is ok, because it
|
||||
cannot remove a directory. */
|
||||
if ((dp && DT_MUST_BE (dp, DT_DIR)) || known_to_be_dir)
|
||||
unlink call. If FILENAME is a command-line argument, then
|
||||
DIRENT_TYPE is DT_UNKNOWN so we'll first try to unlink it.
|
||||
Using unlink here is ok, because it cannot remove a
|
||||
directory. */
|
||||
if (dirent_type == DT_DIR)
|
||||
return RM_NONEMPTY_DIR;
|
||||
|
||||
DO_UNLINK (fd_cwd, filename, x);
|
||||
@@ -1046,31 +1080,24 @@ remove_entry (int fd_cwd, Dirstack_state const *ds, char const *filename,
|
||||
/* If we don't already know whether FILENAME is a directory,
|
||||
find out now. Then, if it's a non-directory, we can use
|
||||
unlink on it. */
|
||||
bool is_dir;
|
||||
|
||||
if (cache_statted (st))
|
||||
is_dir = known_to_be_dir;
|
||||
else
|
||||
if (dirent_type == DT_UNKNOWN)
|
||||
{
|
||||
if (dp && DT_IS_KNOWN (dp))
|
||||
is_dir = DT_MUST_BE (dp, DT_DIR);
|
||||
else
|
||||
if (fstatat (fd_cwd, filename, st, AT_SYMLINK_NOFOLLOW))
|
||||
{
|
||||
if (fstatat (fd_cwd, filename, st, AT_SYMLINK_NOFOLLOW))
|
||||
{
|
||||
if (ignorable_missing (x, errno))
|
||||
return RM_OK;
|
||||
if (ignorable_missing (x, errno))
|
||||
return RM_OK;
|
||||
|
||||
error (0, errno, _("cannot remove %s"),
|
||||
quote (full_filename (filename)));
|
||||
return RM_ERROR;
|
||||
}
|
||||
|
||||
is_dir = !! S_ISDIR (st->st_mode);
|
||||
error (0, errno, _("cannot remove %s"),
|
||||
quote (full_filename (filename)));
|
||||
return RM_ERROR;
|
||||
}
|
||||
|
||||
if (S_ISDIR (st->st_mode))
|
||||
dirent_type = DT_DIR;
|
||||
}
|
||||
|
||||
if (! is_dir)
|
||||
if (dirent_type == DT_DIR)
|
||||
{
|
||||
/* At this point, barring race conditions, FILENAME is known
|
||||
to be a non-directory, so it's ok to try to unlink it. */
|
||||
@@ -1208,7 +1235,8 @@ remove_cwd_entries (DIR **dirp,
|
||||
Systems without the d_type member will have to endure
|
||||
the performance hit of first calling lstat F. */
|
||||
cache_stat_init (subdir_sb);
|
||||
tmp_status = remove_entry (dirfd (*dirp), ds, f, subdir_sb, x, dp);
|
||||
tmp_status = remove_entry (dirfd (*dirp), ds, f,
|
||||
D_TYPE (dp), subdir_sb, x);
|
||||
switch (tmp_status)
|
||||
{
|
||||
case RM_OK:
|
||||
@@ -1404,13 +1432,10 @@ remove_dir (int fd_cwd, Dirstack_state *ds, char const *dir,
|
||||
/* Try to remove EMPTY_DIR only if remove_cwd_entries succeeded. */
|
||||
if (tmp_status == RM_OK)
|
||||
{
|
||||
/* This does a little more work than necessary when it actually
|
||||
prompts the user. E.g., we already know that D is a directory
|
||||
and that it's almost certainly empty, yet we lstat it.
|
||||
But that's no big deal since we're interactive. */
|
||||
struct stat empty_st;
|
||||
Ternary is_empty;
|
||||
enum RM_status s = prompt (fd, ds, empty_dir,
|
||||
int dirent_type = DT_DIR;
|
||||
enum RM_status s = prompt (fd, ds, empty_dir, &dirent_type,
|
||||
cache_stat_init (&empty_st), x,
|
||||
PA_REMOVE_DIR, &is_empty);
|
||||
|
||||
@@ -1509,7 +1534,8 @@ rm_1 (Dirstack_state *ds, char const *filename,
|
||||
AD_push_initial (ds);
|
||||
AD_INIT_OTHER_MEMBERS ();
|
||||
|
||||
enum RM_status status = remove_entry (AT_FDCWD, ds, filename, &st, x, NULL);
|
||||
enum RM_status status = remove_entry (AT_FDCWD, ds, filename,
|
||||
DT_UNKNOWN, &st, x);
|
||||
if (status == RM_NONEMPTY_DIR)
|
||||
{
|
||||
/* In the event that remove_dir->remove_cwd_entries detects
|
||||
|
||||
@@ -204,7 +204,7 @@ Note that if you use rm to remove a file, it is usually possible to recover\n\
|
||||
the contents of that file. If you want more assurance that the contents are\n\
|
||||
truly unrecoverable, consider using shred.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -152,7 +152,7 @@ Remove the DIRECTORY(ies), if they are empty.\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ FORMAT must be suitable for printing one argument of type `double';\n\
|
||||
it defaults to %.PRECf if FIRST, INCREMENT, and LAST are all fixed point\n\
|
||||
decimal numbers with maximum precision PREC, and to %g otherwise.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ This program is useful only when run by root (user ID zero).\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -236,7 +236,7 @@ In addition, file system backups and remote mirrors may contain copies\n\
|
||||
of the file that cannot be removed, and that will allow a shredded file\n\
|
||||
to be recovered later.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
\n\
|
||||
With no FILE, or when FILE is -, read standard input.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
|
||||
exit (status);
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ specified by the sum of their values.\n\
|
||||
program_name, program_name);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -380,7 +380,7 @@ The locale specified by the environment affects sort order.\n\
|
||||
Set LC_ALL=C to get the traditional sort order that uses\n\
|
||||
native byte values.\n\
|
||||
"), stdout );
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
|
||||
exit (status);
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
\n\
|
||||
SIZE may have a multiplier suffix: b for 512, k for 1K, m for 1 Meg.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -903,7 +903,7 @@ Valid format sequences for file systems:\n\
|
||||
%T Type in human readable form\n\
|
||||
"), stdout);
|
||||
printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,5 +1,5 @@
|
||||
/* stty -- change and print terminal line settings
|
||||
Copyright (C) 1990-2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-2005, 2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -62,7 +62,6 @@
|
||||
#include "error.h"
|
||||
#include "fd-reopen.h"
|
||||
#include "quote.h"
|
||||
#include "vasprintf.h"
|
||||
#include "xstrtol.h"
|
||||
|
||||
/* The official name of this program (e.g., no `g' prefix). */
|
||||
@@ -721,7 +720,7 @@ prints baud rate, line discipline, and deviations from stty sane. In\n\
|
||||
settings, CHAR is taken literally, or coded as in ^c, 0x37, 0177 or\n\
|
||||
127; special values ^- or undef used to disable special characters.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@ Change the effective user id and group id to that of USER.\n\
|
||||
\n\
|
||||
A mere - implies -l. If USER not given, assume root.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ Print checksum and block counts for each FILE.\n\
|
||||
\n\
|
||||
With no FILE, or when FILE is -, read standard input.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ Force changed blocks to disk, update the super block.\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -581,3 +581,13 @@ ptr_align (void const *ptr, size_t alignment)
|
||||
|| (Type) ((Accum) * 10 + (Digit_val)) < (Accum)) \
|
||||
? false : (((Accum) = (Accum) * 10 + (Digit_val)), true)) \
|
||||
)
|
||||
|
||||
static inline void
|
||||
emit_bug_reporting_address (void)
|
||||
{
|
||||
/* TRANSLATORS: The placeholder indicates the bug-reporting address
|
||||
for this package. Please add _another line_ saying
|
||||
"Report translation bugs to <...>\n" with the address for translation
|
||||
bugs (typically your translation team's web or email address). */
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
}
|
||||
@@ -149,7 +149,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -282,7 +282,7 @@ rotation). Use --follow=name in that case. That causes tail to track the\n\
|
||||
named file by reopening it periodically to see if it has been removed and\n\
|
||||
recreated by some other program.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ Copy standard input to each FILE, and also to standard output.\n\
|
||||
\n\
|
||||
If a FILE is -, copy again to standard output.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -774,7 +774,7 @@ Beware that parentheses need to be escaped (e.g., by backslashes) for shells.\n\
|
||||
INTEGER may also be -l STRING, which evaluates to the length of STRING.\n\
|
||||
"), stdout);
|
||||
printf (USAGE_BUILTIN_WARNING, _("test and/or ["));
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -260,7 +260,7 @@ Note that the -d and -t options accept different time-date formats.\n\
|
||||
\n\
|
||||
If a FILE is -, touch standard output.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ only be used in pairs to specify case conversion. \
|
||||
translating nor deleting; else squeezing uses SET2 and occurs after\n\
|
||||
translation or deletion.\n\
|
||||
"), stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ Usage: %s [ignored command line arguments]\n\
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
exit (status);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ With no FILE, or when FILE is -, read standard input.\n\
|
||||
"), program_name);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
|
||||
exit (status);
|
||||
|
||||
@@ -74,7 +74,7 @@ Print the file name of the terminal connected to standard input.\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ Print certain system information. With no OPTION, same as -s.\n\
|
||||
"), stdout);
|
||||
fputs (HELP_OPTION_DESCRIPTION, stdout);
|
||||
fputs (VERSION_OPTION_DESCRIPTION, stdout);
|
||||
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
|
||||
emit_bug_reporting_address ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
Loaded 100 of 114 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user