summaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorEric Andersen2002-09-30 20:39:56 +0000
committerEric Andersen2002-09-30 20:39:56 +0000
commit02e6ba91e887bd11146a57185b223582f56f3f09 (patch)
treecc1954165fe7e6efed1ba0dfa7d5c3aea97fffa5 /archival
parenta6f6e06107e69b79858acaa511c452a0a73cf207 (diff)
downloadbusybox-02e6ba91e887bd11146a57185b223582f56f3f09.zip
busybox-02e6ba91e887bd11146a57185b223582f56f3f09.tar.gz
Vodz' last_patch57:
Hi, Erik. my_getpw(uid/gid) and applets used it have problem: if username for uid not found, applets can`t detect it (but code pessent). Also "%8ld " format is bad: spaces not required (applets have self format or spec format (tar applet) and overflow for "id" applet...) This problem also pressent in stable version. Patch for unstable in attach. --w vodz
Diffstat (limited to 'archival')
-rw-r--r--archival/tar.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/archival/tar.c b/archival/tar.c
index 0f0d4fd..88a815d 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -244,12 +244,10 @@ static inline int writeTarHeader(struct TarBallInfo *tbInfo,
TAR_MAGIC_LEN + TAR_VERSION_LEN);
/* Enter the user and group names (default to root if it fails) */
- my_getpwuid(header.uname, statbuf->st_uid);
- if (!*header.uname)
- strcpy(header.uname, "root");
- my_getgrgid(header.gname, statbuf->st_gid);
- if (!*header.uname)
+ if (my_getpwuid(header.uname, statbuf->st_uid) == NULL)
strcpy(header.uname, "root");
+ if (my_getgrgid(header.gname, statbuf->st_gid) == NULL)
+ strcpy(header.gname, "root");
if (tbInfo->hlInfo) {
/* This is a hard link */