Fixed a bug where tar would not set the user and group on device

special files.
 -Erik
This commit is contained in:
Erik Andersen
1999-12-28 00:17:46 +00:00
parent 69ba6b2956
commit 00266d3df6
3 changed files with 17 additions and 21 deletions

View File

@@ -577,17 +577,15 @@ readHeader (const TarHeader * hp, int fileCount, char **fileTable)
} else {
outFd = open (name, O_WRONLY | O_CREAT | O_TRUNC, mode);
}
if (outFd < 0) {
perror (name);
skipFileFlag = TRUE;
return;
}
chown(name, uid, gid);
chmod(name, mode);
}
if (outFd < 0) {
perror (name);
skipFileFlag = TRUE;
return;
}
if (tostdoutFlag == FALSE) {
fchown(outFd, uid, gid);
fchmod(outFd, mode);
}
/*
* If the file is empty, then that's all we need to do.