VirtualBox

Changeset 23139 in vbox


Ignore:
Timestamp:
Sep 18, 2009 3:15:58 PM (15 years ago)
Author:
vboxsync
Message:

VBoxService/win: Fixed SCM hang if VBoxMiniRdrDN object is not found (e.g. Shared Folders not installed).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxService-win.cpp

    r22728 r23139  
    6767    /* Get a pointer to the existing DACL. */
    6868    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);
    7377        goto Cleanup;
    7478    }
     
    8488    /* Create a new ACL that merges the new ACE into the existing DACL. */
    8589    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);
    8893        goto Cleanup;
    8994    }
     
    9196    /* Attach the new ACL as the object's DACL. */
    9297    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);
    97103        goto Cleanup;
    98104    }
    99105
     106    /** @todo get rid of that spaghetti jump ... */
    100107Cleanup:
    101108
     
    234241                                                                       SET_ACCESS,
    235242                                                                       NO_INHERITANCE);
    236         if (dwRes != 0)
     243        if (dwRes != ERROR_SUCCESS)
    237244        {
    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);
    239253        }
    240254    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette