summaryrefslogtreecommitdiff
path: root/tar.c
diff options
context:
space:
mode:
authorErik Andersen1999-12-28 00:17:46 +0000
committerErik Andersen1999-12-28 00:17:46 +0000
commit00266d3df6ba8dcc6247f112372a0ce5a8ab2c32 (patch)
treeca61fc301d4f1ee06b0a03bd352b672360b88eda /tar.c
parent69ba6b2956202728a3da3489caa383fa6e7b114f (diff)
downloadbusybox-00266d3df6ba8dcc6247f112372a0ce5a8ab2c32.zip
busybox-00266d3df6ba8dcc6247f112372a0ce5a8ab2c32.tar.gz
Fixed a bug where tar would not set the user and group on device
special files. -Erik
Diffstat (limited to 'tar.c')
-rw-r--r--tar.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/tar.c b/tar.c
index bff2482..7167d95 100644
--- a/tar.c
+++ b/tar.c
@@ -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.