]> wimlib.net Git - wimlib/commitdiff
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 5063f805db282c385e8c3a19fd72e66c163612dd..a7fe179ac6de50301d0961d77c6d70a4e902f757 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 51684f0e2b9c3249fc4865516eac1748e757e114..446b55551b29337b6e2d5fdd08e027b58fa2162b 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 b8aabe866e3c2f68d9fc284553e7d89c4065c9fa..fe2f24e23252bcaa3f2914e104d6ac5b8fe105f4 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 b59f7a8a0b6d795b273150e2cfe0ad3fc70f4da4..bce897a46344860ed42ce0b82b6ef086140b81c9 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;