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,
244 TAR_MAGIC_LEN + TAR_VERSION_LEN); 244 TAR_MAGIC_LEN + TAR_VERSION_LEN);
245 245
246 /* Enter the user and group names (default to root if it fails) */ 246 /* Enter the user and group names (default to root if it fails) */
247 my_getpwuid(header.uname, statbuf->st_uid); 247 if (my_getpwuid(header.uname, statbuf->st_uid) == NULL)
248 if (!*header.uname)
249 strcpy(header.uname, "root");
250 my_getgrgid(header.gname, statbuf->st_gid);
251 if (!*header.uname)
252 strcpy(header.uname, "root"); 248 strcpy(header.uname, "root");
249 if (my_getgrgid(header.gname, statbuf->st_gid) == NULL)
250 strcpy(header.gname, "root");
253 251
254 if (tbInfo->hlInfo) { 252 if (tbInfo->hlInfo) {
255 /* This is a hard link */ 253 /* This is a hard link */