From 02e6ba91e887bd11146a57185b223582f56f3f09 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Mon, 30 Sep 2002 20:39:56 +0000 Subject: 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 --- archival/tar.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'archival/tar.c') diff --git a/archival/tar.c b/archival/tar.c index 0f0d4fd6f..88a815de6 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 */ -- cgit v1.2.3