win32_common.c: don't short-circuit when acquiring privileges
authorEric Biggers <ebiggers3@gmail.com>
Tue, 18 Aug 2015 23:02:39 +0000 (18:02 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 18 Aug 2015 23:17:15 +0000 (18:17 -0500)
src/win32_common.c

index 79dac96e68e669de6689b1ce85e84c30490184d9..aa5be3778adb9b7b3afaa74ee6481271a658f3c1 100644 (file)
@@ -62,17 +62,21 @@ out:
 static bool
 win32_modify_capture_privileges(bool enable)
 {
-       return win32_modify_privilege(SE_BACKUP_NAME, enable)
-           && win32_modify_privilege(SE_SECURITY_NAME, enable);
+       bool ok = true;
+       ok &= win32_modify_privilege(SE_BACKUP_NAME, enable);
+       ok &= win32_modify_privilege(SE_SECURITY_NAME, enable);
+       return ok;
 }
 
 static bool
 win32_modify_apply_privileges(bool enable)
 {
-       return win32_modify_privilege(SE_RESTORE_NAME, enable)
-           && win32_modify_privilege(SE_SECURITY_NAME, enable)
-           && win32_modify_privilege(SE_TAKE_OWNERSHIP_NAME, enable)
-           && win32_modify_privilege(SE_MANAGE_VOLUME_NAME, enable);
+       bool ok = true;
+       ok &= win32_modify_privilege(SE_RESTORE_NAME, enable);
+       ok &= win32_modify_privilege(SE_SECURITY_NAME, enable);
+       ok &= win32_modify_privilege(SE_TAKE_OWNERSHIP_NAME, enable);
+       ok &= win32_modify_privilege(SE_MANAGE_VOLUME_NAME, enable);
+       return ok;
 }
 
 static void