summaryrefslogtreecommitdiff
path: root/nsswitch/pam_winbind.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2015-09-08 16:48:08 +0200
committerMichael Adam <obnox@samba.org>2015-09-08 21:39:21 +0200
commit7d84cd6e40024fd361ea21635f7befed40f0e41f (patch)
treec65ad9c03080106a27fffb1ce925d3d67a1b4e51 /nsswitch/pam_winbind.c
parente7b6990284282e2bf89bb3753fdd0c5fa0bdc26c (diff)
downloadsamba-7d84cd6e40024fd361ea21635f7befed40f0e41f.tar.gz
pam_winbind: Fix a segfault if initialization fails
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11502 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Sep 8 21:39:21 CEST 2015 on sn-devel-104
Diffstat (limited to 'nsswitch/pam_winbind.c')
-rw-r--r--nsswitch/pam_winbind.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index 1e1674137f2..a2d9f3bde9e 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -2489,7 +2489,7 @@ static int _pam_delete_cred(pam_handle_t *pamh, int flags,
retval = _pam_winbind_init_context(pamh, flags, argc, argv, type, &ctx);
if (retval) {
- goto out;
+ return retval;
}
_PAM_LOG_FUNCTION_ENTER("_pam_delete_cred", ctx);
@@ -2625,7 +2625,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) {
- goto out;
+ return retval;
}
_PAM_LOG_FUNCTION_ENTER("pam_sm_authenticate", ctx);
@@ -2777,7 +2777,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) {
- goto out;
+ return ret;
}
_PAM_LOG_FUNCTION_ENTER("pam_sm_setcred", ctx);
@@ -2808,8 +2808,6 @@ int pam_sm_setcred(pam_handle_t *pamh, int flags,
break;
}
- out:
-
_PAM_LOG_FUNCTION_LEAVE("pam_sm_setcred", ctx, ret);
TALLOC_FREE(ctx);
@@ -2833,7 +2831,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) {
- goto out;
+ return ret;
}
_PAM_LOG_FUNCTION_ENTER("pam_sm_acct_mgmt", ctx);
@@ -2929,7 +2927,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) {
- goto out;
+ return ret;
}
_PAM_LOG_FUNCTION_ENTER("pam_sm_open_session", ctx);
@@ -2938,7 +2936,7 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags,
/* check and create homedir */
ret = _pam_mkhomedir(ctx);
}
- out:
+
_PAM_LOG_FUNCTION_LEAVE("pam_sm_open_session", ctx, ret);
TALLOC_FREE(ctx);
@@ -2956,12 +2954,11 @@ 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) {
- goto out;
+ return ret;
}
_PAM_LOG_FUNCTION_ENTER("pam_sm_close_session", ctx);
-out:
_PAM_LOG_FUNCTION_LEAVE("pam_sm_close_session", ctx, ret);
TALLOC_FREE(ctx);
@@ -3043,7 +3040,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) {
- goto out;
+ return ret;
}
_PAM_LOG_FUNCTION_ENTER("pam_sm_chauthtok", ctx);