VirtualBox

Ignore:
Timestamp:
Aug 26, 2011 1:25:29 PM (13 years ago)
Author:
vboxsync
Message:

pam_vbox: Documentation.

File:
1 edited

Legend:

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

    r38545 r38548  
    8484 * Write to system log.
    8585 *
    86  * @param  pszBuf      Buffer to write to the log (NULL-terminated)
     86 * @param  pszBuf                   Buffer to write to the log (NULL-terminated)
    8787 */
    8888static void pam_vbox_writesyslog(char *pszBuf)
     
    101101 * Displays an error message.
    102102 *
    103  * @param   pszFormat   The message text.
    104  * @param   ...         Format arguments.
     103 * @param   pszFormat               The message text.
     104 * @param   ...                     Format arguments.
    105105 */
    106106static void pam_vbox_error(pam_handle_t *hPAM, const char *pszFormat, ...)
     
    122122 * Displays a debug message.
    123123 *
    124  * @param   pszFormat   The message text.
    125  * @param   ...         Format arguments.
     124 * @param   pszFormat               The message text.
     125 * @param   ...                     Format arguments.
    126126 */
    127127static void pam_vbox_log(pam_handle_t *hPAM, const char *pszFormat, ...)
     
    146146
    147147
     148/**
     149 * Sets a message using PAM's conversation function.
     150 *
     151 * @return  IPRT status code.
     152 * @param   hPAM                    PAM handle.
     153 * @param   iStyle                  Style of message (0 = Information, 1 = Prompt
     154 *                                  echo off, 2 = Prompt echo on, 3 = Error).
     155 * @param   pszText                 Message text to set.
     156 */
    148157static int vbox_set_msg(pam_handle_t *hPAM, int iStyle, const char *pszText)
    149158{
     
    201210
    202211
     212/**
     213 * Initializes pam_vbox.
     214 *
     215 * @return  IPRT status code.
     216 * @param   hPAM                    PAM handle.
     217 */
    203218static int pam_vbox_init(pam_handle_t *hPAM)
    204219{
     
    265280
    266281
     282/**
     283 * Shuts down pam_vbox.
     284 *
     285 * @return  IPRT status code.
     286 * @param   hPAM                    PAM handle.
     287 */
    267288static void pam_vbox_shutdown(pam_handle_t *hPAM)
    268289{
     
    271292
    272293
     294/**
     295 * Checks for credentials provided by the host / HGCM.
     296 *
     297 * @return  IPRT status code. VERR_NOT_FOUND if no credentials are available,
     298 *          VINF_SUCCESS on successful retrieval or another IPRT error.
     299 * @param   hPAM                    PAM handle.
     300 */
    273301static int pam_vbox_check_creds(pam_handle_t *hPAM)
    274302{
     
    335363
    336364#ifdef VBOX_WITH_GUEST_PROPS
     365/**
     366 * Reads a guest property.
     367 *
     368 * @return  IPRT status code.
     369 * @param   hPAM                    PAM handle.
     370 * @param   uClientID               Guest property service client ID.
     371 * @param   pszKey                  Key (name) of guest property to read.
     372 * @param   fReadOnly               Indicates whether this key needs to be
     373 *                                  checked if it only can be read (and *not* written)
     374 *                                  by the guest.
     375 * @param   pszValue                Buffer where to store the key's value.
     376 * @param   cbValue                 Size of buffer (in bytes).
     377 */
    337378static int pam_vbox_read_prop(pam_handle_t *hPAM, uint32_t uClientID,
    338379                              const char *pszKey, bool fReadOnly,
     
    428469
    429470
     471/**
     472 * Waits for a guest property to be changed.
     473 *
     474 * @return  IPRT status code.
     475 * @param   hPAM                    PAM handle.
     476 * @param   uClientID               Guest property service client ID.
     477 * @param   pszKey                  Key (name) of guest property to wait for.
     478 * @param   uTimeoutMS              Timeout (in ms) to wait for the change. Specify
     479 *                                  RT_INDEFINITE_WAIT to wait indefinitly.
     480 */
    430481static int pam_vbox_wait_prop(pam_handle_t *hPAM, uint32_t uClientID,
    431482                              const char *pszKey, uint32_t uTimeoutMS)
     
    477528
    478529
     530/**
     531 * Thread function waiting for credentials to arrive.
     532 *
     533 * @return  IPRT status code.
     534 * @param   ThreadSelf              Thread struct to this thread.
     535 * @param   pvUser                  Pointer to a PAMVBOXTHREAD structure providing
     536 *                                  required data used / set by the thread.
     537 */
    479538static DECLCALLBACK(int) pam_vbox_wait_thread(RTTHREAD ThreadSelf, void *pvUser)
    480539{
     
    586645
    587646
     647/**
     648 * Waits for credentials to arrive by creating and waiting for a thread.
     649 *
     650 * @return  IPRT status code.
     651 * @param   hPAM                    PAM handle.
     652 * @param   uClientID               Guest property service client ID.
     653 * @param   pszKey                  Key (name) of guest property to wait for.
     654 * @param   uTimeoutMS              Timeout (in ms) to wait for the change. Specify
     655 *                                  RT_INDEFINITE_WAIT to wait indefinitly.
     656 */
    588657static int pam_vbox_wait_for_creds(pam_handle_t *hPAM, uint32_t uClientID, uint32_t uTimeoutMS)
    589658{
     
    600669        pam_vbox_log(hPAM, "pam_vbox_wait_for_creds: Waiting for credentials (%dms) ...\n", uTimeoutMS);
    601670        /* Wait for thread to initialize. */
     671        /** @todo We can do something else here in the meantime later. */
    602672        rc = RTThreadUserWait(threadWait, RT_INDEFINITE_WAIT);
    603673        if (RT_SUCCESS(rc))
     
    612682
    613683
    614 /**
    615  * Performs authentication within the PAM framework.
    616  *
    617  * @todo
    618  */
    619684DECLEXPORT(int) pam_sm_authenticate(pam_handle_t *hPAM, int iFlags,
    620685                                    int argc, const char **argv)
     
    760825
    761826
    762 /**
    763  * Modifies / deletes user credentials
    764  *
    765  * @todo
    766  */
    767827DECLEXPORT(int) pam_sm_setcred(pam_handle_t *hPAM, int iFlags, int argc, const char **argv)
    768828{
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