From f4af6bb9b841db1bfd38edcd58a4783806196c60 Mon Sep 17 00:00:00 2001 From: ikent Date: Apr 17 2007 12:50:30 +0000 Subject: - upstream fix for filesystem is local check. - disable exports access control check (bz 203277). - fix patch to add command option for set a global mount options (bz 214684). --- diff --git a/autofs-5.0.1-cmd-global-options-fix.patch b/autofs-5.0.1-cmd-global-options-fix.patch new file mode 100644 index 0000000..8bf22cc --- /dev/null +++ b/autofs-5.0.1-cmd-global-options-fix.patch @@ -0,0 +1,156 @@ +diff --git a/modules/parse_sun.c b/modules/parse_sun.c +index 0494e76..99961c3 100644 +--- a/modules/parse_sun.c ++++ b/modules/parse_sun.c +@@ -264,7 +264,7 @@ int parse_init(int argc, const char *const *argv, void **context) + { + struct parse_context *ctxt; + char buf[MAX_ERR_BUF]; +- char *noptstr, *def, *val, *macros; ++ char *noptstr, *def, *val, *macros, *gbl_options; + const char *xopt; + int optlen, len, offset; + int i, bval; +@@ -397,25 +397,31 @@ int parse_init(int argc, const char *const *argv, void **context) + } + } + ++ gbl_options = NULL; + if (global_options) { ++ if (ctxt->optstr && strstr(ctxt->optstr, global_options)) ++ goto options_done; ++ gbl_options = strdup(global_options); ++ } ++ ++ if (gbl_options) { + append_options = defaults_get_append_options(); + if (append_options) { +- char *tmp = concat_options(global_options, ctxt->optstr); ++ char *tmp = concat_options(gbl_options, ctxt->optstr); + if (!tmp) { + char *estr = strerror_r(errno, buf, MAX_ERR_BUF); + error(LOGOPT_ANY, MODPREFIX "concat_options: %s", estr); ++ free(gbl_options); + } else + ctxt->optstr = tmp; + } else { + if (!ctxt->optstr) +- ctxt->optstr = strdup(global_options); +- if (!ctxt->optstr) { +- char *estr = strerror_r(errno, buf, MAX_ERR_BUF); +- warn(LOGOPT_ANY, MODPREFIX "%s", estr); +- } ++ ctxt->optstr = gbl_options; ++ else ++ free(gbl_options); + } + } +- ++options_done: + debug(LOGOPT_NONE, + MODPREFIX "init gathered global options: %s", ctxt->optstr); + +@@ -799,18 +805,23 @@ static int parse_mapent(const char *ent, char *g_options, char **options, char * + char *tmp, *newopt = NULL; + + p = parse_options(p, &newopt, logopt); +- tmp = concat_options(myoptions, newopt); +- if (!tmp) { +- char *estr; +- estr = strerror_r(errno, buf, MAX_ERR_BUF); +- error(logopt, MODPREFIX +- "concat_options: %s", estr); +- if (newopt) +- free(newopt); ++ if (newopt && strstr(newopt, myoptions)) { + free(myoptions); +- return 0; ++ myoptions = newopt; ++ } else { ++ tmp = concat_options(myoptions, newopt); ++ if (!tmp) { ++ char *estr; ++ estr = strerror_r(errno, buf, MAX_ERR_BUF); ++ error(logopt, MODPREFIX ++ "concat_options: %s", estr); ++ if (newopt) ++ free(newopt); ++ free(myoptions); ++ return 0; ++ } ++ myoptions = tmp; + } +- myoptions = tmp; + + p = skipspace(p); + } while (*p == '-'); +@@ -1042,19 +1053,24 @@ int parse_mount(struct autofs_point *ap, const char *name, + char *noptions = NULL; + + p = parse_options(p, &noptions, ap->logopt); +- tmp = concat_options(mnt_options, noptions); +- if (!tmp) { +- char *estr = strerror_r(errno, buf, MAX_ERR_BUF); +- error(ap->logopt, +- MODPREFIX "concat_options: %s", estr); +- if (noptions) +- free(noptions); +- if (mnt_options) +- free(mnt_options); +- free(options); +- return 1; ++ if (mnt_options && noptions && strstr(noptions, mnt_options)) { ++ free(mnt_options); ++ mnt_options = noptions; ++ } else { ++ tmp = concat_options(mnt_options, noptions); ++ if (!tmp) { ++ char *estr = strerror_r(errno, buf, MAX_ERR_BUF); ++ error(ap->logopt, ++ MODPREFIX "concat_options: %s", estr); ++ if (noptions) ++ free(noptions); ++ if (mnt_options) ++ free(mnt_options); ++ free(options); ++ return 1; ++ } ++ mnt_options = tmp; + } +- mnt_options = tmp; + + p = skipspace(p); + } while (*p == '-'); +@@ -1065,17 +1081,22 @@ int parse_mount(struct autofs_point *ap, const char *name, + } + + if (append_options) { +- tmp = concat_options(options, mnt_options); +- if (!tmp) { +- char *estr = strerror_r(errno, buf, MAX_ERR_BUF); +- error(ap->logopt, MODPREFIX "concat_options: %s", estr); +- if (options) +- free(options); +- if (mnt_options) +- free(mnt_options); +- return 1; ++ if (options && mnt_options && strstr(mnt_options, options)) { ++ free(options); ++ options = mnt_options; ++ } else { ++ tmp = concat_options(options, mnt_options); ++ if (!tmp) { ++ char *estr = strerror_r(errno, buf, MAX_ERR_BUF); ++ error(ap->logopt, MODPREFIX "concat_options: %s", estr); ++ if (options) ++ free(options); ++ if (mnt_options) ++ free(mnt_options); ++ return 1; ++ } ++ options = tmp; + } +- options = tmp; + } else + options = mnt_options; + } diff --git a/autofs-5.0.1-disable-exports-check.patch b/autofs-5.0.1-disable-exports-check.patch new file mode 100644 index 0000000..387fc52 --- /dev/null +++ b/autofs-5.0.1-disable-exports-check.patch @@ -0,0 +1,13 @@ +diff --git a/modules/lookup_hosts.c b/modules/lookup_hosts.c +index f6a65ae..a9a4c75 100644 +--- a/modules/lookup_hosts.c ++++ b/modules/lookup_hosts.c +@@ -208,7 +208,7 @@ done: + exp = rpc_get_exports(name, 10, 0, RPC_CLOSE_NOLINGER); + + /* Check exports for obvious ones we don't have access to */ +- exp = rpc_exports_prune(exp); ++ /*exp = rpc_exports_prune(exp);*/ + + mapent = NULL; + while (exp) { diff --git a/autofs-5.0.1-localfs-label-check.patch b/autofs-5.0.1-localfs-label-check.patch new file mode 100644 index 0000000..accdaa9 --- /dev/null +++ b/autofs-5.0.1-localfs-label-check.patch @@ -0,0 +1,15 @@ +diff --git a/lib/mounts.c b/lib/mounts.c +index 524f0ee..0e428e8 100644 +--- a/lib/mounts.c ++++ b/lib/mounts.c +@@ -371,7 +371,9 @@ int contained_in_local_fs(const char *path) + ret = 1; + } else + ret = 1; +- } ++ } else if (!strncmp("LABEL=", this->fs_name, 6) || ++ !strncmp("UUID=", this->fs_name, 5)) ++ ret = 1; + break; + } + } diff --git a/autofs.spec b/autofs.spec index a6bf436..52a3065 100644 --- a/autofs.spec +++ b/autofs.spec @@ -4,7 +4,7 @@ Summary: A tool for automatically mounting and unmounting filesystems Name: autofs Version: 5.0.1 -Release: 8 +Release: 9 Epoch: 1 License: GPL Group: System Environment/Daemons @@ -24,6 +24,9 @@ Patch11: autofs-5.0.1-map-update-source-only.patch Patch12: autofs-5.0.1-null-domain-fix.patch Patch13: autofs-5.0.1-conf-append-global.patch Patch14: autofs-5.0.1-cmd-global-options.patch +Patch15: autofs-5.0.1-localfs-label-check.patch +Patch16: autofs-5.0.1-disable-exports-check.patch +Patch17: autofs-5.0.1-cmd-global-options-fix.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 @@ -79,6 +82,9 @@ echo %{version}-%{release} > .version %patch12 -p1 %patch13 -p1 %patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 %build #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir} @@ -131,6 +137,11 @@ fi %{_libdir}/autofs/ %changelog +* Tue Apr 17 2007 Ian Kent - 5.0.1-9 +- upstream fix for filesystem is local check. +- disable exports access control check (bz 203277). +- fix patch to add command option for set a global mount options (bz 214684). + * Mon Apr 16 2007 Ian Kent - 5.0.1-8 - add configuration variable to control appending of global options (bz 214684). - add command option to set a global mount options string (bz 214684).