Pass the pointy hat, please: Don't blow away the high-order

mode bits when setting permissions from ACL data.
Thanks to: David Gilbert for first reporting this and
    Jimmy Olgeni for noticing that it only occurred on
    ACL-enabled filesystems.
This commit is contained in:
Tim Kientzle 2004-08-07 02:50:05 +00:00
parent af062c24e6
commit 501fe26500

View File

@ -732,15 +732,15 @@ acl_special(struct archive_entry *entry, int type, int permset, int tag)
if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) {
switch (tag) {
case ARCHIVE_ENTRY_ACL_USER_OBJ:
entry->ae_stat.st_mode &= 0077;
entry->ae_stat.st_mode &= ~0700;
entry->ae_stat.st_mode |= (permset & 7) << 6;
return (0);
case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
entry->ae_stat.st_mode &= 0707;
entry->ae_stat.st_mode &= ~0070;
entry->ae_stat.st_mode |= (permset & 7) << 3;
return (0);
case ARCHIVE_ENTRY_ACL_OTHER:
entry->ae_stat.st_mode &= 0770;
entry->ae_stat.st_mode &= ~0007;
entry->ae_stat.st_mode |= permset & 7;
return (0);
}