Changeset 203 in openpam for trunk/lib


Ignore:
Timestamp:
Feb 8, 2003, 4:41:53 PM (17 years ago)
Author:
Dag-Erling Smørgrav
Message:

Nothing beats being an idiot! Avoid passing expressions with side
effects as arguments to macros. Also impose some sort of consistency
in the naming of variables that hold error codes.

Location:
trunk/lib
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/pam_acct_mgmt.c

    r187 r203  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/pam_acct_mgmt.c#10 $
     34 * $P4: //depot/projects/openpam/lib/pam_acct_mgmt.c#11 $
    3535 */
    3636
     
    5252        int flags)
    5353{
    54         int pam_err;
     54        int r;
    5555
    5656        ENTER();
    57         pam_err = openpam_dispatch(pamh, PAM_SM_ACCT_MGMT, flags);
    58         RETURNC(pam_err);
     57        r = openpam_dispatch(pamh, PAM_SM_ACCT_MGMT, flags);
     58        RETURNC(r);
    5959}
    6060
  • trunk/lib/pam_authenticate.c

    r187 r203  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/pam_authenticate.c#12 $
     34 * $P4: //depot/projects/openpam/lib/pam_authenticate.c#13 $
    3535 */
    3636
     
    5252        int flags)
    5353{
    54         int pam_err;
     54        int r;
    5555
    5656        ENTER();
    5757        if (flags & ~(PAM_SILENT|PAM_DISALLOW_NULL_AUTHTOK))
    5858                RETURNC(PAM_SYMBOL_ERR);
    59         pam_err = openpam_dispatch(pamh, PAM_SM_AUTHENTICATE, flags);
     59        r = openpam_dispatch(pamh, PAM_SM_AUTHENTICATE, flags);
    6060        pam_set_item(pamh, PAM_AUTHTOK, NULL);
    61         RETURNC(pam_err);
     61        RETURNC(r);
    6262}
    6363
  • trunk/lib/pam_chauthtok.c

    r187 r203  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/pam_chauthtok.c#13 $
     34 * $P4: //depot/projects/openpam/lib/pam_chauthtok.c#14 $
    3535 */
    3636
     
    5252        int flags)
    5353{
    54         int pam_err;
     54        int r;
    5555
    5656        ENTER();
    5757        if (flags & ~(PAM_SILENT|PAM_CHANGE_EXPIRED_AUTHTOK))
    5858                RETURNC(PAM_SYMBOL_ERR);
    59         pam_err = openpam_dispatch(pamh, PAM_SM_CHAUTHTOK,
     59        r = openpam_dispatch(pamh, PAM_SM_CHAUTHTOK,
    6060            flags | PAM_PRELIM_CHECK);
    61         if (pam_err == PAM_SUCCESS)
    62                 pam_err = openpam_dispatch(pamh, PAM_SM_CHAUTHTOK,
     61        if (r == PAM_SUCCESS)
     62                r = openpam_dispatch(pamh, PAM_SM_CHAUTHTOK,
    6363                    flags | PAM_UPDATE_AUTHTOK);
    6464        pam_set_item(pamh, PAM_OLDAUTHTOK, NULL);
    6565        pam_set_item(pamh, PAM_AUTHTOK, NULL);
    66         RETURNC(pam_err);
     66        RETURNC(r);
    6767}
    6868
  • trunk/lib/pam_close_session.c

    r187 r203  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/pam_close_session.c#10 $
     34 * $P4: //depot/projects/openpam/lib/pam_close_session.c#11 $
    3535 */
    3636
     
    5252        int flags)
    5353{
     54        int r;
    5455
    5556        ENTER();
    5657        if (flags & ~(PAM_SILENT))
    5758                RETURNC(PAM_SYMBOL_ERR);
    58         RETURNC(openpam_dispatch(pamh, PAM_SM_CLOSE_SESSION, flags));
     59        r = openpam_dispatch(pamh, PAM_SM_CLOSE_SESSION, flags);
     60        RETURNC(r);
    5961}
    6062
  • trunk/lib/pam_get_authtok.c

    r187 r203  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/pam_get_authtok.c#20 $
     34 * $P4: //depot/projects/openpam/lib/pam_get_authtok.c#21 $
    3535 */
    3636
     
    125125        if (r != PAM_SUCCESS)
    126126                RETURNC(r);
    127         RETURNC(pam_get_item(pamh, item, (const void **)authtok));
     127        r = pam_get_item(pamh, item, (const void **)authtok);
     128        RETURNC(r);
    128129}
    129130
  • trunk/lib/pam_get_user.c

    r187 r203  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/pam_get_user.c#13 $
     34 * $P4: //depot/projects/openpam/lib/pam_get_user.c#14 $
    3535 */
    3636
     
    7979        if (r != PAM_SUCCESS)
    8080                RETURNC(r);
    81         RETURNC(pam_get_item(pamh, PAM_USER, (const void **)user));
     81        r = pam_get_item(pamh, PAM_USER, (const void **)user);
     82        RETURNC(r);
    8283}
    8384
  • trunk/lib/pam_getenv.c

    r194 r203  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/pam_getenv.c#10 $
     34 * $P4: //depot/projects/openpam/lib/pam_getenv.c#11 $
    3535 */
    3636
     
    5353        const char *name)
    5454{
     55        char *str;
    5556        int i;
    5657
    57         ENTER();
     58        ENTERS(name);
    5859        if (pamh == NULL)
    5960                RETURNS(NULL);
     
    6263        if ((i = openpam_findenv(pamh, name, strlen(name))) == -1)
    6364                RETURNS(NULL);
    64         RETURNS(strdup(pamh->env[i]));
     65        str = strdup(pamh->env[i]);
     66        RETURNS(str);
    6567}
    6668
  • trunk/lib/pam_open_session.c

    r187 r203  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/pam_open_session.c#10 $
     34 * $P4: //depot/projects/openpam/lib/pam_open_session.c#11 $
    3535 */
    3636
     
    5252        int flags)
    5353{
     54        int r;
    5455
    5556        ENTER();
    5657        if (flags & ~(PAM_SILENT))
    5758                RETURNC(PAM_SYMBOL_ERR);
    58         RETURNC(openpam_dispatch(pamh, PAM_SM_OPEN_SESSION, flags));
     59        r = openpam_dispatch(pamh, PAM_SM_OPEN_SESSION, flags);
     60        RETURNC(r);
    5961}
    6062
  • trunk/lib/pam_setcred.c

    r187 r203  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/pam_setcred.c#11 $
     34 * $P4: //depot/projects/openpam/lib/pam_setcred.c#12 $
    3535 */
    3636
     
    5252        int flags)
    5353{
     54        int r;
    5455
    5556        ENTER();
     
    5859                RETURNC(PAM_SYMBOL_ERR);
    5960        /* XXX enforce exclusivity */
    60         RETURNC(openpam_dispatch(pamh, PAM_SM_SETCRED, flags));
     61        r = openpam_dispatch(pamh, PAM_SM_SETCRED, flags);
     62        RETURNC(r);
    6163}
    6264
Note: See TracChangeset for help on using the changeset viewer.