[NTOSKRNL]
authorAleksandar Andrejevic <aandrejevic@reactos.org>
Sat, 31 May 2014 01:17:00 +0000 (01:17 +0000)
committerAleksandar Andrejevic <aandrejevic@reactos.org>
Sat, 31 May 2014 01:17:00 +0000 (01:17 +0000)
Don't allow saving keys which are located directly in the master hive.

svn path=/trunk/; revision=63508

reactos/ntoskrnl/config/cmapi.c

index e52f572..a75f028 100644 (file)
@@ -2307,6 +2307,13 @@ CmSaveKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
         goto Cleanup;
     }
 
         goto Cleanup;
     }
 
+    if (Kcb->KeyHive == &CmiVolatileHive->Hive)
+    {
+        /* Keys that are directly in the master hive can't be saved */
+        Status = STATUS_ACCESS_DENIED;
+        goto Cleanup;
+    }
+
     /* Create a new hive that will hold the key */
     Status = CmpInitializeHive(&KeyHive,
                                HINIT_CREATE,
     /* Create a new hive that will hold the key */
     Status = CmpInitializeHive(&KeyHive,
                                HINIT_CREATE,