VirtualBox

Changeset 92761 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 6, 2021 10:40:16 AM (3 years ago)
Author:
vboxsync
Message:

IPRT/RTProcCreateEx/posix: Use 'ASCII' instead of 'C' as the default child codeset, iconv_open doesn't grok 'C' and fails. The dynamic loading of libpam must take shared object versioning into account and not expect the dev library libpam.so to be installed, so use RTLdr for loading it and keep it loaded. Ubuntu needs the session to be opened before we get any locale enviornment bits, so do pam_open_session too. [build fix, logging] bugref:10153

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/process-creation-posix.cpp

    r92758 r92761  
    315315        }
    316316
    317         *(PFNRT *)&s_pfnPamStart        = RTLdrGetFunction(hModPam, "pam_start");
    318         *(PFNRT *)&s_pfnPamAuthenticate = RTLdrGetFunction(hModPam, "pam_authenticate");
    319         *(PFNRT *)&s_pfnPamAcctMgmt     = RTLdrGetFunction(hModPam, "pam_acct_mgmt");
    320         *(PFNRT *)&s_pfnPamSetItem      = RTLdrGetFunction(hModPam, "pam_set_item");
    321         *(PFNRT *)&s_pfnPamSetCred      = RTLdrGetFunction(hModPam, "pam_setcred");
    322         *(PFNRT *)&s_pfnPamGetEnvList   = RTLdrGetFunction(hModPam, "pam_getenvlist");
    323         *(PFNRT *)&s_pfnPamOpenSession  = RTLdrGetFunction(hModPam, "pam_open_session");
    324         *(PFNRT *)&s_pfnPamCloseSession = RTLdrGetFunction(hModPam, "pam_close_session");
    325         *(PFNRT *)&s_pfnPamEnd          = RTLdrGetFunction(hModPam, "pam_end");
     317        *(uintptr_t *)&s_pfnPamStart        = (uintptr_t)RTLdrGetFunction(hModPam, "pam_start");
     318        *(uintptr_t *)&s_pfnPamAuthenticate = (uintptr_t)RTLdrGetFunction(hModPam, "pam_authenticate");
     319        *(uintptr_t *)&s_pfnPamAcctMgmt     = (uintptr_t)RTLdrGetFunction(hModPam, "pam_acct_mgmt");
     320        *(uintptr_t *)&s_pfnPamSetItem      = (uintptr_t)RTLdrGetFunction(hModPam, "pam_set_item");
     321        *(uintptr_t *)&s_pfnPamSetCred      = (uintptr_t)RTLdrGetFunction(hModPam, "pam_setcred");
     322        *(uintptr_t *)&s_pfnPamGetEnvList   = (uintptr_t)RTLdrGetFunction(hModPam, "pam_getenvlist");
     323        *(uintptr_t *)&s_pfnPamOpenSession  = (uintptr_t)RTLdrGetFunction(hModPam, "pam_open_session");
     324        *(uintptr_t *)&s_pfnPamCloseSession = (uintptr_t)RTLdrGetFunction(hModPam, "pam_close_session");
     325        *(uintptr_t *)&s_pfnPamEnd          = (uintptr_t)RTLdrGetFunction(hModPam, "pam_end");
     326        ASMCompilerBarrier();
    326327
    327328        RTLdrClose(hModPam);
    328329
    329         ASMCompilerBarrier();
    330330        if (   s_pfnPamStart == NULL
    331331            || s_pfnPamAuthenticate == NULL
     
    21102110            }
    21112111            else
    2112                 RTAssertMsg2Weak("execve returns %d errno=%d\n", rc, errno);
     2112                RTAssertMsg2Weak("execve returns %d errno=%d (%s)\n", rc, errno, pszNativeExec);
    21132113            RTAssertReleasePanic();
    21142114            if (fFlags & RTPROC_FLAGS_DETACHED)
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