From: Eric Biggers Date: Fri, 16 Aug 2013 00:23:37 +0000 (-0500) Subject: apply_operations: Remove 'strict' argument from set_security_descriptor() X-Git-Tag: v1.5.0~68 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=d1301021c8edf915004faf291f31e4c99b0bcfde apply_operations: Remove 'strict' argument from set_security_descriptor() --- diff --git a/include/wimlib/apply.h b/include/wimlib/apply.h index 5063f805..a7fe179a 100644 --- a/include/wimlib/apply.h +++ b/include/wimlib/apply.h @@ -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. */ diff --git a/src/extract.c b/src/extract.c index 51684f0e..446b5555 100644 --- a/src/extract.c +++ b/src/extract.c @@ -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 " diff --git a/src/ntfs-3g_apply.c b/src/ntfs-3g_apply.c index b8aabe86..fe2f24e2 100644 --- a/src/ntfs-3g_apply.c +++ b/src/ntfs-3g_apply.c @@ -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; diff --git a/src/win32_apply.c b/src/win32_apply.c index b59f7a8a..bce897a4 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -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;