summaryrefslogtreecommitdiff
path: root/lib/rtapelib.c
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 /lib/rtapelib.c
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 'lib/rtapelib.c')
-rw-r--r--lib/rtapelib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/rtapelib.c b/lib/rtapelib.c
index fae0db8..0c516e5 100644
--- a/lib/rtapelib.c
+++ b/lib/rtapelib.c
@@ -504,7 +504,10 @@ rmt_open__ (const char *file_name, int open_mode, int bias,
error (EXIT_ON_EXEC_ERROR, errno,
_("Cannot redirect files for remote shell"));
- 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 (remote_user)
execl (remote_shell, remote_shell_basename, remote_host,