bug#15926: RFE: unlink command already uses 'unlink' call; make 'rm' use 'remove' call

2013-11-26 Thread Pádraig Brady
On 11/26/2013 11:08 PM, Bernhard Voelker wrote:
> +#---
> +# Exercise "rm -r /" without and with the --preserve-root option.
> +# Also exercise the synonyms '///' and '' which would normally go into
> +# the 'synonyms' test category below; but due to the way gnulib's fts_open()
> +# performs trimming of trailing slashes ("///" -> "/"), the error diagnostic
> +# is the same as for a bare "/", see the ROOT_DEV_INO_WARN macro.
> +# Expect a non-Zero exit status.
> +for opts in '/' '--preserve-root /' '///' ''; do

This relies on that fts behavior, which I'm a bit wary about coupling to.
I'd be inclined to lump all the synonyms together and just
be less stringent in the error message we compare there.

> +  exercise_rm_r_root $opts \
> +&& fail=1

So this call has 2s to work or we fail the test.
That seems too short from experience of running many tests
in parallel on slow/loaded systems.
This is at odds of course with trying to get rm not run
for too long. As I said I wouldn't bother with that constraint,
and I can't think how to avoid false failures doing that.

> +  # Expect nothing in 'out' and the above error diagnostic in 'err'.
> +  # As rm(1) should have skipped the "/" argument, it does not call 
> unlinkat().
> +  # Therefore, the evidence file "x" should not exist.
> +  compare /dev/null out || fail=1
> +  compare exp   err || fail=1
> +  test -f x && fail=1
> +
> +  # Do nothing more if this test failed.
> +  test $fail = 1 && { cat out; cat err; Exit $fail; }
> +done
> +
> +#---
> +# Exercise "rm -r file1 / file2".
> +# Expect a non-Zero exit status representing failure to remove "/",
> +# yet 'file1' and 'file2' should be removed.
> +: > file1 || framework_failure_
> +: > file2 || framework_failure_
> +
> +# Now that we know that 'rm' won't call the unlinkat() system function for 
> "/",
> +# we could probably execute it without the LD_PRELOAD'ed safety net.
> +# Nevertheless, it's still better to use it for this test.
> +# Tell the unlinkat() replacement function to not _exit(0) immediately
> +# by setting the following variable.
> +CU_TEST_SKIP_EXIT=1
> +
> +exercise_rm_r_root --preserve-root file1 '/' file2 \
> +  && fail=1
> +
> +unset CU_TEST_SKIP_EXIT
> +
> +cat < out_removed
> +removed 'file1'
> +removed 'file2'
> +EOD
> +
> +# The above error diagnostic should appear in 'err'.
> +# Both 'file1' and 'file2' should be removed.  Simply verify that in the
> +# "out" file, as the replacement unlinkat() dummy did not remove them.
> +# Expect the evidence file "x" to exist.
> +compare out_removed out || fail=1
> +compare exp err || fail=1
> +test -f x   || fail=1
> +
> +# Do nothing more if this test failed.
> +test $fail = 1 && { cat out; cat err; Exit $fail; }
> +
> +#---
> +# Exercise various synonyms of "/" including symlinks to it.
> +# The error diagnostic slightly differs from that of the basic "/" case 
> above.
> +cat < exp_same || framework_failure_
> +rm: it is dangerous to operate recursively on 'FILE' (same as '/')
> +rm: use --no-preserve-root to override this failsafe
> +EOD
> +
> +# Some combinations have a trailing "." or "..".  This triggers another check
> +# in the code first and therefore leads to a different diagnostic.  However,
> +# we want to test anyway to protect against future reordering of the checks
> +# in the code.
> +cat < exp_dot || framework_failure_
> +rm: refusing to remove '.' or '..' directory: skipping 'FILE'
> +EOD
> +
> +# Prepare a few symlinks to "/".
> +ln -s /rootlink  || framework_failure_
> +ln -s rootlink rootlink2 || framework_failure_
> +ln -sr /   rootlink3 || framework_failure_
> +
> +for file in\
> +  'rootlink/'  \
> +  'rootlink2/' \
> +  'rootlink3/' \
> +  '//' \
> +  '//.'\
> +  '/./'\
> +  '/../'   \
> +  '/.././' \
> +  '/bin/..' ; do

