- dentry->security_id = sd_set_add_sd(sd_set, sd, sd_size);
- if (dentry->security_id == -1) {
- ERROR("Could not allocate security ID");
- ret = WIMLIB_ERR_NOMEM;
+ if (ret == 0) {
+ ERROR_WITH_ERRNO("Failed to get security information from "
+ "`%s'", path);
+ ret = WIMLIB_ERR_NTFS_3G;
+ } else {
+ if (ret > 0) {
+ /*print_security_descriptor(sd, sd_size);*/
+ root->security_id = sd_set_add_sd(sd_set, sd, sd_size);
+ DEBUG("Added security ID = %u for `%s'",
+ root->security_id, path);
+ } else {
+ root->security_id = -1;
+ DEBUG("No security ID for `%s'", path);
+ }
+ ret = 0;