Ian Kent c27a1d
autofs-5.0.6 - teach automount about sss source
Ian Kent c27a1d
Ian Kent c27a1d
From: Ian Kent <raven@themaw.net>
Ian Kent c27a1d
Ian Kent c27a1d
Add parser and conditional checks to automount to handle sss source.
Ian Kent c27a1d
Note, the parsing probably needs more work, both for master map entries
Ian Kent c27a1d
and map entries, to attempt to narrow invalid map names passed down to
Ian Kent c27a1d
lower level modules. For now we have to just handle these failures in
Ian Kent c27a1d
the lookup module.
Ian Kent c27a1d
---
Ian Kent c27a1d
Ian Kent c27a1d
 CHANGELOG           |    1 +
Ian Kent c27a1d
 daemon/lookup.c     |    1 +
Ian Kent c27a1d
 lib/master_tok.l    |    2 +-
Ian Kent c27a1d
 lib/nss_parse.y     |    6 ++++--
Ian Kent c27a1d
 modules/parse_sun.c |    2 +-
Ian Kent c27a1d
 5 files changed, 8 insertions(+), 4 deletions(-)
Ian Kent c27a1d
Ian Kent c27a1d
Ian Kent 23d379
--- autofs-5.0.6.orig/CHANGELOG
Ian Kent 23d379
+++ autofs-5.0.6/CHANGELOG
Ian Kent 23d379
@@ -22,6 +22,7 @@
Ian Kent c27a1d
 - fix improve mount location error reporting.
Ian Kent 23d379
 - fix rpc build error.
Ian Kent c27a1d
 - add sss lookup module.
Ian Kent c27a1d
+- teach automount about sss source.
Ian Kent c27a1d
 
Ian Kent c27a1d
 28/06/2011 autofs-5.0.6
Ian Kent c27a1d
 -----------------------
Ian Kent 23d379
--- autofs-5.0.6.orig/daemon/lookup.c
Ian Kent 23d379
+++ autofs-5.0.6/daemon/lookup.c
Ian Kent 23d379
@@ -177,6 +177,7 @@ int lookup_nss_read_master(struct master
Ian Kent c27a1d
 			    !strncmp(name, "nisplus:", 8) ||
Ian Kent c27a1d
 			    !strncmp(name, "ldap:", 5) ||
Ian Kent c27a1d
 			    !strncmp(name, "ldaps:", 6) ||
Ian Kent c27a1d
+			    !strncmp(name, "sss:", 4) ||
Ian Kent c27a1d
 			    !strncmp(name, "dir:", 4)) {
Ian Kent c27a1d
 				strncpy(source, name, tmp - name);
Ian Kent c27a1d
 
Ian Kent 23d379
--- autofs-5.0.6.orig/lib/master_tok.l
Ian Kent 23d379
+++ autofs-5.0.6/lib/master_tok.l
Ian Kent c27a1d
@@ -118,7 +118,7 @@ DNNAMESTR2	([[:alnum:]_.\-]+)
Ian Kent c27a1d
 INTMAP		(-hosts|-null)
Ian Kent c27a1d
 MULTI		((multi)(,(sun|hesiod))?(:{OPTWS}|{WS}))
Ian Kent c27a1d
 MULTISEP	([\-]{2}[[:blank:]]+)
Ian Kent c27a1d
-MTYPE		((file|program|yp|nis|nisplus|ldap|ldaps|hesiod|userdir)(,(sun|hesiod))?(:{OPTWS}|{WS}))
Ian Kent c27a1d
+MTYPE		((file|program|sss|yp|nis|nisplus|ldap|ldaps|hesiod|userdir)(,(sun|hesiod))?(:{OPTWS}|{WS}))
Ian Kent c27a1d
 
Ian Kent c27a1d
 
Ian Kent c27a1d
 OPTTOUT		(-t{OPTWS}|-t{OPTWS}={OPTWS}|--timeout{OPTWS}|--timeout{OPTWS}={OPTWS})
Ian Kent 23d379
--- autofs-5.0.6.orig/lib/nss_parse.y
Ian Kent 23d379
+++ autofs-5.0.6/lib/nss_parse.y
Ian Kent c27a1d
@@ -82,7 +82,8 @@ nss_source: SOURCE
Ian Kent c27a1d
 {
Ian Kent c27a1d
 	if (!strcmp($1, "files") || !strcmp($1, "yp") ||
Ian Kent c27a1d
 	    !strcmp($1, "nis") || !strcmp($1, "ldap") ||
Ian Kent c27a1d
-	    !strcmp($1, "nisplus") || !strcmp($1, "hesiod"))
Ian Kent c27a1d
+	    !strcmp($1, "nisplus") || !strcmp($1, "hesiod") ||
Ian Kent c27a1d
+	    !strcmp($1, "sss"))
Ian Kent c27a1d
 		src = add_source(nss_list, $1);
Ian Kent c27a1d
 	else
Ian Kent c27a1d
 		nss_ignore($1);
Ian Kent c27a1d
@@ -92,7 +93,8 @@ nss_source: SOURCE
Ian Kent c27a1d
 
Ian Kent c27a1d
 	if (!strcmp($1, "files") || !strcmp($1, "yp") ||
Ian Kent c27a1d
 	    !strcmp($1, "nis") || !strcmp($1, "ldap") ||
Ian Kent c27a1d
-	    !strcmp($1, "nisplus") || !strcmp($1, "hesiod")) {
Ian Kent c27a1d
+	    !strcmp($1, "nisplus") || !strcmp($1, "hesiod") ||
Ian Kent c27a1d
+	    !strcmp($1, "sss")) {
Ian Kent c27a1d
 		src = add_source(nss_list, $1);
Ian Kent c27a1d
 		for (a = 0; a < NSS_STATUS_MAX; a++) {
Ian Kent c27a1d
 			if (act[a].action != NSS_ACTION_UNKNOWN) {
Ian Kent 23d379
--- autofs-5.0.6.orig/modules/parse_sun.c
Ian Kent 23d379
+++ autofs-5.0.6/modules/parse_sun.c
Ian Kent 23d379
@@ -880,7 +880,7 @@ static int validate_location(unsigned in
Ian Kent c27a1d
 		    !strncmp(ptr, "file:", 5) || !strncmp(ptr, "yp:", 3) ||
Ian Kent c27a1d
 		    !strncmp(ptr, "nis:", 4) || !strncmp(ptr, "nisplus:", 8) ||
Ian Kent c27a1d
 		    !strncmp(ptr, "ldap:", 5) || !strncmp(ptr, "ldaps:", 6) ||
Ian Kent c27a1d
-		    !strncmp(ptr, "dir:", 4))
Ian Kent c27a1d
+		    !strncmp(ptr, "sss:", 4) || !strncmp(ptr, "dir:", 4))
Ian Kent c27a1d
 			return 1;
Ian Kent c27a1d
 		error(logopt,
Ian Kent c27a1d
 		      "expected colon delimeter not found in location %s",