}
uint64_t capabilities;
if (fs_config_func != NULL) {
-#ifdef ANDROID
unsigned int mode = 0;
unsigned int uid = 0;
unsigned int gid = 0;
int dir = S_ISDIR(stat.st_mode);
- fs_config_func(dentries[i].path, dir, &uid, &gid, &mode, &capabilities);
- dentries[i].mode = mode;
- dentries[i].uid = uid;
- dentries[i].gid = gid;
- dentries[i].capabilities = capabilities;
-#else
- error("can't set android permissions - built without android support");
-#endif
+ if (fs_config_func(dentries[i].path, dir, &uid, &gid, &mode, &capabilities)) {
+ dentries[i].mode = mode;
+ dentries[i].uid = uid;
+ dentries[i].gid = gid;
+ dentries[i].capabilities = capabilities;
+ }
}
if (S_ISREG(stat.st_mode)) {
if (ret)
error("failed to set permissions on %s\n", dentries[i].path);
- /*
- * It's important to call inode_set_selinux() before
- * inode_set_capabilities(). Extended attributes need to
- * be stored sorted order, and we guarantee this by making
- * the calls in the proper order.
- * Please see xattr_assert_sane() in contents.c
- */
- ret = inode_set_selinux(entry_inode, dentries[i].secon);
- if (ret)
- error("failed to set SELinux context on %s\n", dentries[i].path);
ret = inode_set_capabilities(entry_inode, dentries[i].capabilities);
if (ret)
error("failed to set capability on %s\n", dentries[i].path);
free(dentries[i].full_path);
free(dentries[i].link);
free((void *)dentries[i].filename);
- free(dentries[i].secon);
}
free(dentries);