1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

pam_winbind: check != PAM_SUCCESS and != NULL explicitly

...instead of using "if (ret)" or similar.
This is just a code cleanup, no changes in behaviour.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Michael Adam 2015-09-08 18:25:02 +02:00 committed by Volker Lendecke
parent e8e9e7f2fe
commit 490a27b69b

View File

@ -1262,7 +1262,7 @@ static void _pam_setup_krb5_env(struct pwb_context *ctx,
}
ret = pam_putenv(ctx->pamh, var);
if (ret) {
if (ret != PAM_SUCCESS) {
_pam_log(ctx, LOG_ERR,
"failed to set KRB5CCNAME to %s: %s",
var, pam_strerror(ctx->pamh, ret));
@ -1328,7 +1328,7 @@ static void _pam_set_data_string(struct pwb_context *ctx,
ret = pam_set_data(ctx->pamh, data_name, talloc_strdup(NULL, value),
_pam_winbind_cleanup_func);
if (ret) {
if (ret != PAM_SUCCESS) {
_pam_log_debug(ctx, LOG_DEBUG,
"Could not set data %s: %s\n",
data_name, pam_strerror(ctx->pamh, ret));
@ -1656,7 +1656,7 @@ static int _pam_mkhomedir(struct pwb_context *ctx)
}
ret = _pam_create_homedir(ctx, create_dir, mode);
if (ret) {
if (ret != PAM_SUCCESS) {
return ret;
}
}
@ -2369,7 +2369,7 @@ static const char *get_member_from_config(struct pwb_context *ctx)
const char *ret = NULL;
ret = get_conf_item_string(ctx, "require_membership_of",
WINBIND_REQUIRED_MEMBERSHIP);
if (ret) {
if (ret != NULL) {
return ret;
}
return get_conf_item_string(ctx, "require-membership-of",
@ -2488,7 +2488,7 @@ static int _pam_delete_cred(pam_handle_t *pamh, int flags,
ZERO_STRUCT(logoff);
retval = _pam_winbind_init_context(pamh, flags, argc, argv, type, &ctx);
if (retval) {
if (retval != PAM_SUCCESS) {
return retval;
}
@ -2503,7 +2503,7 @@ static int _pam_delete_cred(pam_handle_t *pamh, int flags,
struct passwd *pwd = NULL;
retval = pam_get_user(pamh, &user, _("Username: "));
if (retval) {
if (retval != PAM_SUCCESS) {
_pam_log(ctx, LOG_ERR,
"could not identify user");
goto out;
@ -2624,7 +2624,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
retval = _pam_winbind_init_context(pamh, flags, argc, argv,
PAM_WINBIND_AUTHENTICATE, &ctx);
if (retval) {
if (retval != PAM_SUCCESS) {
return retval;
}
@ -2776,7 +2776,7 @@ int pam_sm_setcred(pam_handle_t *pamh, int flags,
ret = _pam_winbind_init_context(pamh, flags, argc, argv,
PAM_WINBIND_SETCRED, &ctx);
if (ret) {
if (ret != PAM_SUCCESS) {
return ret;
}
@ -2830,7 +2830,7 @@ int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags,
ret = _pam_winbind_init_context(pamh, flags, argc, argv,
PAM_WINBIND_ACCT_MGMT, &ctx);
if (ret) {
if (ret != PAM_SUCCESS) {
return ret;
}
@ -2926,7 +2926,7 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags,
ret = _pam_winbind_init_context(pamh, flags, argc, argv,
PAM_WINBIND_OPEN_SESSION, &ctx);
if (ret) {
if (ret != PAM_SUCCESS) {
return ret;
}
@ -2953,7 +2953,7 @@ int pam_sm_close_session(pam_handle_t *pamh, int flags,
ret = _pam_winbind_init_context(pamh, flags, argc, argv,
PAM_WINBIND_CLOSE_SESSION, &ctx);
if (ret) {
if (ret != PAM_SUCCESS) {
return ret;
}
@ -3039,7 +3039,7 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
ret = _pam_winbind_init_context(pamh, flags, argc, argv,
PAM_WINBIND_CHAUTHTOK, &ctx);
if (ret) {
if (ret != PAM_SUCCESS) {
return ret;
}
@ -3054,7 +3054,7 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
* First get the name of a user
*/
ret = pam_get_user(pamh, &user, _("Username: "));
if (ret) {
if (ret != PAM_SUCCESS) {
_pam_log(ctx, LOG_ERR,
"password - could not identify user");
goto out;
@ -3215,7 +3215,7 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
ret = winbind_chauthtok_request(ctx, user, pass_old,
pass_new, pwdlastset_update);
if (ret) {
if (ret != PAM_SUCCESS) {
pass_old = pass_new = NULL;
goto out;
}