rpms/autofs/devel autofs-5.0.4-fix-quoted-mess.patch, NONE, 1.1 autofs-5.0.4-use-CLOEXEC-flag-setmntent.patch, NONE, 1.1 autofs.spec, 1.263, 1.264 autofs-5.0.4-fix-program-map-quoted-output.patch, 1.1, NONE

Ian Kent iankent at fedoraproject.org
Thu Feb 5 06:42:51 UTC 2009


Author: iankent

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

Modified Files:
	autofs.spec 
Added Files:
	autofs-5.0.4-fix-quoted-mess.patch 
	autofs-5.0.4-use-CLOEXEC-flag-setmntent.patch 
Removed Files:
	autofs-5.0.4-fix-program-map-quoted-output.patch 
Log Message:
* Wed Jan 21 2009 Jeff Moyer <jmoyer at redhat.com> - 5.0.4-7
- rename program map parsing bug fix patch.
- use CLOEXEC flag functionality for setmntent also, if present.


autofs-5.0.4-fix-quoted-mess.patch:

--- NEW FILE autofs-5.0.4-fix-quoted-mess.patch ---
autofs-5.0.4 - clear the quoted flag after each character

From: Jeff Moyer <jmoyer at redhat.com>

This regression was introduced by autofs-5.0.4-fix-select-fd-limit.patch.
The fix is to clear the quoted flag after processing each character from
program map input.
---

 CHANGELOG                |    1 +
 modules/lookup_program.c |    1 +
 2 files changed, 2 insertions(+)


--- autofs-5.0.4.orig/CHANGELOG
+++ autofs-5.0.4/CHANGELOG
@@ -7,6 +7,7 @@
 - fix select(2) fd limit.
 - make hash table scale to thousands of entries (Paul Wankadia,
   Valerie Aurora Henson).
+- clear the quoted flag after each character from program map input.
 
 4/11/2008 autofs-5.0.4
 -----------------------
--- autofs-5.0.4.orig/modules/lookup_program.c
+++ autofs-5.0.4/modules/lookup_program.c
@@ -341,6 +341,7 @@ cont:
 				/* Eat characters till there's no more output */
 				break;
 			}
+			quoted = 0;
 			goto cont;
 		}
 		quoted = 0;

autofs-5.0.4-use-CLOEXEC-flag-setmntent.patch:

--- NEW FILE autofs-5.0.4-use-CLOEXEC-flag-setmntent.patch ---
autofs-5.0.4 - use CLOEXEC flag for setmntent

From: Ian Kent <raven at themaw.net>

Update use of CLOEXEC functionality to cover setmntent(3)
calls as well.
---

 CHANGELOG           |    1 +
 include/automount.h |   20 ++++++++++++++++++++
 lib/mounts.c        |    8 ++++----
 3 files changed, 25 insertions(+), 4 deletions(-)


--- autofs-5.0.4.orig/CHANGELOG
+++ autofs-5.0.4/CHANGELOG
@@ -8,6 +8,7 @@
 - make hash table scale to thousands of entries (Paul Wankadia,
   Valerie Aurora Henson).
 - clear the quoted flag after each character from program map input.
+- use CLOEXEC flag for setmntent also.
 
 4/11/2008 autofs-5.0.4
 -----------------------
--- autofs-5.0.4.orig/include/automount.h
+++ autofs-5.0.4/include/automount.h
@@ -581,5 +581,25 @@ static inline FILE *open_fopen_r(const c
 	return f;
 }
 
+static inline FILE *open_setmntent_r(const char *table)
+{
+	FILE *tab;
+
+#if defined(O_CLOEXEC) && defined(SOCK_CLOEXEC)
+	if (cloexec_works != -1) {
+		tab = setmntent(table, "re");
+		if (tab != NULL) {
+			check_cloexec(fileno(tab));
+			return tab;
+		}
+	}
+#endif
+	tab = fopen(table, "r");
+	if (tab == NULL)
+		return NULL;
+	check_cloexec(fileno(tab));
+	return tab;
+}
+
 #endif
 
--- autofs-5.0.4.orig/lib/mounts.c
+++ autofs-5.0.4/lib/mounts.c
@@ -218,7 +218,7 @@ struct mnt_list *get_mnt_list(const char
 	if (!path || !pathlen || pathlen > PATH_MAX)
 		return NULL;
 
-	tab = setmntent(table, "r");
+	tab = open_setmntent_r(table);
 	if (!tab) {
 		char *estr = strerror_r(errno, buf, PATH_MAX - 1);
 		logerr("setmntent: %s", estr);
@@ -415,7 +415,7 @@ static int table_is_mounted(const char *
 	if (!path || !pathlen || pathlen >= PATH_MAX)
 		return 0;
 
-	tab = setmntent(table, "r");
+	tab = open_setmntent_r(table);
 	if (!tab) {
 		char *estr = strerror_r(errno, buf, PATH_MAX - 1);
 		logerr("setmntent: %s", estr);
@@ -489,7 +489,7 @@ int has_fstab_option(const char *opt)
 	if (!opt)
 		return 0;
 
-	tab = setmntent(_PATH_MNTTAB, "r");
+	tab = open_setmntent_r(_PATH_MNTTAB);
 	if (!tab) {
 		char *estr = strerror_r(errno, buf, PATH_MAX - 1);
 		logerr("setmntent: %s", estr);
@@ -668,7 +668,7 @@ struct mnt_list *tree_make_mnt_tree(cons
 	size_t plen;
 	int eq;
 
-	tab = setmntent(table, "r");
+	tab = open_setmntent_r(table);
 	if (!tab) {
 		char *estr = strerror_r(errno, buf, PATH_MAX - 1);
 		logerr("setmntent: %s", estr);


Index: autofs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/autofs/devel/autofs.spec,v
retrieving revision 1.263
retrieving revision 1.264
diff -u -r1.263 -r1.264
--- autofs.spec	21 Jan 2009 21:51:36 -0000	1.263
+++ autofs.spec	5 Feb 2009 06:42:21 -0000	1.264
@@ -4,7 +4,7 @@
 Summary: A tool for automatically mounting and unmounting filesystems
 Name: autofs
 Version: 5.0.4
-Release: 6
+Release: 7
 Epoch: 1
 License: GPLv2+
 Group: System Environment/Daemons
@@ -17,7 +17,8 @@
 Patch5: autofs-5.0.4-use-CLOEXEC-flag.patch
 Patch6: autofs-5.0.4-fix-select-fd-limit.patch
 Patch7: autofs-5.0.4-make-hash-table-scale-to-thousands-of-entries.patch
-Patch8: autofs-5.0.4-fix-program-map-quoted-output.patch
+Patch8: autofs-5.0.4-fix-quoted-mess.patch
+Patch9: autofs-5.0.4-use-CLOEXEC-flag-setmntent.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, libxml2-devel, cyrus-sasl-devel, openssl-devel module-init-tools util-linux nfs-utils e2fsprogs
 Requires: kernel >= 2.6.17
@@ -119,6 +120,10 @@
 %{_libdir}/autofs/
 
 %changelog
+* Wed Jan 21 2009 Jeff Moyer <jmoyer at redhat.com> - 5.0.4-7
+- rename program map parsing bug fix patch.
+- use CLOEXEC flag functionality for setmntent also, if present.
+
 * Wed Jan 21 2009 Jeff Moyer <jmoyer at redhat.com> - 5.0.4-6
 - fix a bug in the program map parsing routine
 


--- autofs-5.0.4-fix-program-map-quoted-output.patch DELETED ---




More information about the scm-commits mailing list