X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Frtapelib.c;h=cd00fd56605ae3e164f6a77db6dc49036e331e4d;hb=15a607fc11d8563fe471924fb6e718ceb9adfce4;hp=ce141b419681f20d0b20f9fab15d8af376deb3b7;hpb=172dc3e72b5a2b11af420eb546024c3dc7f03deb;p=chaz%2Ftar diff --git a/src/rtapelib.c b/src/rtapelib.c index ce141b4..cd00fd5 100644 --- a/src/rtapelib.c +++ b/src/rtapelib.c @@ -33,7 +33,7 @@ code, courtesy of Dan Kegel. */ #include "system.h" - +#include "common.h" #include #include @@ -482,10 +482,7 @@ rmt_open__ (const char *path, int open_mode, int bias, const char *remote_shell) close (from_remote[remote_pipe_number][PREAD]); close (from_remote[remote_pipe_number][PWRITE]); -#if !MSDOS - setuid (getuid ()); - setgid (getgid ()); -#endif + sys_reset_uid_gid (); if (remote_user) execl (remote_shell, remote_shell_basename, remote_host, @@ -608,6 +605,7 @@ rmt_lseek__ (int handle, off_t offset, int whence) uintmax_t u = offset < 0 ? - (uintmax_t) offset : (uintmax_t) offset; char *p = operand_buffer + sizeof operand_buffer; + *--p = 0; do *--p = '0' + (int) (u % 10); while ((u /= 10) != 0); @@ -651,6 +649,7 @@ rmt_ioctl__ (int handle, int operation, char *argument) : (uintmax_t) ((struct mtop *) argument)->mt_count); char *p = operand_buffer + sizeof operand_buffer; + *--p = 0; do *--p = '0' + (int) (u % 10); while ((u /= 10) != 0);