]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
nsswitch: fix crash on null pam change pw response
authorLuca Lorenzetto <lorenzetto-luca@ubuntu-it.org>
Tue, 11 Sep 2012 16:35:42 +0000 (18:35 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 17 Sep 2012 09:37:01 +0000 (11:37 +0200)
The function _pam_winbind_change_pwd crashes due to a null value passed
to the function strcasecmp and denies to login via graphical login
manager. Check for a null value before doing a strcasecmp.

Bug-Ubuntu: https://bugs.launchpad.net/bugs/1003296
Bug: https://bugzilla.samba.org/show_bug.cgi?id=9013
(Desktop Managers (xdm, gdm, lightdm...) crashes with SIGSEGV in
_pam_winbind_change_pwd() when password is expiring)

nsswitch/pam_winbind.c

index f67612819114c26af51d5fec861cde5bad68a4f0..025d930f4d32e71e3d5ac2a6d1fc1d12662c469a 100644 (file)
@@ -831,7 +831,7 @@ static bool _pam_winbind_change_pwd(struct pwb_context *ctx)
        }
        _pam_log(ctx, LOG_CRIT, "Received [%s] reply from application.\n", resp->resp);
 
-       if (strcasecmp(resp->resp, "yes") == 0) {
+       if ((resp->resp != NULL) && (strcasecmp(resp->resp, "yes") == 0)) {
                retval = true;
        }