summaryrefslogtreecommitdiff
path: root/nsswitch/pam_winbind.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2015-09-08 18:25:02 +0200
committerVolker Lendecke <vl@samba.org>2016-01-13 10:57:09 +0100
commit490a27b69bc2a1ca4c22dcc2e239a0acedfee637 (patch)
treea7d8988b15b3faaae32084b31a4d8f08f8b1dedc /nsswitch/pam_winbind.c
parente8e9e7f2fe33d1e158202df4eb91d3738c9eb266 (diff)
downloadsamba-490a27b69bc2a1ca4c22dcc2e239a0acedfee637.tar.gz
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>
Diffstat (limited to 'nsswitch/pam_winbind.c')
-rw-r--r--nsswitch/pam_winbind.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index a2d9f3bde9e..b83a2762092 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -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;
}