Changeset 932 in openpam


Ignore:
Timestamp:
Apr 26, 2017, 8:41:59 PM (20 months ago)
Author:
Dag-Erling Smørgrav
Message:

Add two more error codes for situations where we used PAM_SYMBOL_ERR.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/security/pam_constants.h

    r928 r932  
    8181        PAM_BAD_HANDLE                  =  30,          /* OpenPAM extension */
    8282        PAM_BAD_ITEM                    =  31,          /* OpenPAM extension */
     83        PAM_BAD_FEATURE                 =  32,          /* OpenPAM extension */
     84        PAM_BAD_CONSTANT                =  33,          /* OpenPAM extension */
    8385        PAM_NUM_ERRORS                                  /* OpenPAM extension */
    8486};
  • trunk/lib/libpam/openpam_constants.c

    r931 r932  
    7777        [PAM_BAD_HANDLE]                 = "PAM_BAD_HANDLE",
    7878        [PAM_BAD_ITEM]                   = "PAM_BAD_ITEM",
     79        [PAM_BAD_FEATURE]                = "PAM_BAD_FEATURE",
     80        [PAM_BAD_CONSTANT]               = "PAM_BAD_CONSTANT",
    7981};
    8082
     
    112114        [PAM_BAD_HANDLE]                 = "Invalid PAM handle",
    113115        [PAM_BAD_ITEM]                   = "Unrecognized or restricted item",
     116        [PAM_BAD_FEATURE]                = "Unrecognized or restricted feature",
     117        [PAM_BAD_CONSTANT]               = "Invalid constant",
    114118};
    115119
  • trunk/lib/libpam/openpam_get_feature.c

    r648 r932  
    5151        ENTERF(feature);
    5252        if (feature < 0 || feature >= OPENPAM_NUM_FEATURES)
    53                 RETURNC(PAM_SYMBOL_ERR);
     53                RETURNC(PAM_BAD_FEATURE);
    5454        *onoff = openpam_features[feature].onoff;
    5555        RETURNC(PAM_SUCCESS);
     
    5959 * Error codes:
    6060 *
    61  *      PAM_SYMBOL_ERR
     61 *      PAM_BAD_FEATURE
    6262 */
    6363
  • trunk/lib/libpam/openpam_set_feature.c

    r648 r932  
    5151        ENTERF(feature);
    5252        if (feature < 0 || feature >= OPENPAM_NUM_FEATURES)
    53                 RETURNC(PAM_SYMBOL_ERR);
     53                RETURNC(PAM_BAD_FEATURE);
    5454        openpam_features[feature].onoff = onoff;
    5555        RETURNC(PAM_SUCCESS);
     
    5959 * Error codes:
    6060 *
    61  *      PAM_SYMBOL_ERR
     61 *      PAM_BAD_FEATURE
    6262 */
    6363
  • trunk/lib/libpam/pam_authenticate.c

    r648 r932  
    6161        ENTER();
    6262        if (flags & ~(PAM_SILENT|PAM_DISALLOW_NULL_AUTHTOK))
    63                 RETURNC(PAM_SYMBOL_ERR);
     63                RETURNC(PAM_BAD_CONSTANT);
    6464        r = openpam_dispatch(pamh, PAM_SM_AUTHENTICATE, flags);
    6565        pam_set_item(pamh, PAM_AUTHTOK, NULL);
     
    7373 *      =pam_sm_authenticate
    7474 *      !PAM_IGNORE
    75  *      PAM_SYMBOL_ERR
     75 *      PAM_BAD_CONSTANT
    7676 */
    7777
     
    9393 *
    9494 * If any other bits are set, =pam_authenticate will return
    95  * =PAM_SYMBOL_ERR.
     95 * =PAM_BAD_CONSTANT.
    9696 */
  • trunk/lib/libpam/pam_chauthtok.c

    r648 r932  
    6161        ENTER();
    6262        if (flags & ~(PAM_SILENT|PAM_CHANGE_EXPIRED_AUTHTOK))
    63                 RETURNC(PAM_SYMBOL_ERR);
     63                RETURNC(PAM_BAD_CONSTANT);
    6464        r = openpam_dispatch(pamh, PAM_SM_CHAUTHTOK,
    6565            flags | PAM_PRELIM_CHECK);
     
    7878 *      =pam_sm_chauthtok
    7979 *      !PAM_IGNORE
    80  *      PAM_SYMBOL_ERR
     80 *      PAM_BAD_CONSTANT
    8181 */
    8282
     
    9494 *              Change only those authentication tokens that have expired.
    9595 *
    96  * If any other bits are set, =pam_chauthtok will return =PAM_SYMBOL_ERR.
     96 * If any other bits are set, =pam_chauthtok will return =PAM_BAD_CONSTANT.
    9797 */
  • trunk/lib/libpam/pam_close_session.c

    r648 r932  
    6161        ENTER();
    6262        if (flags & ~(PAM_SILENT))
    63                 RETURNC(PAM_SYMBOL_ERR);
     63                RETURNC(PAM_BAD_CONSTANT);
    6464        r = openpam_dispatch(pamh, PAM_SM_CLOSE_SESSION, flags);
    6565        RETURNC(r);
     
    7272 *      =pam_sm_close_session
    7373 *      !PAM_IGNORE
    74  *      PAM_SYMBOL_ERR
     74 *      PAM_BAD_CONSTANT
    7575 */
    7676
     
    8686 *
    8787 * If any other bits are set, =pam_close_session will return
    88  * =PAM_SYMBOL_ERR.
     88 * =PAM_BAD_CONSTANT.
    8989 */
  • trunk/lib/libpam/pam_get_authtok.c

    r913 r932  
    105105                break;
    106106        default:
    107                 RETURNC(PAM_SYMBOL_ERR);
     107                RETURNC(PAM_BAD_CONSTANT);
    108108        }
    109109        if (openpam_get_option(pamh, "try_first_pass") ||
     
    171171 *      =pam_set_item
    172172 *      !PAM_SYMBOL_ERR
     173 *      PAM_BAD_CONSTANT
    173174 *      PAM_TRY_AGAIN
    174175 */
  • trunk/lib/libpam/pam_open_session.c

    r648 r932  
    6161        ENTER();
    6262        if (flags & ~(PAM_SILENT))
    63                 RETURNC(PAM_SYMBOL_ERR);
     63                RETURNC(PAM_BAD_CONSTANT);
    6464        r = openpam_dispatch(pamh, PAM_SM_OPEN_SESSION, flags);
    6565        RETURNC(r);
     
    7272 *      =pam_sm_open_session
    7373 *      !PAM_IGNORE
    74  *      PAM_SYMBOL_ERR
     74 *      PAM_BAD_CONSTANT
    7575 */
    7676
     
    8787 *
    8888 * If any other bits are set, =pam_open_session will return
    89  * =PAM_SYMBOL_ERR.
     89 * =PAM_BAD_CONSTANT.
    9090 */
  • trunk/lib/libpam/pam_setcred.c

    r648 r932  
    6262        if (flags & ~(PAM_SILENT|PAM_ESTABLISH_CRED|PAM_DELETE_CRED|
    6363                PAM_REINITIALIZE_CRED|PAM_REFRESH_CRED))
    64                 RETURNC(PAM_SYMBOL_ERR);
     64                RETURNC(PAM_BAD_CONSTANT);
    6565        /* XXX enforce exclusivity */
    6666        r = openpam_dispatch(pamh, PAM_SM_SETCRED, flags);
     
    7474 *      =pam_sm_setcred
    7575 *      !PAM_IGNORE
    76  *      PAM_SYMBOL_ERR
     76 *      PAM_BAD_CONSTANT
    7777 */
    7878
     
    9696 * The latter four are mutually exclusive.
    9797 *
    98  * If any other bits are set, =pam_setcred will return =PAM_SYMBOL_ERR.
     98 * If any other bits are set, =pam_setcred will return =PAM_BAD_CONSTANT.
    9999 */
Note: See TracChangeset for help on using the changeset viewer.