"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/mod_auth_pam.c" between
proftpd-1.3.6b.tar.gz and proftpd-1.3.6c.tar.gz

About: ProFTPD is a highly configurable FTP server software (with FTPS and SFTP support).

mod_auth_pam.c  (proftpd-1.3.6b):mod_auth_pam.c  (proftpd-1.3.6c)
/* /*
* ProFTPD: mod_auth_pam -- Support for PAM-style authentication. * ProFTPD: mod_auth_pam -- Support for PAM-style authentication.
* Copyright (c) 1998, 1999, 2000 Habeeb J. Dihu aka * Copyright (c) 1998, 1999, 2000 Habeeb J. Dihu aka
* MacGyver <macgyver@tos.net>, All Rights Reserved. * MacGyver <macgyver@tos.net>, All Rights Reserved.
* Copyright 2000-2016 The ProFTPD Project * Copyright 2000-2019 The ProFTPD Project
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 221 skipping to change at line 221
} }
pr_trace_msg(trace_channel, 17, "closing PAM session"); pr_trace_msg(trace_channel, 17, "closing PAM session");
res = pam_close_session(pamh, PAM_SILENT); res = pam_close_session(pamh, PAM_SILENT);
if (res != PAM_SUCCESS) { if (res != PAM_SUCCESS) {
pr_trace_msg(trace_channel, 1, "error closing PAM session: %s", pr_trace_msg(trace_channel, 1, "error closing PAM session: %s",
pam_strerror(pamh, res)); pam_strerror(pamh, res));
} }
pr_trace_msg(trace_channel, 17, "freeing PAM handle"); pr_trace_msg(trace_channel, 17, "freeing PAM handle");
res = pam_end(pamh, 0); res = pam_end(pamh, PAM_SUCCESS);
if (res != PAM_SUCCESS) { if (res != PAM_SUCCESS) {
pr_trace_msg(trace_channel, 1, "error freeing PAM handle: %s", pr_trace_msg(trace_channel, 1, "error freeing PAM handle: %s",
pam_strerror(pamh, res)); pam_strerror(pamh, res));
} }
pamh = NULL; pamh = NULL;
PRIVS_RELINQUISH PRIVS_RELINQUISH
pr_signals_unblock(); pr_signals_unblock();
skipping to change at line 570 skipping to change at line 570
done: done:
/* And we're done. Clean up and relinquish our root privs. */ /* And we're done. Clean up and relinquish our root privs. */
if (pam_pass != NULL) { if (pam_pass != NULL) {
pr_memscrub(pam_pass, pam_pass_len); pr_memscrub(pam_pass, pam_pass_len);
free(pam_pass); free(pam_pass);
pam_pass = NULL; pam_pass = NULL;
pam_pass_len = 0; pam_pass_len = 0;
} }
if (!success) {
/* Free pam handle since we will not start user session. */
pr_trace_msg(trace_channel, 17, "freeing PAM handle");
res = pam_end(pamh, PAM_AUTH_ERR);
if (res != PAM_SUCCESS) {
pr_trace_msg(trace_channel, 1, "error freeing PAM handle: %s",
pam_strerror(pamh, res));
}
pamh = NULL;
}
PRIVS_RELINQUISH PRIVS_RELINQUISH
pr_signals_unblock(); pr_signals_unblock();
if (!success) { if (!success) {
if (pam_user != NULL) { if (pam_user != NULL) {
memset(pam_user, '\0', pam_user_len); memset(pam_user, '\0', pam_user_len);
free(pam_user); free(pam_user);
pam_user = NULL; pam_user = NULL;
pam_user_len = 0; pam_user_len = 0;
} }
 End of changes. 3 change blocks. 
2 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)