I'm still worried about /bin being always present.
How about: test -d "$file" || continue

> +
> +  exercise_rm_r_root --preserve-root "$file" \
> +&& fail=1
> +
> +  sed "s,FILE,$file," exp_same > exp2 || framework_failure_
> +  sed "s,FILE,$file," exp_dot  > exp_dot2 || framework_failure_
> +
> +  # Check against the "refusing to remove '.' or '..'" diagnostic.
> +  compare exp_dot2 err \
> +&& continue
> +
> +  compare /dev/null out || fail=1
> +  compare exp2  err || fail=1
> +  test -f x && fail=1
> +
> +  # Do nothing more if this test failed.
> +  test $fail = 1 && { cat out; cat err; Exit $fail; }
> +done
> +
> +#---
> +# Until now, it was all just fun.
> +# Now exercise the --no-preserve-root option with which rm(1) should enter
> +# the intercepted unlinkat() system call.
> 

bug#15955: df hides original mount point instead of bind mount

2013-11-26 Thread Phillip Susi
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 11/26/2013 06:37 PM, Bernhard Voelker wrote:
> As already mentioned, the current implementation is not ideal. It
> is a compromise between the requirements which hit 'df' at that
> time:
> 
> * showing the real root file system instead of early-boot rootfs:
> 
> $ src/df -a | grep ' /$' rootfs12095032   798
> 3491744  70% / /dev/sda1 12095032   798   3491744  70%
> /

That doesn't seem to be at all related since the path on both is
exactly the same, not one longer than the other, and is filtered by
the fstype being "rootfs".  For that matter, this has always seemed
like a bug in the kernel to me: rootfs isn't mounted in /, it is
mounted above / and therefore is not visible to this process, so it
shouldn't be shown in /proc/mounts.

> * suppressing massive bind-mounts with hundreds or thousands of
> bind mounts of the same file system:
> 
> $ for f in $(seq 1000) ; do mkdir dir$f \ && mount -o bind /etc
> dir$f ; \ done and then look at 'df' vs. 'df -a'.

Yes, the whole topic is hiding bind mounts; the question is how to
choose which one to hide.  Why use the path length instead of which
was mounted first?

> * IIRC there was a another issue re. shortening mount information
> like: 
> /dev/disk/by-id/scsi-SATA_Hitachi_HDS7210_JP2911N03AR0WV-part1

Again, that seems totally unrelated.  The by-id is a symlink so it is
followed to the underlying devnode and that's what is reported in
/proc/mounts, and it doesn't have anything to do with the length of
the mount point.


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCgAGBQJSlU+JAAoJEI5FoCIzSKrwJnEH/jYK117dsdMOQWJsSBqYIRUD
fI4ilZjsTPb5n49dlsN4oXI/phzdFvGTKdw3LRNYv2MJhG2KcQScIRqIgV4OT+Rr
9RsRAHtvGF7j89AtdKbu4HVQlFm450WrqAsReg9vnjCrj6q57Ms/CXp4GNHDu1HD
JaNZ/8XlpLAsJR9rz62+R1GCqQF4yZbwRDgudy8gxG1OcXmO24Wk6SE03Q0Ss8Ho
QFSreq9Bpzs4l/BAkqLuAXJAMBHX5gQ1R/URbHv+m3mW6RnCVryjSQmOGd7+wWRn
Y6ttY+OGU9334ckwfsJ4lD448fY2/81ty89NhrkKPuXwZbUj1ocJiZK8SWyfcAE=
=pAtS
-END PGP SIGNATURE-





bug#15970: [Bug-tar] Crash in gettext() after fork() on Mac OS X

2013-11-26 Thread Pádraig Brady
On 11/26/2013 10:09 PM, Jim Meyering wrote:
> Hi Pádraig,
> 
> Thanks for dealing with that. Your patch looks correct.
> Did you consider using inttostr in place of that first part of 
> async_safe_error?

Paul suggested that too and I've pushed an updated patch now.
I'd searched for INTTOSTR without luck, and in my tired state
just open coded it meaning to come back and search for the routine :)

