apply_operations: Remove 'strict' argument from set_security_descriptor()
authorEric Biggers <ebiggers3@gmail.com>
Fri, 16 Aug 2013 00:23:37 +0000 (19:23 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 16 Aug 2013 00:23:37 +0000 (19:23 -0500)
include/wimlib/apply.h
src/extract.c
src/ntfs-3g_apply.c
src/win32_apply.c

index 5063f80..a7fe179 100644 (file)
@@ -100,7 +100,7 @@ struct apply_operations {
         * set ctx->supported_features.security_descriptors if supported.  */
        int (*set_security_descriptor)
                (const tchar *path, const u8 *desc, size_t desc_size,
-                struct apply_ctx *ctx, bool strict);
+                struct apply_ctx *ctx);
 
        /* OPTIONAL:  Set wimlib-specific UNIX data.  In start_extract(), set
         * ctx->supported_features.unix_data if supported.  */
index 51684f0..446b555 100644 (file)
@@ -740,9 +740,7 @@ extract_security(const tchar *path, struct apply_ctx *ctx,
                desc_size = sd->sizes[inode->i_security_id];
 
                ret = ctx->ops->set_security_descriptor(path, desc,
-                                                       desc_size, ctx,
-                                                       !!(ctx->extract_flags &
-                                                          WIMLIB_EXTRACT_FLAG_STRICT_ACLS));
+                                                       desc_size, ctx);
                if (ret) {
                        if (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_ACLS) {
                                ERROR_WITH_ERRNO("Failed to set security "
index b8aabe8..fe2f24e 100644 (file)
@@ -366,7 +366,7 @@ out:
 
 static int
 ntfs_3g_set_security_descriptor(const char *path, const u8 *desc, size_t desc_size,
-                               struct apply_ctx *ctx, bool strict)
+                               struct apply_ctx *ctx)
 {
        ntfs_volume *vol;
        ntfs_inode *ni;
index b59f7a8..bce897a 100644 (file)
@@ -422,7 +422,7 @@ error:
 
 static int
 win32_set_security_descriptor(const wchar_t *path, const u8 *desc, size_t desc_size,
-                             struct apply_ctx *ctx, bool strict)
+                             struct apply_ctx *ctx)
 {
        SECURITY_INFORMATION info;
 
@@ -432,7 +432,8 @@ win32_set_security_descriptor(const wchar_t *path, const u8 *desc, size_t desc_s
                SACL_SECURITY_INFORMATION;
 retry:
        if (!SetFileSecurity(path, info, (PSECURITY_DESCRIPTOR)desc)) {
-               if (!strict && GetLastError() == ERROR_PRIVILEGE_NOT_HELD &&
+               if (!(ctx->extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_ACLS) &&
+                   GetLastError() == ERROR_PRIVILEGE_NOT_HELD &&
                    (info & SACL_SECURITY_INFORMATION))
                {
                        info &= ~SACL_SECURITY_INFORMATION;