]> Zhao Yanbai Git Server - minix.git/commitdiff
Stopgap for tar creating insane group ownerships due to tiny gid_t.
authorBen Gras <ben@minix3.org>
Tue, 27 Jun 2006 16:30:46 +0000 (16:30 +0000)
committerBen Gras <ben@minix3.org>
Tue, 27 Jun 2006 16:30:46 +0000 (16:30 +0000)
commands/simple/tar.c

index 53c68042bc11af1bc5f192d7aeec420d38e59c09..0ee04744400365c4c83e94fe62b85270f9963097 100755 (executable)
@@ -551,6 +551,7 @@ char *file;
        }
        if (uid == -1) uid = (int) convert(header.member.m_uid, INT_TYPE);
        if (gid == -1) gid = (int) convert(header.member.m_gid, INT_TYPE);
+       if((gid_t)gid < 0) gid = 0;
        chown(file, uid, gid);
   }
   chmod(file, u_mask & (int) convert(header.member.m_mode, INT_TYPE));