Windows: do not request KEY_WRITE privilege if not required
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 3 Jun 2010 15:47:46 +0000 (11:47 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Thu, 3 Jun 2010 22:57:35 +0000 (15:57 -0700)
When querying the registry cellservdb info the KEY_WRITE privilege
is not required, therefore do not request it.

LICENSE MIT

Change-Id: I050717be3afb5df979897ffbef65987160a65149
Reviewed-on: http://gerrit.openafs.org/2075
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/cm_config.c

index ee6fc20..0d61843 100644 (file)
@@ -408,14 +408,14 @@ long cm_SearchCellRegistry(afs_uint32 client,
     if (RegOpenKeyEx( HKEY_LOCAL_MACHINE,
                       AFSREG_CLT_OPENAFS_SUBKEY "\\CellServDB",
                       0,
-                      KEY_READ|KEY_WRITE|KEY_QUERY_VALUE,
+                      KEY_READ|KEY_QUERY_VALUE,
                       &hkCellServDB) != ERROR_SUCCESS)
         return CM_ERROR_NOSUCHCELL;
 
     if (RegOpenKeyEx( hkCellServDB, 
                       cellNamep,
                       0,
-                      KEY_READ|KEY_WRITE|KEY_QUERY_VALUE,
+                      KEY_READ|KEY_QUERY_VALUE,
                       &hkCellName) != ERROR_SUCCESS) {
         BOOL bFound = 0;
 
@@ -465,7 +465,7 @@ long cm_SearchCellRegistry(afs_uint32 client,
             if (RegOpenKeyEx( hkCellServDB, 
                               szCellName,
                               0,
-                              KEY_READ|KEY_WRITE|KEY_QUERY_VALUE,
+                              KEY_READ|KEY_QUERY_VALUE,
                               &hkCellName) != ERROR_SUCCESS)
                 continue;
 
@@ -540,7 +540,7 @@ long cm_SearchCellRegistry(afs_uint32 client,
         if (RegOpenKeyEx( hkCellName, 
                           szServerName,
                           0,
-                          KEY_READ|KEY_WRITE|KEY_QUERY_VALUE,
+                          KEY_READ|KEY_QUERY_VALUE,
                           &hkServerName) != ERROR_SUCCESS)
             continue;