diff options
Diffstat (limited to 'tar.c')
-rw-r--r-- | tar.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -520,8 +520,8 @@ readHeader (const TarHeader * hp, int fileCount, char **fileTable) | |||
520 | if (hardLink) { | 520 | if (hardLink) { |
521 | if (link (hp->linkName, name) < 0) | 521 | if (link (hp->linkName, name) < 0) |
522 | perror (name); | 522 | perror (name); |
523 | chmod(name, mode); | ||
524 | chown(name, uid, gid); | 523 | chown(name, uid, gid); |
524 | chmod(name, mode); | ||
525 | return; | 525 | return; |
526 | } | 526 | } |
527 | 527 | ||
@@ -529,8 +529,8 @@ readHeader (const TarHeader * hp, int fileCount, char **fileTable) | |||
529 | #ifdef S_ISLNK | 529 | #ifdef S_ISLNK |
530 | if (symlink (hp->linkName, name) < 0) | 530 | if (symlink (hp->linkName, name) < 0) |
531 | perror (name); | 531 | perror (name); |
532 | chmod(name, mode); | ||
533 | chown(name, uid, gid); | 532 | chown(name, uid, gid); |
533 | chmod(name, mode); | ||
534 | #else | 534 | #else |
535 | fprintf (stderr, "Cannot create symbolic links\n"); | 535 | fprintf (stderr, "Cannot create symbolic links\n"); |
536 | #endif | 536 | #endif |
@@ -546,8 +546,8 @@ readHeader (const TarHeader * hp, int fileCount, char **fileTable) | |||
546 | */ | 546 | */ |
547 | if (S_ISDIR (mode)) { | 547 | if (S_ISDIR (mode)) { |
548 | createPath (name, mode); | 548 | createPath (name, mode); |
549 | chmod(name, mode); | ||
550 | chown(name, uid, gid); | 549 | chown(name, uid, gid); |
550 | chmod(name, mode); | ||
551 | 551 | ||
552 | return; | 552 | return; |
553 | } | 553 | } |
@@ -585,8 +585,8 @@ readHeader (const TarHeader * hp, int fileCount, char **fileTable) | |||
585 | return; | 585 | return; |
586 | } | 586 | } |
587 | if (tostdoutFlag == FALSE) { | 587 | if (tostdoutFlag == FALSE) { |
588 | fchmod(outFd, mode); | ||
589 | fchown(outFd, uid, gid); | 588 | fchown(outFd, uid, gid); |
589 | fchmod(outFd, mode); | ||
590 | } | 590 | } |
591 | 591 | ||
592 | /* | 592 | /* |