VirtualBox

Ignore:
Timestamp:
Feb 26, 2024 5:54:50 PM (9 months ago)
Author:
vboxsync
Message:

IPRT/process-creation-posix: Try hardcoded paths for macOS if loading the PAM .so files fail if SIP is enabled when authenticating via rtProcPosixAuthenticateUsingPam(). This commits patch v1 of bugref:9946

File:
1 edited

Legend:

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

    r99483 r103581  
    327327                                   &hModPam);
    328328# endif
     329# ifdef RT_OS_DARWIN
     330        /* Try absolute paths on Darwin (if SIP is enabled). */
     331        if (RT_FAILURE(rc))
     332        {
     333#  define MAKE_ABSOLUTE(a_Lib) "/usr/lib" # a_Lib
     334            rc = RTLdrLoadEx(pszLast = MAKE_ABSOLUTE(IPRT_LIBPAM_FILE_1), &hModPam, RTLDRLOAD_FLAGS_GLOBAL | RTLDRLOAD_FLAGS_NO_UNLOAD
     335                             | RTLDRLOAD_FLAGS_SO_VER_RANGE(IPRT_LIBPAM_FILE_1_FIRST_VER, IPRT_LIBPAM_FILE_1_END_VER),
     336                             NULL);
     337#  ifdef IPRT_LIBPAM_FILE_2
     338            if (RT_FAILURE(rc))
     339                rc = RTLdrLoadEx(pszLast = MAKE_ABSOLUTE(IPRT_LIBPAM_FILE_2), &hModPam, RTLDRLOAD_FLAGS_GLOBAL | RTLDRLOAD_FLAGS_NO_UNLOAD
     340                                 | RTLDRLOAD_FLAGS_SO_VER_RANGE(IPRT_LIBPAM_FILE_2_FIRST_VER, IPRT_LIBPAM_FILE_2_END_VER),
     341                                 NULL);
     342#  endif
     343#  ifdef IPRT_LIBPAM_FILE_3
     344            if (RT_FAILURE(rc))
     345                rc = RTLdrLoadEx(pszLast = MAKE_ABSOLUTE(IPRT_LIBPAM_FILE_3), &hModPam, RTLDRLOAD_FLAGS_GLOBAL | RTLDRLOAD_FLAGS_NO_UNLOAD
     346                                 | RTLDRLOAD_FLAGS_SO_VER_RANGE(IPRT_LIBPAM_FILE_3_FIRST_VER, IPRT_LIBPAM_FILE_3_END_VER),
     347                                 NULL);
     348#  endif
     349#  undef MAKE_ABSOLUTE
     350        }
     351# endif /* RT_OS_DARWIN */
     352
    329353        if (RT_FAILURE(rc))
    330354        {
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