return root_inode;
}
-#ifndef USE_MINGW
/* Read a local directory and create the same tree in the generated filesystem.
Calls itself recursively with each directory in the given directory.
full_path is an absolute or relative path, with a trailing slash, to the
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;
+ 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);
return inode;
}
-#endif
static u32 compute_block_size()
{
if (info.feat_compat & EXT4_FEATURE_COMPAT_RESIZE_INODE)
ext4_create_resize_inode();
-#ifdef USE_MINGW
- // Windows needs only 'create an empty fs image' functionality
- assert(!directory);
- root_inode_num = build_default_directory_structure(mountpoint);
-#else
if (directory)
root_inode_num = build_directory_structure(directory, mountpoint, 0,
fs_config_func, verbose, fixed_time);
else
root_inode_num = build_default_directory_structure(mountpoint);
-#endif
root_mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
inode_set_permissions(root_inode_num, root_mode, 0, 0, 0);