Menu

#277 WindowsCommon::init maybe not right?

Version 5.10
closed-fixed
nobody
None
5
2015-03-12
2015-03-12
unicode
No

For WindowsCommon.cpp, WindowsComman::init function:

...
if (nas)
throw Exception("Couldn't get domain join info: NetGetJoinInformation: " +
GetErrorMessage(nas));

if (njs == NetSetupDomainName) {
    globals::domainName = joinInfo;
    NetApiBufferFree(joinInfo);
} else if (njs == NetSetupWorkgroupName)
    // don't care about workgroups!
    NetApiBufferFree(joinInfo);

// stop here if not joined to a domain.
if (njs != NetSetupDomainName)  //LINE 203
    return;

// Get domain SID
globals::domainSID = GetSIDForTrusteeNameW(globals::domainName);
if (!globals::domainSID)
    // can this actually happen?
    throw Exception("Couldn't find SID for domain name: " +
    UnicodeToAsciiString(globals::domainName));

// disable rollback, since we finished successfully
errorRollback.success();

...

FOR LINE 203
maybe, it should be:

    if (njs != NetSetupDomainName){  //LINE 203
            errorRollback.success();
    return;
    }

Thought not joined in domain, but it should return with success, else, the "uninit" function should be called, and the compterSID should be released and set to NULL *

Discussion

  • Michael Chisholm

    Fixed in r1803

     
  • Michael Chisholm

    • status: open --> closed-fixed
     

Log in to post a comment.