Windows: registry enum do not request write perm
authorJeffrey Altman <jaltman@your-file-system.com>
Sun, 15 Jun 2014 02:58:52 +0000 (22:58 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 21 Aug 2014 03:49:25 +0000 (23:49 -0400)
Only Read and Query privileges are required to enumerate the registry
keys, do not request write privileges for an enumeration.

Change-Id: Ifc9acb4203db71b6e94bf5a21ca5aa104d94d35b
Reviewed-on: http://gerrit.openafs.org/11416
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsd/cm_config.c

index 41cec8d..b071d6e 100644 (file)
@@ -840,15 +840,16 @@ long cm_EnumerateCellRegistry(afs_uint32 client, cm_enumCellProc_t *procp, void
     LONG code;
     FILETIME ftLastWriteTime;
     char szCellName[CELL_MAXNAMELEN];
+       char * subkey = AFSREG_CLT_OPENAFS_SUBKEY "\\CellServDB";
 
     /* No server CellServDB in the registry. */
     if (!client || procp == NULL)
         return 0;
 
     if (RegOpenKeyEx( HKEY_LOCAL_MACHINE,
-                      AFSREG_CLT_OPENAFS_SUBKEY "\\CellServDB",
+                     subkey,
                       0,
-                      KEY_READ|KEY_WRITE|KEY_QUERY_VALUE,
+                     KEY_READ|KEY_QUERY_VALUE,
                       &hkCellServDB) != ERROR_SUCCESS)
         return 0;