X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fextract_image.c;h=8e5d130ec07df2b152114ffc3f8c6db1a966dc41;hp=6fb944272d65634e7d1c8e2c9eda6132901300d0;hb=655c1ad6412165c62a9489a44161b62b93489838;hpb=ad37dd86e75416ffc47c97b35f097012be5eeaa2 diff --git a/src/extract_image.c b/src/extract_image.c index 6fb94427..8e5d130e 100644 --- a/src/extract_image.c +++ b/src/extract_image.c @@ -775,7 +775,6 @@ static int apply_dentry_timestamps_normal(struct wim_dentry *dentry, void *arg) size_t utf16_path_len; DWORD err; HANDLE h; - BOOL bret1, bret2; ret = utf8_to_utf16(output_path, len, &utf16_path, &utf16_path_len); if (ret) @@ -1319,6 +1318,11 @@ WIMLIBAPI int wimlib_extract_image(WIMStruct *w, w->lookup_table = joined_tab; } +#if defined(__CYGWIN__) || defined(__WIN32__) + win32_acquire_privilege(SE_RESTORE_NAME); + win32_acquire_privilege(SE_SECURITY_NAME); + win32_acquire_privilege(SE_TAKE_OWNERSHIP_NAME); +#endif if (image == WIMLIB_ALL_IMAGES) { extract_flags |= WIMLIB_EXTRACT_FLAG_MULTI_IMAGE; ret = extract_all_images(w, target, extract_flags, @@ -1328,6 +1332,11 @@ WIMLIBAPI int wimlib_extract_image(WIMStruct *w, ret = extract_single_image(w, image, target, extract_flags, progress_func); } +#if defined(__CYGWIN__) || defined(__WIN32__) + win32_release_privilege(SE_RESTORE_NAME); + win32_release_privilege(SE_SECURITY_NAME); + win32_release_privilege(SE_TAKE_OWNERSHIP_NAME); +#endif if (extract_flags & (WIMLIB_EXTRACT_FLAG_SYMLINK | WIMLIB_EXTRACT_FLAG_HARDLINK))