VirtualBox

Changeset 39880 in vbox for trunk


Ignore:
Timestamp:
Jan 25, 2012 5:26:55 PM (13 years ago)
Author:
vboxsync
Message:

pam_vbox: Don't try to retrieve credentials twice, logging adjustments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/pam/pam_vbox.cpp

    r39741 r39880  
    5555#endif
    5656
    57 #define VBOX_MODULE_NAME "pam_vbox"
     57#define VBOX_MODULE_NAME                    "pam_vbox"
     58
     59#define VBOX_PAM_FLAG_SILENT                "PAM_SILENT"
     60#define VBOX_PAM_FLAG_DISALLOW_NULL_AUTHTOK "PAM_DISALLOW_NULL_AUTHTOK"
     61#define VBOX_PAM_FLAG_ESTABLISH_CRED        "PAM_ESTABLISH_CRED"
     62#define VBOX_PAM_FLAG_DELETE_CRED           "PAM_DELETE_CRED"
     63#define VBOX_PAM_FLAG_REINITIALIZE_CRED     "PAM_REINITIALIZE_CRED"
     64#define VBOX_PAM_FLAG_REFRESH_CRED          "PAM_REFRESH_CRED"
    5865
    5966RT_C_DECLS_BEGIN
     
    676683    int rc = RTThreadCreate(&threadWait, pam_vbox_wait_thread,
    677684                            (void *)&threadData, 0,
    678                             RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "pam_vbox");
     685                            RTTHREADTYPE_DEFAULT, NULL /* Non-waitable */, "pam_vbox");
    679686    if (RT_SUCCESS(rc))
    680687    {
     
    703710            g_verbosity = 1;
    704711        else
    705             pam_vbox_error(hPAM, "pam_sm_authenticate: unknown command line argument \"%s\"\n", argv[i]);
     712            pam_vbox_error(hPAM, "pam_vbox_authenticate: unknown command line argument \"%s\"\n", argv[i]);
    706713    }
    707714    pam_vbox_log(hPAM, "pam_vbox_authenticate called\n");
     
    737744                if (!uTimeoutMS)
    738745                {
    739                     pam_vbox_error(hPAM, "pam_sm_authenticate: invalid waiting timeout value specified, defaulting to infinite timeout\n");
     746                    pam_vbox_error(hPAM, "pam_vbox_authenticate: invalid waiting timeout value specified, defaulting to infinite timeout\n");
    740747                    uTimeoutMS = RT_INDEFINITE_WAIT;
    741748                }
     
    755762                               pszWaitMsg ? pszWaitMsg : "Waiting for credentials ...");
    756763            if (RT_FAILURE(rc2)) /* Not critical. */
    757                 pam_vbox_error(hPAM, "pam_sm_authenticate: error setting waiting information message, rc=%Rrc\n", rc2);
     764                pam_vbox_error(hPAM, "pam_vbox_authenticate: error setting waiting information message, rc=%Rrc\n", rc2);
    758765
    759766            if (RT_SUCCESS(rc))
     
    765772                {
    766773                    rc = pam_vbox_wait_for_creds(hPAM, uClientId, uTimeoutMS);
    767                     if (RT_SUCCESS(rc))
     774                    if (rc == VERR_TIMEOUT)
    768775                    {
    769                         /* Waiting for credentials succeeded, try getting those ... */
    770                         rc = pam_vbox_check_creds(hPAM);
    771                         if (RT_FAILURE(rc))
    772                             pam_vbox_error(hPAM, "pam_sm_authenticate: no credentials given, even when waited for it, rc=%Rrc\n", rc);
    773                     }
    774                     else if (rc == VERR_TIMEOUT)
    775                     {
    776                         pam_vbox_log(hPAM, "pam_sm_authenticate: no credentials given within time\n");
     776                        pam_vbox_log(hPAM, "pam_vbox_authenticate: no credentials given within time\n");
    777777
    778778                        rc2 = pam_vbox_read_prop(hPAM, uClientId,
     
    788788                    else if (rc == VERR_CANCELLED)
    789789                    {
    790                         pam_vbox_log(hPAM, "pam_sm_authenticate: waiting aborted\n");
     790                        pam_vbox_log(hPAM, "pam_vbox_authenticate: waiting aborted\n");
    791791
    792792                        rc2 = pam_vbox_read_prop(hPAM, uClientId,
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