thanks,
Pádraig.





bug#15955: df hides original mount point instead of bind mount

2013-11-26 Thread Bernhard Voelker
On 11/25/2013 12:29 AM, Phillip Susi wrote:
> On 11/24/2013 05:24 AM, Bernhard Voelker wrote:
>> Thanks for the suggestion, but that is not possible.  For the kernel,
>> all bind mounts are actually equal among each other, and there's no
>> information about "bind" flags in /proc/self/mounts (which 'df' uses).
> 
> I'm aware of that, but the order they are reported in /proc/mounts at
> least seems to be the order they were mounted in, which seems like it
> would be a better thing to decide which to show and hide than the
> length of the path.

As already mentioned, the current implementation is not ideal.
It is a compromise between the requirements which hit 'df' at that time:

* showing the real root file system instead of early-boot rootfs:

  $ src/df -a | grep ' /$'
  rootfs12095032   798   3491744  70% /
  /dev/sda1 12095032   798   3491744  70% /

* suppressing massive bind-mounts with hundreds or thousands of bind
  mounts of the same file system:

$ for f in $(seq 1000) ; do
mkdir dir$f \
  && mount -o bind /etc dir$f ; \
  done
  and then look at 'df' vs. 'df -a'.

* IIRC there was a another issue re. shortening mount information like:
  /dev/disk/by-id/scsi-SATA_Hitachi_HDS7210_JP2911N03AR0WV-part1

This has to be discussed in the context of Fedora's currently open
bug reports.

Thanks & have a nice day,
Berny





bug#15926: RFE: unlink command already uses 'unlink' call; make 'rm' use 'remove' call

2013-11-26 Thread Bernhard Voelker
On 11/25/2013 08:31 AM, Bernhard Voelker wrote:
> On 11/25/2013 02:10 AM, Pádraig Brady wrote:
>> So this might race with rm being preempted between the touch() and the 
>> exit(),
>> causing a false failure? It's probably best to not kill if the 'x' file 
>> exists,
>> as it's very unlikely that rm will run as normal in that case.
> 
> outch, the race is even more likely for the newly added "rm -r file1 / file2"
> case where unlinkat() is called twice without the immediate _exit() due to
> CU_TEST_SKIP_EXIT=1.
> 
> I have to reconsider, but won't have time for that today.

Hi Padraig,

I simplified it by using timeout(1), as you already suggested:

  if [ "$CU_TEST_SKIP_EXIT" = 1 ]; then
# Pass on this variable into 'rm's environment.
skip_exit='CU_TEST_SKIP_EXIT=1'
  fi

  timeout --signal=KILL 2 \
env LD_PRELOAD=./k.so $skip_exit \
  rm -rv --one-file-system "$@" > out 2> err

I also changed the other things you mentioned.

Finally, I had to pass --interactive=never to the last test to
avoid the "descend into write-protected directory?" prompt.
This is since rm has been executed in the background.

Next try attached.

Have a nice day,
Berny
>From a15731bdf727e3574a11fbff8634dfd1beabf82e Mon Sep 17 00:00:00 2001
From: Bernhard Voelker 
Date: Tue, 26 Nov 2013 23:50:08 +0100
Subject: [PATCH] tests: add a test for rm -r "/"

* tests/rm/r-root.sh: Add a non-root test.
* tests/local.mk (all_tests): Mention the test.
---
 tests/local.mk |   1 +
 tests/rm/r-root.sh | 239 +
 2 files changed, 240 insertions(+)
 create mode 100755 tests/rm/r-root.sh

diff --git a/tests/local.mk b/tests/local.mk
index 3c92425..1888b21 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -201,6 +201,7 @@ all_tests =	\
   tests/rm/r-2.sh\
   tests/rm/r-3.sh\
   tests/rm/r-4.sh\
+  tests/rm/r-root.sh\
   tests/rm/readdir-bug.sh			\
   tests/rm/rm1.sh\
   tests/touch/empty-file.sh			\
