summaryrefslogtreecommitdiff
path: root/paxlib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-02-28 11:44:03 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-02-28 11:45:46 -0800
commitafe372f33a5dd31bcca34dc4d73e2c092447635f (patch)
treecfc8124e76efbd5ceea4cd3b8b1fb0e9b77bc4a9 /paxlib
parenteb7db65ac17f5340abddb2bc719918eef756e30e (diff)
downloadpaxutils-afe372f33a5dd31bcca34dc4d73e2c092447635f.tar.gz
Avoid linking problem in sys_reset_uid_gid
* lib/system.h (sys_reset_uid_gid) [!MSDOS]: On failure, instead of invoking FATAL_ERROR set errno and return the name of the syscall that failed, so that the caller can decide what to do. This avoids some GNU Tar linking problems on compilers that do not inline this function. All callers changed.
Diffstat (limited to 'paxlib')
-rw-r--r--paxlib/rtape.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/paxlib/rtape.c b/paxlib/rtape.c
index 41f6ef1..0a31c44 100644
--- a/paxlib/rtape.c
+++ b/paxlib/rtape.c
@@ -503,7 +503,10 @@ rmt_open (const char *file_name, int open_mode, int bias,
close (from_remote[remote_pipe_number][PREAD]);
close (from_remote[remote_pipe_number][PWRITE]);
- sys_reset_uid_gid ();
+ char const *reseterr = sys_reset_uid_gid ();
+ if (reseterr)
+ error (EXIT_ON_EXEC_ERROR, errno,
+ _("Cannot reset uid and gid: %s"), reseterr);
if (!rmt_command)
rmt_command = DEFAULT_RMT_COMMAND;