rpms/pam/devel pam-1.0.91-std-noclose.patch, 1.2, 1.3 pam.spec, 1.192, 1.193

Tomáš Mráz tmraz at fedoraproject.org
Thu Mar 26 09:28:14 UTC 2009


Author: tmraz

Update of /cvs/pkgs/rpms/pam/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv562

Modified Files:
	pam-1.0.91-std-noclose.patch pam.spec 
Log Message:
* Thu Mar 26 2009 Tomas Mraz <tmraz at redhat.com> 1.0.91-4
- replace also other std descriptors (#491471)


pam-1.0.91-std-noclose.patch:

Index: pam-1.0.91-std-noclose.patch
===================================================================
RCS file: /cvs/pkgs/rpms/pam/devel/pam-1.0.91-std-noclose.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- pam-1.0.91-std-noclose.patch	17 Mar 2009 14:13:16 -0000	1.2
+++ pam-1.0.91-std-noclose.patch	26 Mar 2009 09:28:14 -0000	1.3
@@ -1,7 +1,21 @@
 diff -up Linux-PAM-1.0.91/modules/pam_mkhomedir/pam_mkhomedir.c.std-noclose Linux-PAM-1.0.91/modules/pam_mkhomedir/pam_mkhomedir.c
---- Linux-PAM-1.0.91/modules/pam_mkhomedir/pam_mkhomedir.c.std-noclose	2009-03-13 17:31:17.000000000 +0100
-+++ Linux-PAM-1.0.91/modules/pam_mkhomedir/pam_mkhomedir.c	2009-03-13 17:31:02.000000000 +0100
-@@ -137,7 +137,7 @@ create_homedir (pam_handle_t *pamh, int 
+--- Linux-PAM-1.0.91/modules/pam_mkhomedir/pam_mkhomedir.c.std-noclose	2009-03-03 14:56:01.000000000 +0100
++++ Linux-PAM-1.0.91/modules/pam_mkhomedir/pam_mkhomedir.c	2009-03-26 10:02:15.000000000 +0100
+@@ -131,13 +131,21 @@ create_homedir (pam_handle_t *pamh, int 
+    if (child == 0) {
+         int i;
+         struct rlimit rlim;
++	int dummyfds[2];
+ 	static char *envp[] = { NULL };
+ 	char *args[] = { NULL, NULL, NULL, NULL, NULL };
+ 
++	/* replace std file descriptors with a dummy pipe */
++	if (pipe(dummyfds) == 0) {
++		dup2(dummyfds[0], STDIN_FILENO);
++		dup2(dummyfds[1], STDOUT_FILENO);
++		dup2(dummyfds[2], STDERR_FILENO);
++	}
++
  	if (getrlimit(RLIMIT_NOFILE, &rlim)==0) {
            if (rlim.rlim_max >= MAX_FD_NO)
                  rlim.rlim_max = MAX_FD_NO;
@@ -12,8 +26,16 @@
  	}
 diff -up Linux-PAM-1.0.91/modules/pam_unix/support.c.std-noclose Linux-PAM-1.0.91/modules/pam_unix/support.c
 --- Linux-PAM-1.0.91/modules/pam_unix/support.c.std-noclose	2009-03-03 14:56:01.000000000 +0100
-+++ Linux-PAM-1.0.91/modules/pam_unix/support.c	2009-03-13 17:34:02.000000000 +0100
-@@ -447,9 +447,8 @@ static int _unix_run_helper_binary(pam_h
++++ Linux-PAM-1.0.91/modules/pam_unix/support.c	2009-03-26 10:08:59.000000000 +0100
+@@ -443,13 +443,16 @@ static int _unix_run_helper_binary(pam_h
+ 
+ 	/* reopen stdin as pipe */
+ 	dup2(fds[0], STDIN_FILENO);
++	/* and replace also the stdout/err as the helper will
++           not write anything there */
++	dup2(fds[1], STDOUT_FILENO);
++	dup2(fds[1], STDERR_FILENO);
+ 
  	if (getrlimit(RLIMIT_NOFILE,&rlim)==0) {
            if (rlim.rlim_max >= MAX_FD_NO)
                  rlim.rlim_max = MAX_FD_NO;
@@ -27,8 +49,16 @@
  
 diff -up Linux-PAM-1.0.91/modules/pam_unix/pam_unix_passwd.c.std-noclose Linux-PAM-1.0.91/modules/pam_unix/pam_unix_passwd.c
 --- Linux-PAM-1.0.91/modules/pam_unix/pam_unix_passwd.c.std-noclose	2009-03-03 14:56:01.000000000 +0100
-+++ Linux-PAM-1.0.91/modules/pam_unix/pam_unix_passwd.c	2009-03-13 17:32:36.000000000 +0100
-@@ -179,9 +179,8 @@ static int _unix_run_update_binary(pam_h
++++ Linux-PAM-1.0.91/modules/pam_unix/pam_unix_passwd.c	2009-03-26 10:07:06.000000000 +0100
+@@ -175,13 +175,16 @@ static int _unix_run_update_binary(pam_h
+ 
+ 	/* reopen stdin as pipe */
+ 	dup2(fds[0], STDIN_FILENO);
++	/* and replace also the stdout/err as the helper will
++           not write anything there */
++	dup2(fds[1], STDOUT_FILENO);
++	dup2(fds[1], STDERR_FILENO);
+ 
  	if (getrlimit(RLIMIT_NOFILE,&rlim)==0) {
  	  if (rlim.rlim_max >= MAX_FD_NO)
  	    rlim.rlim_max = MAX_FD_NO;
@@ -42,14 +72,15 @@
  
 diff -up Linux-PAM-1.0.91/modules/pam_unix/pam_unix_acct.c.std-noclose Linux-PAM-1.0.91/modules/pam_unix/pam_unix_acct.c
 --- Linux-PAM-1.0.91/modules/pam_unix/pam_unix_acct.c.std-noclose	2009-03-03 14:56:01.000000000 +0100
-+++ Linux-PAM-1.0.91/modules/pam_unix/pam_unix_acct.c	2009-03-17 15:08:51.000000000 +0100
-@@ -100,16 +100,17 @@ int _unix_run_verify_binary(pam_handle_t
++++ Linux-PAM-1.0.91/modules/pam_unix/pam_unix_acct.c	2009-03-26 10:05:41.000000000 +0100
+@@ -100,16 +100,18 @@ int _unix_run_verify_binary(pam_handle_t
  
      /* reopen stdout as pipe */
      dup2(fds[1], STDOUT_FILENO);
-+    /* and replace also the stdin so we do not exec the helper with
++    /* and replace also the stdin, stderr so we do not exec the helper with
 +       tty as stdin, it will not read anything from there anyway */
 +    dup2(fds[0], STDIN_FILENO);
++    dup2(fds[1], STDERR_FILENO);
  
      /* XXX - should really tidy up PAM here too */
  


Index: pam.spec
===================================================================
RCS file: /cvs/pkgs/rpms/pam/devel/pam.spec,v
retrieving revision 1.192
retrieving revision 1.193
diff -u -r1.192 -r1.193
--- pam.spec	17 Mar 2009 14:13:16 -0000	1.192
+++ pam.spec	26 Mar 2009 09:28:14 -0000	1.193
@@ -3,7 +3,7 @@
 Summary: An extensible library which provides authentication for applications
 Name: pam
 Version: 1.0.91
-Release: 3%{?dist}
+Release: 4%{?dist}
 # The library is BSD licensed with option to relicense as GPLv2+ - this option is redundant
 # as the BSD license allows that anyway. pam_timestamp and pam_console modules are GPLv2+,
 # pam_rhosts_auth module is BSD with advertising
@@ -315,6 +315,9 @@
 %doc doc/adg/*.txt doc/adg/html
 
 %changelog
+* Thu Mar 26 2009 Tomas Mraz <tmraz at redhat.com> 1.0.91-4
+- replace also other std descriptors (#491471)
+
 * Tue Mar 16 2009 Tomas Mraz <tmraz at redhat.com> 1.0.91-3
 - we must replace the stdin when execing the helper (#490644)
 




More information about the fedora-extras-commits mailing list