Add two more error codes for situations where we used PAM_SYMBOL_ERR.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@932 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
parent
29c7f93598
commit
105d392c57
10 changed files with 27 additions and 20 deletions
|
@ -80,6 +80,8 @@ enum {
|
|||
PAM_DOMAIN_UNKNOWN = 29,
|
||||
PAM_BAD_HANDLE = 30, /* OpenPAM extension */
|
||||
PAM_BAD_ITEM = 31, /* OpenPAM extension */
|
||||
PAM_BAD_FEATURE = 32, /* OpenPAM extension */
|
||||
PAM_BAD_CONSTANT = 33, /* OpenPAM extension */
|
||||
PAM_NUM_ERRORS /* OpenPAM extension */
|
||||
};
|
||||
|
||||
|
|
|
@ -76,6 +76,8 @@ const char *pam_err_name[PAM_NUM_ERRORS] = {
|
|||
[PAM_DOMAIN_UNKNOWN] = "PAM_DOMAIN_UNKNOWN",
|
||||
[PAM_BAD_HANDLE] = "PAM_BAD_HANDLE",
|
||||
[PAM_BAD_ITEM] = "PAM_BAD_ITEM",
|
||||
[PAM_BAD_FEATURE] = "PAM_BAD_FEATURE",
|
||||
[PAM_BAD_CONSTANT] = "PAM_BAD_CONSTANT",
|
||||
};
|
||||
|
||||
const char *pam_err_text[PAM_NUM_ERRORS] = {
|
||||
|
@ -111,6 +113,8 @@ const char *pam_err_text[PAM_NUM_ERRORS] = {
|
|||
[PAM_DOMAIN_UNKNOWN] = "Unknown authentication domain",
|
||||
[PAM_BAD_HANDLE] = "Invalid PAM handle",
|
||||
[PAM_BAD_ITEM] = "Unrecognized or restricted item",
|
||||
[PAM_BAD_FEATURE] = "Unrecognized or restricted feature",
|
||||
[PAM_BAD_CONSTANT] = "Invalid constant",
|
||||
};
|
||||
|
||||
const char *pam_item_name[PAM_NUM_ITEMS] = {
|
||||
|
|
|
@ -50,7 +50,7 @@ openpam_get_feature(int feature, int *onoff)
|
|||
|
||||
ENTERF(feature);
|
||||
if (feature < 0 || feature >= OPENPAM_NUM_FEATURES)
|
||||
RETURNC(PAM_SYMBOL_ERR);
|
||||
RETURNC(PAM_BAD_FEATURE);
|
||||
*onoff = openpam_features[feature].onoff;
|
||||
RETURNC(PAM_SUCCESS);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ openpam_get_feature(int feature, int *onoff)
|
|||
/*
|
||||
* Error codes:
|
||||
*
|
||||
* PAM_SYMBOL_ERR
|
||||
* PAM_BAD_FEATURE
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,7 +50,7 @@ openpam_set_feature(int feature, int onoff)
|
|||
|
||||
ENTERF(feature);
|
||||
if (feature < 0 || feature >= OPENPAM_NUM_FEATURES)
|
||||
RETURNC(PAM_SYMBOL_ERR);
|
||||
RETURNC(PAM_BAD_FEATURE);
|
||||
openpam_features[feature].onoff = onoff;
|
||||
RETURNC(PAM_SUCCESS);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ openpam_set_feature(int feature, int onoff)
|
|||
/*
|
||||
* Error codes:
|
||||
*
|
||||
* PAM_SYMBOL_ERR
|
||||
* PAM_BAD_FEATURE
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -60,7 +60,7 @@ pam_authenticate(pam_handle_t *pamh,
|
|||
|
||||
ENTER();
|
||||
if (flags & ~(PAM_SILENT|PAM_DISALLOW_NULL_AUTHTOK))
|
||||
RETURNC(PAM_SYMBOL_ERR);
|
||||
RETURNC(PAM_BAD_CONSTANT);
|
||||
r = openpam_dispatch(pamh, PAM_SM_AUTHENTICATE, flags);
|
||||
pam_set_item(pamh, PAM_AUTHTOK, NULL);
|
||||
RETURNC(r);
|
||||
|
@ -72,7 +72,7 @@ pam_authenticate(pam_handle_t *pamh,
|
|||
* =openpam_dispatch
|
||||
* =pam_sm_authenticate
|
||||
* !PAM_IGNORE
|
||||
* PAM_SYMBOL_ERR
|
||||
* PAM_BAD_CONSTANT
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -92,5 +92,5 @@ pam_authenticate(pam_handle_t *pamh,
|
|||
* Fail if the user's authentication token is null.
|
||||
*
|
||||
* If any other bits are set, =pam_authenticate will return
|
||||
* =PAM_SYMBOL_ERR.
|
||||
* =PAM_BAD_CONSTANT.
|
||||
*/
|
||||
|
|
|
@ -60,7 +60,7 @@ pam_chauthtok(pam_handle_t *pamh,
|
|||
|
||||
ENTER();
|
||||
if (flags & ~(PAM_SILENT|PAM_CHANGE_EXPIRED_AUTHTOK))
|
||||
RETURNC(PAM_SYMBOL_ERR);
|
||||
RETURNC(PAM_BAD_CONSTANT);
|
||||
r = openpam_dispatch(pamh, PAM_SM_CHAUTHTOK,
|
||||
flags | PAM_PRELIM_CHECK);
|
||||
if (r == PAM_SUCCESS)
|
||||
|
@ -77,7 +77,7 @@ pam_chauthtok(pam_handle_t *pamh,
|
|||
* =openpam_dispatch
|
||||
* =pam_sm_chauthtok
|
||||
* !PAM_IGNORE
|
||||
* PAM_SYMBOL_ERR
|
||||
* PAM_BAD_CONSTANT
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -93,5 +93,5 @@ pam_chauthtok(pam_handle_t *pamh,
|
|||
* =PAM_CHANGE_EXPIRED_AUTHTOK:
|
||||
* Change only those authentication tokens that have expired.
|
||||
*
|
||||
* If any other bits are set, =pam_chauthtok will return =PAM_SYMBOL_ERR.
|
||||
* If any other bits are set, =pam_chauthtok will return =PAM_BAD_CONSTANT.
|
||||
*/
|
||||
|
|
|
@ -60,7 +60,7 @@ pam_close_session(pam_handle_t *pamh,
|
|||
|
||||
ENTER();
|
||||
if (flags & ~(PAM_SILENT))
|
||||
RETURNC(PAM_SYMBOL_ERR);
|
||||
RETURNC(PAM_BAD_CONSTANT);
|
||||
r = openpam_dispatch(pamh, PAM_SM_CLOSE_SESSION, flags);
|
||||
RETURNC(r);
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ pam_close_session(pam_handle_t *pamh,
|
|||
* =openpam_dispatch
|
||||
* =pam_sm_close_session
|
||||
* !PAM_IGNORE
|
||||
* PAM_SYMBOL_ERR
|
||||
* PAM_BAD_CONSTANT
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -85,5 +85,5 @@ pam_close_session(pam_handle_t *pamh,
|
|||
* Do not emit any messages.
|
||||
*
|
||||
* If any other bits are set, =pam_close_session will return
|
||||
* =PAM_SYMBOL_ERR.
|
||||
* =PAM_BAD_CONSTANT.
|
||||
*/
|
||||
|
|
|
@ -104,7 +104,7 @@ pam_get_authtok(pam_handle_t *pamh,
|
|||
twice = 0;
|
||||
break;
|
||||
default:
|
||||
RETURNC(PAM_SYMBOL_ERR);
|
||||
RETURNC(PAM_BAD_CONSTANT);
|
||||
}
|
||||
if (openpam_get_option(pamh, "try_first_pass") ||
|
||||
openpam_get_option(pamh, "use_first_pass")) {
|
||||
|
@ -170,6 +170,7 @@ pam_get_authtok(pam_handle_t *pamh,
|
|||
* =pam_prompt
|
||||
* =pam_set_item
|
||||
* !PAM_SYMBOL_ERR
|
||||
* PAM_BAD_CONSTANT
|
||||
* PAM_TRY_AGAIN
|
||||
*/
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ pam_open_session(pam_handle_t *pamh,
|
|||
|
||||
ENTER();
|
||||
if (flags & ~(PAM_SILENT))
|
||||
RETURNC(PAM_SYMBOL_ERR);
|
||||
RETURNC(PAM_BAD_CONSTANT);
|
||||
r = openpam_dispatch(pamh, PAM_SM_OPEN_SESSION, flags);
|
||||
RETURNC(r);
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ pam_open_session(pam_handle_t *pamh,
|
|||
* =openpam_dispatch
|
||||
* =pam_sm_open_session
|
||||
* !PAM_IGNORE
|
||||
* PAM_SYMBOL_ERR
|
||||
* PAM_BAD_CONSTANT
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -86,5 +86,5 @@ pam_open_session(pam_handle_t *pamh,
|
|||
* Do not emit any messages.
|
||||
*
|
||||
* If any other bits are set, =pam_open_session will return
|
||||
* =PAM_SYMBOL_ERR.
|
||||
* =PAM_BAD_CONSTANT.
|
||||
*/
|
||||
|
|
|
@ -61,7 +61,7 @@ pam_setcred(pam_handle_t *pamh,
|
|||
ENTER();
|
||||
if (flags & ~(PAM_SILENT|PAM_ESTABLISH_CRED|PAM_DELETE_CRED|
|
||||
PAM_REINITIALIZE_CRED|PAM_REFRESH_CRED))
|
||||
RETURNC(PAM_SYMBOL_ERR);
|
||||
RETURNC(PAM_BAD_CONSTANT);
|
||||
/* XXX enforce exclusivity */
|
||||
r = openpam_dispatch(pamh, PAM_SM_SETCRED, flags);
|
||||
RETURNC(r);
|
||||
|
@ -73,7 +73,7 @@ pam_setcred(pam_handle_t *pamh,
|
|||
* =openpam_dispatch
|
||||
* =pam_sm_setcred
|
||||
* !PAM_IGNORE
|
||||
* PAM_SYMBOL_ERR
|
||||
* PAM_BAD_CONSTANT
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -95,5 +95,5 @@ pam_setcred(pam_handle_t *pamh,
|
|||
*
|
||||
* The latter four are mutually exclusive.
|
||||
*
|
||||
* If any other bits are set, =pam_setcred will return =PAM_SYMBOL_ERR.
|
||||
* If any other bits are set, =pam_setcred will return =PAM_BAD_CONSTANT.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue