rpms/autofs/FC-6 autofs-5.0.1-rc3-check-user-info-return.patch, NONE, 1.1 autofs-5.0.1-rc3-export-check-network-fix-2.patch, NONE, 1.1 autofs-5.0.1-rc3-file-map-allow-white-space-only-line.patch, NONE, 1.1 autofs.spec, 1.174, 1.175

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Mar 1 07:17:48 UTC 2007


Author: ikent

Update of /cvs/dist/rpms/autofs/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv31525

Modified Files:
	autofs.spec 
Added Files:
	autofs-5.0.1-rc3-check-user-info-return.patch 
	autofs-5.0.1-rc3-export-check-network-fix-2.patch 
	autofs-5.0.1-rc3-file-map-allow-white-space-only-line.patch 
Log Message:
* Thu Mar 1 2007 Ian Kent <ikent at redhat.com> - 5.0.1-0.rc3.25
- change file map lexer to allow white-space only blank lines (bz 229434).
- fix return check for getpwuid_r and getgrgid_r (bz 229344).
- update "@network" matching patch.


autofs-5.0.1-rc3-check-user-info-return.patch:
 direct.c   |    4 ++--
 indirect.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

--- NEW FILE autofs-5.0.1-rc3-check-user-info-return.patch ---
diff --git a/daemon/direct.c b/daemon/direct.c
index 0869858..2dc23db 100644
--- a/daemon/direct.c
+++ b/daemon/direct.c
@@ -1335,7 +1335,7 @@ static void *do_mount_direct(void *arg)
 	}
 
 	status = getpwuid_r(mt->uid, ppw, pw_tmp, tmplen, pppw);
-	if (status) {
+	if (status || !ppw) {
 		error(ap->logopt, "failed to get passwd info from getpwuid_r");
 		free(tsv);
 		free(pw_tmp);
@@ -1382,7 +1382,7 @@ static void *do_mount_direct(void *arg)
 	}
 
 	status = getgrgid_r(mt->gid, pgr, gr_tmp, tmplen, ppgr);
-	if (status) {
+	if (status || !pgr) {
 		error(ap->logopt, "failed to get group info from getgrgid_r");
 		free(tsv->user);
 		free(tsv->home);
diff --git a/daemon/indirect.c b/daemon/indirect.c
index 46e3f99..2068c16 100644
--- a/daemon/indirect.c
+++ b/daemon/indirect.c
@@ -807,7 +807,7 @@ static void *do_mount_indirect(void *arg)
 	}
 
 	status = getpwuid_r(mt->uid, ppw, pw_tmp, tmplen, pppw);
-	if (status) {
+	if (status || !ppw) {
 		error(ap->logopt, "failed to get passwd info from getpwuid_r");
 		free(tsv);
 		free(pw_tmp);
@@ -854,7 +854,7 @@ static void *do_mount_indirect(void *arg)
 	}
 
 	status = getgrgid_r(mt->gid, pgr, gr_tmp, tmplen, ppgr);
-	if (status) {
+	if (status || !pgr) {
 		error(ap->logopt, "failed to get group info from getgrgid_r");
 		free(tsv->user);
 		free(tsv->home);

autofs-5.0.1-rc3-export-check-network-fix-2.patch:
 rpc_subs.c |   71 +++++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 53 insertions(+), 18 deletions(-)

--- NEW FILE autofs-5.0.1-rc3-export-check-network-fix-2.patch ---
diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c
index f51ca82..2c5b5d5 100644
--- a/lib/rpc_subs.c
+++ b/lib/rpc_subs.c
@@ -31,6 +31,7 @@
 #include <rpcsvc/ypclnt.h>
 #include <errno.h>
 #include <sys/ioctl.h>
+#include <ctype.h>
 #include <pthread.h>
 
 #include "mount.h"
@@ -46,6 +47,8 @@
 #define MAX_IFC_BUF	1024
 #define MAX_ERR_BUF	128
 
+#define MAX_NETWORK_LEN		255
+
 /* Get numeric value of the n bits starting at position p */
 #define getbits(x, p, n)      ((x >> (p + 1 - n)) & ~(~0 << n))
 
@@ -1066,6 +1069,9 @@ static char *inet_fill_net(const char *net_num, char *net)
 	char *np;
 	unsigned int dots = 3;
 
+	if (strlen(net_num) > INET_ADDRSTRLEN)
+		return NULL;
+
 	*net = '\0';
 	strcpy(net, net_num);
 
@@ -1076,6 +1082,11 @@ static char *inet_fill_net(const char *net_num, char *net)
 			if (!*np && dots)
 				strcat(net, "0");
 		}
+
+		if (!isdigit(*np) || dots < 0) {
+			*net = '\0';
+			return NULL;
+		}
 	}
 
 	while (dots--)
@@ -1088,13 +1099,21 @@ static int match_network(const char *network)
 {
 	struct netent *pnent, nent;
 	const char *pcnet;
-	char *net, cnet[INET_ADDRSTRLEN + 1], mask[4], *pmask;
+	char *net, cnet[MAX_NETWORK_LEN], mask[4], *pmask;
 	unsigned int size;
+	size_t l_network = strlen(network) + 1;
 	int status;
 
-	net = alloca(strlen(network) + 1);
+	if (l_network > MAX_NETWORK_LEN) {
+		error(LOGOPT_ANY,
+		      "match string \"%s\" too long", network);
+		return 0;
+	}
+
+	net = alloca(l_network);
 	if (!net)
 		return 0;
+	memset(net, 0, l_network);
 	strcpy(net, network);
 
 	if ((pmask = strchr(net, '/')))
@@ -1115,32 +1134,48 @@ static int match_network(const char *network)
 	if (pnent) {
 		uint32_t n_net;
 
-		n_net = ntohl(nent.n_net);
-		pcnet = inet_ntop(nent.n_addrtype, &n_net, cnet, INET_ADDRSTRLEN);
-		if (!pcnet)
+		switch (nent.n_addrtype) {
+		case AF_INET:
+			n_net = ntohl(nent.n_net);
+			pcnet = inet_ntop(AF_INET, &n_net, cnet, INET_ADDRSTRLEN);
+			if (!pcnet)
+				return 0;
+
+			if (!pmask) {
+				size = inet_get_net_len(nent.n_net);
+				if (!size)
+					return 0;
+			}
+			break;
+
+		case AF_INET6:
 			return 0;
 
-		if (!pmask) {
-			size = inet_get_net_len(nent.n_net);
-			if (!size)
-				return 0;
+		default:
+			return 0;
 		}
 	} else {
-		struct in_addr addr;
 		int ret;
 
-		pcnet = inet_fill_net(net, cnet);
-		if (!pcnet)
+		if (strchr(net, ':')) {
 			return 0;
+		} else {
+			struct in_addr addr;
 
-		ret = inet_pton(AF_INET, pcnet, &addr);
-		if (ret <= 0)
-			return 0;
+			pcnet = inet_fill_net(net, cnet);
+			if (!pcnet)
+				return 0;
 
-		if (!pmask) {
-			size = inet_get_net_len(htonl(addr.s_addr));
-			if (!size)
+			ret = inet_pton(AF_INET, pcnet, &addr);
+			if (ret <= 0)
 				return 0;
+
+			if (!pmask) {
+				uint32_t nl_addr = htonl(addr.s_addr);
+				size = inet_get_net_len(nl_addr);
+				if (!size)
+					return 0;
+			}
 		}
 	}
 

autofs-5.0.1-rc3-file-map-allow-white-space-only-line.patch:
 lookup_file.c |   31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)

--- NEW FILE autofs-5.0.1-rc3-file-map-allow-white-space-only-line.patch ---
diff --git a/modules/lookup_file.c b/modules/lookup_file.c
index 0f4d8f1..ef35a84 100644
--- a/modules/lookup_file.c
+++ b/modules/lookup_file.c
@@ -236,11 +236,21 @@ static int read_one(FILE *f, char *key, unsigned int *k_len, char *mapent, unsig
 
 		case st_badent:
 			if (ch == '\n') {
+				nch = getc(f);
+				if (nch != EOF && isblank(nch)) {
+					ungetc(nch, f);
+					break;
+				}
+				ungetc(nch, f);
 				state = st_begin;
 				if (gotten == got_real || gotten == getting)
 					goto got_it;
+				warn(LOGOPT_ANY, MODPREFIX 
+				      "bad map entry \"%s...\" for key "
+				      "\"%s\"", mapent, key);
 				goto next;
-			}
+			} else if (!isblank(ch))
+				getting = got_nothing;
 			break;
 
 		case st_entspc:
@@ -274,24 +284,25 @@ static int read_one(FILE *f, char *key, unsigned int *k_len, char *mapent, unsig
 
 		case st_getent:
 			if (ch == '\n') {
+				if (escape == esc_all) {
+					state = st_begin;
+					warn(LOGOPT_ANY, MODPREFIX
+					     "unmatched \" in %s for key %s",
+					     mapent, key);
+					goto next;
+				}
 				nch = getc(f);
 				if (nch != EOF && isblank(nch)) {
 					ungetc(nch, f);
 					state = st_badent;
-					gotten = got_nothing;
-					warn(LOGOPT_ANY, MODPREFIX 
+					/*gotten = got_nothing;*/
+					/*warn(LOGOPT_ANY, MODPREFIX 
 					      "bad map entry \"%s...\" for key "
-					      "\"%s\"", mapent, key);
+					      "\"%s\"", mapent, key);*/
 					break;
 				}
 				ungetc(nch, f);
 				state = st_begin;
-				if (escape == esc_all) {
-					warn(LOGOPT_ANY, MODPREFIX
-					     "unmatched \" in %s for key %s",
-					     mapent, key);
-					goto next;
-				}
 				if (gotten == got_real || gotten == getting)
 					goto got_it;
 			} else if (mapent_len < MAPENT_MAX_LEN) {


Index: autofs.spec
===================================================================
RCS file: /cvs/dist/rpms/autofs/FC-6/autofs.spec,v
retrieving revision 1.174
retrieving revision 1.175
diff -u -r1.174 -r1.175
--- autofs.spec	20 Feb 2007 04:33:58 -0000	1.174
+++ autofs.spec	1 Mar 2007 07:17:46 -0000	1.175
@@ -4,7 +4,7 @@
 Summary: A tool for automatically mounting and unmounting filesystems
 Name: autofs
 %define version 5.0.1
-%define release 0.rc3.23
+%define release 0.rc3.25
 Version: %{version}
 Release: %{release}
 Epoch: 1
@@ -25,6 +25,9 @@
 Patch12: autofs-5.0.1-rc3-add-condrestart.patch
 Patch13: autofs-5.0.1-rc3-export-match-at-network-and-dot-domain.patch
 Patch14: autofs-5.0.1-rc3-hosts-map-name.patch
+Patch15: autofs-5.0.1-rc3-check-user-info-return.patch
+Patch16: autofs-5.0.1-rc3-file-map-allow-white-space-only-line.patch
+Patch17: autofs-5.0.1-rc3-export-check-network-fix-2.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
 Conflicts: kernel < 2.6.17
@@ -81,6 +84,9 @@
 %patch12 -p1
 %patch13 -p1
 %patch14 -p1
+%patch15 -p1
+%patch16 -p1
+%patch17 -p1
 
 %build
 #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir}
@@ -137,6 +143,11 @@
 %{_libdir}/autofs/*
 
 %changelog
+* Thu Mar 1 2007 Ian Kent <ikent at redhat.com> - 5.0.1-0.rc3.25
+- change file map lexer to allow white-space only blank lines (bz 229434).
+- fix return check for getpwuid_r and getgrgid_r (bz 229344).
+- update "@network" matching patch.
+
 * Tue Feb 20 2007 Ian Kent <ikent at redhat.com> - 5.0.1-0.rc3.23
 - add "condrestart" to init script (bz 228860).
 - add "@network" and .domain.name export check.




More information about the fedora-cvs-commits mailing list