[UDFS] Correctly check SeSinglePrivilegeCheck() return value
authorSerge Gautherie <reactos-git_serge_171003@gautherie.fr>
Wed, 30 Jan 2019 00:54:42 +0000 (01:54 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 10 Feb 2019 09:16:55 +0000 (10:16 +0100)
SeSinglePrivilegeCheck() returns a BOOLEAN, not a NTSTATUS.

CORE-14271

drivers/filesystems/udfs/create.cpp

index e841a04..75f209f 100644 (file)
@@ -742,9 +742,9 @@ op_vol_accs_dnd:
 
         // we should check appropriate privilege if OpenForBackup requested
         if(OpenForBackup) {
 
         // we should check appropriate privilege if OpenForBackup requested
         if(OpenForBackup) {
-            RC = SeSinglePrivilegeCheck(SeExports->SeBackupPrivilege, UserMode);
-            if(!NT_SUCCESS(RC))
-                try_return(RC);
+            if (!SeSinglePrivilegeCheck(SeExports->SeBackupPrivilege, UserMode)) {
+                try_return(RC = STATUS_PRIVILEGE_NOT_HELD);
+            }
         }
 
         // The FSD might wish to implement the open-by-id option. The "id"
         }
 
         // The FSD might wish to implement the open-by-id option. The "id"