diff --git a/tests/rm/r-root.sh b/tests/rm/r-root.sh
new file mode 100755
index 000..26db030
--- /dev/null
+++ b/tests/rm/r-root.sh
@@ -0,0 +1,239 @@
+#!/bin/sh
+# Try to remove '/' recursively.
+
+# Copyright (C) 2013 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 3 of the License, 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, see .
+
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ rm
+
+# POSIX mandates rm(1) to skip '/' arguments.  This test verifies this mandated
+# behavior as well as the --preserve-root and --no-preserve-root options.
+# Especially the latter case is a live fire exercise as rm(1) is supposed to
+# enter the unlinkat() system call.  Therefore, limit the risk as much
+# as possible -- if there's a bug this test would wipe the system out!
+
+# Faint-hearted: skip this test for the 'root' user.
+skip_if_root_
+
+# Pull the teeth from rm(1) by intercepting the unlinkat() system call via the
+# LD_PRELOAD environment variable.  This requires shared libraries to work.
+require_gcc_shared_
+
+cat > k.c <<'EOF' || framework_failure_
+#include 
+#include 
+#include 
+
+int unlinkat (int dirfd, const char *pathname, int flags)
+{
+  /* Prove that LD_PRELOAD works: create the evidence file "x".  */
+  fclose (fopen ("x", "w"));
+
+  /* Immediately terminate, unless indicated otherwise.  */
+  if (! getenv("CU_TEST_SKIP_EXIT"))
+_exit (0);
+
+  /* Pretend success.  */
+  return 0;
+}
+EOF
+
+# Then compile/link it:
+gcc -Wall --std=gnu99 -shared -fPIC -ldl -O2 k.c -o k.so \
+  || framework_failure_ 'failed to build shared library'
+
+# Verify that "rm -r dir" basically works.
+mkdir   dir || framework_failure_
+rm -r   dir || framework_failure_
+test -d dir && framework_failure_
+
+# Now verify that intercepting unlinkat() works:
+# rm(1) must succeed as before, but this time both the evidence file "x"
+# and the test directory "dir" must exist afterwards.
+mkdir   dir || framework_failure_
+LD_PRELOAD=./k.so \
+rm -r   dir || framework_failure_
+test -d dir || skip_ "internal test failure: maybe LD_PRELOAD doesn't work?"
+test -f x   || skip_ "internal test failure: maybe LD_PRELOAD doesn't work?"
+
+#---
+# exercise_rm_r_root: shell function to test "rm -r '/'"
+# The caller must provide the FILE to remove as well as any options
+# which should be passed to 'rm'.
+# Paranoia mode on:
+# For the worst ca

bug#15970: [Bug-tar] Crash in gettext() after fork() on Mac OS X

2013-11-26 Thread Jim Meyering
Hi Pádraig,

Thanks for dealing with that. Your patch looks correct.
Did you consider using inttostr in place of that first part of async_safe_error?





bug#15970: [Bug-tar] Crash in gettext() after fork() on Mac OS X

2013-11-26 Thread Paul Eggert
On 11/26/2013 04:23 AM, Pádraig Brady wrote:
> Updated patch attached.

Thanks, looks good.  Hmm, I don't see the patch committed
but the bug is marked as closed?





bug#14525: ls -k produced no size, ls -lk lists in bytes? What's up w/k?

2013-11-26 Thread Paul Eggert
Looks good to me; thanks.





bug#14525: ls -k produced no size, ls -lk lists in bytes? What's up w/k?

2013-11-26 Thread Pádraig Brady
On 06/04/2013 08:40 PM, Eric Blake wrote:
> On 06/02/2013 12:47 PM, Paul Eggert wrote:
>> On 06/01/2013 02:54 PM, Linda Walsh wrote:
>>> ... removing features that exceeded posix
>>
>> As I explained to you in my previous message, no features
>> were removed.  Merely the option syntax was changed.
>>
>>> What switch(es) are supposed to be used to choose what units to display
>>> sizes on the long listing?
>>
>> The --block-size option.  See:
>>
>> http://www.gnu.org/software/coreutils/manual/coreutils.html#Block-size
>>
>> Coreutils already has all the features that you asked for
>> in your email.
> 
> I just noticed that we DO have a doc bug; in 'info coreutils "Block
> size"', we incorrectly claim:
> 
>>> Block size defaults can be overridden by an explicit
>>> `--block-size=SIZE' option.  The `-k' option is equivalent to
>>> `--block-size=1K', which is the default unless the `POSIXLY_CORRECT'
>>> environment variable is set. 
> 
> which, while still true for du and df, is now false for ls.
> 

