- Correct calling of pam_end (#235843).

This commit is contained in:
Martin Nagy 2007-11-08 14:40:51 +00:00
parent 845c6e38e9
commit 80ed93e9c2
2 changed files with 87 additions and 1 deletions

View File

@ -0,0 +1,81 @@
diff -up vsftpd-2.0.5/sysdeputil.c.pam_end vsftpd-2.0.5/sysdeputil.c
--- vsftpd-2.0.5/sysdeputil.c.pam_end 2007-11-02 15:53:20.000000000 +0100
+++ vsftpd-2.0.5/sysdeputil.c 2007-11-08 13:49:44.000000000 +0100
@@ -320,7 +320,7 @@ vsf_sysdep_check_auth(const struct mystr
retval = pam_set_item(s_pamh, PAM_RHOST, str_getbuf(p_remote_host));
if (retval != PAM_SUCCESS)
{
- (void) pam_end(s_pamh, 0);
+ (void) pam_end(s_pamh, retval);
s_pamh = 0;
return 0;
}
@@ -329,7 +329,7 @@ vsf_sysdep_check_auth(const struct mystr
retval = pam_set_item(s_pamh, PAM_TTY, "ftp");
if (retval != PAM_SUCCESS)
{
- (void) pam_end(s_pamh, 0);
+ (void) pam_end(s_pamh, retval);
s_pamh = 0;
return 0;
}
@@ -338,7 +338,7 @@ vsf_sysdep_check_auth(const struct mystr
retval = pam_set_item(s_pamh, PAM_RUSER, str_getbuf(p_user_str));
if (retval != PAM_SUCCESS)
{
- (void) pam_end(s_pamh, 0);
+ (void) pam_end(s_pamh, retval);
s_pamh = 0;
return 0;
}
@@ -346,28 +346,28 @@ vsf_sysdep_check_auth(const struct mystr
retval = pam_authenticate(s_pamh, 0);
if (retval != PAM_SUCCESS)
{
- (void) pam_end(s_pamh, 0);
+ (void) pam_end(s_pamh, retval);
s_pamh = 0;
return 0;
}
retval = pam_acct_mgmt(s_pamh, 0);
if (retval != PAM_SUCCESS)
{
- (void) pam_end(s_pamh, 0);
+ (void) pam_end(s_pamh, retval);
s_pamh = 0;
return 0;
}
retval = pam_setcred(s_pamh, PAM_ESTABLISH_CRED);
if (retval != PAM_SUCCESS)
{
- (void) pam_end(s_pamh, 0);
+ (void) pam_end(s_pamh, retval);
s_pamh = 0;
return 0;
}
if (!tunable_session_support)
{
/* You're in already! */
- (void) pam_end(s_pamh, 0);
+ (void) pam_end(s_pamh, retval);
s_pamh = 0;
return 1;
}
@@ -378,7 +378,7 @@ vsf_sysdep_check_auth(const struct mystr
{
vsf_remove_uwtmp();
(void) pam_setcred(s_pamh, PAM_DELETE_CRED);
- (void) pam_end(s_pamh, 0);
+ (void) pam_end(s_pamh, retval);
s_pamh = 0;
return 0;
}
@@ -399,7 +399,7 @@ vsf_auth_shutdown(void)
}
(void) pam_close_session(s_pamh, 0);
(void) pam_setcred(s_pamh, PAM_DELETE_CRED);
- (void) pam_end(s_pamh, 0);
+ (void) pam_end(s_pamh, PAM_SUCCESS);
s_pamh = 0;
vsf_remove_uwtmp();
}

View File

@ -3,7 +3,7 @@
Summary: Very Secure Ftp Daemon Summary: Very Secure Ftp Daemon
Name: vsftpd Name: vsftpd
Version: 2.0.5 Version: 2.0.5
Release: 19%{?dist} Release: 20%{?dist}
License: GPL License: GPL
Group: System Environment/Daemons Group: System Environment/Daemons
URL: http://vsftpd.beasts.org/ URL: http://vsftpd.beasts.org/
@ -42,6 +42,7 @@ Patch26: vsftpd-2.0.5-bind_denied.patch
Patch27: vsftpd-2.0.5-uniq_rename.patch Patch27: vsftpd-2.0.5-uniq_rename.patch
Patch28: vsftpd-2.0.5-anon_umask.patch Patch28: vsftpd-2.0.5-anon_umask.patch
Patch29: vsftpd-2.0.5-pasv_dot.patch Patch29: vsftpd-2.0.5-pasv_dot.patch
Patch30: vsftpd-2.0.5-pam_end.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%if %{tcp_wrappers} %if %{tcp_wrappers}
@ -98,6 +99,7 @@ cp %{SOURCE1} .
%patch27 -p1 -b .uniq_rename %patch27 -p1 -b .uniq_rename
%patch28 -p1 -b .anon_umask %patch28 -p1 -b .anon_umask
%patch29 -p1 -b .pasv_dot %patch29 -p1 -b .pasv_dot
%patch30 -p1 -b .pam_end
%build %build
%ifarch s390x %ifarch s390x
@ -156,6 +158,9 @@ fi
%{_var}/ftp %{_var}/ftp
%changelog %changelog
* Thu Nov 08 2007 Martin Nagy <mnagy@redhat.com> - 2.0.5-20
- Correct calling of pam_end (#235843).
* Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 2.0.5-19 * Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 2.0.5-19
- Rebuild for selinux ppc32 issue. - Rebuild for selinux ppc32 issue.