Changeset 23139 in vbox
- Timestamp:
- Sep 18, 2009 3:15:58 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxService-win.cpp
r22728 r23139 67 67 /* Get a pointer to the existing DACL. */ 68 68 dwRes = GetNamedSecurityInfo(pszObjName, ObjectType, 69 DACL_SECURITY_INFORMATION, 70 NULL, NULL, &pOldDACL, NULL, &pSD); 71 if (ERROR_SUCCESS != dwRes) { 72 VBoxServiceError("GetNamedSecurityInfo: Error %u\n", dwRes); 69 DACL_SECURITY_INFORMATION, 70 NULL, NULL, &pOldDACL, NULL, &pSD); 71 if (ERROR_SUCCESS != dwRes) 72 { 73 if (dwRes == ERROR_FILE_NOT_FOUND) 74 VBoxServiceError("AddAceToObjectsSecurityDescriptor: Object not found/installed: %s\n", pszObjName); 75 else 76 VBoxServiceError("AddAceToObjectsSecurityDescriptor: GetNamedSecurityInfo: Error %u\n", dwRes); 73 77 goto Cleanup; 74 78 } … … 84 88 /* Create a new ACL that merges the new ACE into the existing DACL. */ 85 89 dwRes = SetEntriesInAcl(1, &ea, pOldDACL, &pNewDACL); 86 if (ERROR_SUCCESS != dwRes) { 87 VBoxServiceError("SetEntriesInAcl: Error %u\n", dwRes); 90 if (ERROR_SUCCESS != dwRes) 91 { 92 VBoxServiceError("AddAceToObjectsSecurityDescriptor: SetEntriesInAcl: Error %u\n", dwRes); 88 93 goto Cleanup; 89 94 } … … 91 96 /* Attach the new ACL as the object's DACL. */ 92 97 dwRes = SetNamedSecurityInfo(pszObjName, ObjectType, 93 DACL_SECURITY_INFORMATION, 94 NULL, NULL, pNewDACL, NULL); 95 if (ERROR_SUCCESS != dwRes) { 96 VBoxServiceError("SetNamedSecurityInfo: Error %u\n", dwRes); 98 DACL_SECURITY_INFORMATION, 99 NULL, NULL, pNewDACL, NULL); 100 if (ERROR_SUCCESS != dwRes) 101 { 102 VBoxServiceError("AddAceToObjectsSecurityDescriptor: SetNamedSecurityInfo: Error %u\n", dwRes); 97 103 goto Cleanup; 98 104 } 99 105 106 /** @todo get rid of that spaghetti jump ... */ 100 107 Cleanup: 101 108 … … 234 241 SET_ACCESS, 235 242 NO_INHERITANCE); 236 if (dwRes != 0)243 if (dwRes != ERROR_SUCCESS) 237 244 { 238 rc = VERR_ACCESS_DENIED; /* Need to add some better code later. */ 245 if (dwRes == ERROR_FILE_NOT_FOUND) 246 { 247 /* If we don't find our "VBoxMiniRdrDN" (for Shared Folders) object above, 248 don't report an error; it just might be not installed. Otherwise this 249 would cause the SCM to hang on starting up the service. */ 250 rc = VINF_SUCCESS; 251 } 252 else rc = RTErrConvertFromWin32(dwRes); 239 253 } 240 254 }
Note:
See TracChangeset
for help on using the changeset viewer.