aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
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 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 */