Doc update attached.

thanks,
Pádraig.
>From 17bce8c63e9e0f85b48ca62b63413ce9102af5c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= 
Date: Tue, 26 Nov 2013 15:32:39 +
Subject: [PATCH] doc: clarify the operation of ls -k

* src/ls.c (usage): Mention -k only changes the display
for disk usage (directory total, and ls -s), and imply
that it can be overridden (by --block-size, and -h).
* doc/coreutils.texi (block size): Mention that ls -k
handling is different to other utilities.
Addresses http://bugs.gnu.org/14525
---
 doc/coreutils.texi |4 +++-
 src/ls.c   |2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 64713dc..67feb12 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -1012,7 +1012,9 @@ option is equivalent to @option{--block-size=1K}, which
 is the default unless the @env{POSIXLY_CORRECT} environment variable is
 set.  The @option{-h} or @option{--human-readable} option is equivalent to
 @option{--block-size=human-readable}.  The @option{--si} option is
-equivalent to @option{--block-size=si}.
+equivalent to @option{--block-size=si}.  Note for @command{ls}
+the @option{-k} option does not control the display of the
+apparent file sizes, whereas the @option{--block-size} option does.
 
 @node Floating point
 @section Floating point numbers
diff --git a/src/ls.c b/src/ls.c
index 512d65e..e7d1d93 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -4816,7 +4816,7 @@ Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n\
   -i, --inodeprint the index number of each file\n\
   -I, --ignore=PATTERN   do not list implied entries matching shell PATTERN\
 \n\
-  -k, --kibibytesuse 1024-byte blocks\n\
+  -k, --kibibytesdefault to 1024-byte blocks for disk usage\n\
 "), stdout);
   fputs (_("\
   -l use a long listing format\n\
-- 
1.7.7.6



bug#15970: [Bug-tar] bug#15970: Crash in gettext() after fork() on Mac OS X

2013-11-26 Thread Pádraig Brady
On 11/26/2013 10:53 AM, Joerg Schilling wrote:
> 
> Are you using "ignore_value" because of the gcc bug that ignores the official
> method to tell that the return code is ignored intentionally:
> 
>   (void) write(fd, buf, len);

Right: 
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/ignore-value.h;hb=HEAD

I thought it marginally cleaner to use that,
than to have a goto to just _exit() on write error.

thanks,
Pádraig.





bug#15970: [Bug-tar] Crash in gettext() after fork() on Mac OS X

2013-11-26 Thread Pádraig Brady
On 11/26/2013 04:55 AM, Paul Eggert wrote:
> Pádraig Brady wrote:
> 
>> How about the attached instead that just uses
>> a somewhat degraded but simpler error() equivalent.
> 
> That looks safe, though it could be simplified:
> use inttostr instead of repeating its body,

Hah, I was thinking this must be done somewhere else :)

> and since !!p == !!errnum there's no need
> to have those duplicate conditions.

I meant to use (p || errstr), but let's assume
errstr is present, so yes we can then remove condition.

> Plus, just use STDERR_FILENO rather than
> fiddling with fileno (stderr),

done

> and async_safe_error
> should be _Noreturn and should unconditionally call
> _exit.

fair enough. I changed the name so to async_safe_die()

> And, I wouldn't bother looking at dup2's
> return value, any more than we look at close's.

Updated patch attached.

thanks!
Pádraig.

>From 02ac652957d0e21b0aa285dbcb718d8d60329ec7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= 
Date: Tue, 26 Nov 2013 02:47:36 +
Subject: [PATCH] sort: avoid issues when issuing diagnostics from child
 processes

* src/sort.c: (async_safe_die): A new limited version of error(),
that outputs fixed strings and unconverted errnos to stderr.
This is safe to call in the limited context of a signal handler,
or in this particular case, between the fork() and exec() of
a multithreaded process.
(move_fd_or_die): Use the async_safe_die() rather than error().
(maybe_create_temp): Likewise.
(open_temp): Likewise.
Fixes http://bugs.gnu.org/15970
---
 src/sort.c |   46 +++---
 1 files changed, 39 insertions(+), 7 deletions(-)

diff --git a/src/sort.c b/src/sort.c
index bb4e313..573d6cb 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -373,6 +373,34 @@ static bool debug;
number are present, temp files will be used. */
 static unsigned int nmerge = NMERGE_DEFAULT;
 
+/* Output an error to stderr using async-signal-safe routines, and _exit().
+   This can be used safely from signal handlers,
+   and between fork() and exec() of multithreaded processes.  */
+
+static void async_safe_die (int, const char *) ATTRIBUTE_NORETURN;
+static void
+async_safe_die (int errnum, const char *errstr)
+{
+  ignore_value (write (STDERR_FILENO, errstr, strlen (errstr)));
+
+  /* Even if defined HAVE_STRERROR_R, we can't use it,
+ as it may return a translated string etc. and even if not
+ may malloc() which is unsafe.  We might improve this
+ by testing for sys_errlist and using that if available.
+ For now just report the error number.  */
+  if (errnum)
+{
+  char errbuf[INT_BUFSIZE_BOUND (errnum)];
+  char *p = inttostr (errnum, errbuf);
+  ignore_value (write (STDERR_FILENO, ": errno ", 8));
+  ignore_value (write (STDERR_FILENO, p, strlen (p)));
+}
+
+  ignore_value (write (STDERR_FILENO, "\n", 1));
+
+  _exit (SORT_FAILURE);
+}
+
 /* Report MESSAGE for FILE, then clean up and exit.
If FILE is null, it represents standard output.  */
 
@@ -982,8 +1010,8 @@ move_fd_or_die (int oldfd, int newfd)
 {
   if (oldfd != newfd)
 {
-  if (dup2 (oldfd, newfd) < 0)
-error (SORT_FAILURE, errno, _("dup2 failed"));
+  /* This should never fail for our usage.  */
+  dup2 (oldfd, newfd);
   close (oldfd);
 }
 }
@@ -1095,13 +1123,15 @@ maybe_create_temp (FILE **pfp, bool survive_fd_exhaustion)
 }
   else if (node->pid == 0)
 {
+  /* Being the child of a multithreaded program before exec(),
+ we're restricted to calling async-signal-safe routines here.  */
   close (pipefds[1]);
   move_fd_or_die (tempfd, STDOUT_FILENO);
   move_fd_or_die (pipefds[0], STDIN_FILENO);
 
-  if (execlp (compress_program, compress_program, (char *) NULL) < 0)
-error (SORT_FAILURE, errno, _("couldn't execute %s"),
-   compress_program);
+  execlp (compress_program, compress_program, (char *) NULL);
+
+  async_safe_die (errno, "couldn't execute compress program");
 }
 }
 
@@ -1153,13 +1183,15 @@ open_temp (struct tempnode *temp)
   break;
 
 case 0:
+  /* Being the child of a multithreaded program before exec(),
+ we're restricted to calling async-signal-safe routines here.  */
   close (pipefds[0]);
   move_fd_or_die (tempfd, STDIN_FILENO);
   move_fd_or_die (pipefds[1], STDOUT_FILENO);
 
   execlp (compress_program, compress_program, "-d", (char *) NULL);
-  error (SORT_FAILURE, errno, _("couldn't execute %s -d"),
- compress_program);
+
+  async_safe_die (errno, "couldn't execute compress program (with -d)");
 
 default:
   temp->pid = child;
-- 
1.7.7.6



bug#15970: [Bug-tar] bug#15970: Crash in gettext() after fork() on Mac OS X

2013-11-26 Thread Joerg Schilling

Are you using "ignore_value" because of the gcc bug that ignores the official
method to tell that the return code is ignored intentionally:

(void) write(fd, buf, len);

Jörg

-- 
 EMail:jo...@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
   j...@cs.tu-berlin.de(uni)  
   joerg.schill...@fokus.fraunhofer.de (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily