diff --git a/autofs-5.1.0-clarify-multiple-mounts-description.patch b/autofs-5.1.0-clarify-multiple-mounts-description.patch new file mode 100644 index 0000000..fa4b31a --- /dev/null +++ b/autofs-5.1.0-clarify-multiple-mounts-description.patch @@ -0,0 +1,49 @@ +autofs-5.1.0 - clarify multiple mounts description + +From: Ian Kent + +Try and clarify the "Multiple Mounts" and "Replicated Server" sections +in the autofs(5) man page. +--- + CHANGELOG | 1 + + man/autofs.5 | 8 ++++++-- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 519fea3..c6d8933 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -30,6 +30,7 @@ + - fix reset amd lexer scan buffer. + - ignore multiple commas in options strings. + - fix typo in flagdir configure option. ++- clarify multiple mounts description. + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/man/autofs.5 b/man/autofs.5 +index 81ae375..6c53520 100644 +--- a/man/autofs.5 ++++ b/man/autofs.5 +@@ -211,15 +211,19 @@ can be used to name multiple filesystems to mount. It takes the form: + .RS +.2i + .ta 1.0i + .nf +-.BI "key [" -options "] [mount-point [" -options "] location...]..." ++.BI "key [ -options ] [[/] location [/relative-mount-point [ -options ] location...]..." + .fi + .RE + .sp + .P + This may extend over multiple lines, quoting the line-breaks with \`\\\'. + If present, the per-mountpoint mount-options are appended to the +-default mount-options. ++default mount-options. This behaviour may be overridden by the append_options ++configuration setting. + .SS Replicated Server ++A mount location can specify multiple hosts for a location, portentially ++with a different export path for the same file system. Historically these ++different locations are read-only and provide the same replicated file system. + .sp + .RS +.2i + .ta 1.5i diff --git a/autofs-5.1.0-fix-hosts-map-options-check-in-lookup_amd_instance.patch b/autofs-5.1.0-fix-hosts-map-options-check-in-lookup_amd_instance.patch new file mode 100644 index 0000000..d118814 --- /dev/null +++ b/autofs-5.1.0-fix-hosts-map-options-check-in-lookup_amd_instance.patch @@ -0,0 +1,36 @@ +autofs-5.1.0 - fix hosts map options check in lookup_amd_instance() + +From: Ian Kent + +Ongoing bug fixes have caused a hosts map source check in lookup_amd_instance() +to be inconsistent and consequently not find the iexpected map source. +--- + CHANGELOG | 1 + + daemon/lookup.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG b/CHANGELOG +index f291095..d693bce 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -22,6 +22,7 @@ + - fix leak in parse_mount(). + - add mutex call return check in defaults.c. + - force disable browse mode for amd format maps. ++- fix hosts map options check in lookup_amd_instance(). + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/daemon/lookup.c b/daemon/lookup.c +index 1761f7e..1a0881f 100644 +--- a/daemon/lookup.c ++++ b/daemon/lookup.c +@@ -843,7 +843,7 @@ static int lookup_amd_instance(struct autofs_point *ap, + return NSS_STATUS_UNKNOWN; + } + +- if (entry->opts) { ++ if (entry->opts && *entry->opts) { + argv[0] = entry->opts; + argv[1] = NULL; + pargv = argv; diff --git a/autofs-5.1.0-fix-mem-leak-in-create_client.patch b/autofs-5.1.0-fix-mem-leak-in-create_client.patch new file mode 100644 index 0000000..1eeb57e --- /dev/null +++ b/autofs-5.1.0-fix-mem-leak-in-create_client.patch @@ -0,0 +1,39 @@ +autofs-5.1.0 - fix memory leak in create_client() + +From: Ian Kent + +In create_client(), if the target host is unreachable the function +exists without freeing the addrinfo data returned from getaddrinfo(3). +--- + CHANGELOG | 1 + + lib/rpc_subs.c | 4 +++- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG b/CHANGELOG +index d693bce..0cb1d36 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -23,6 +23,7 @@ + - add mutex call return check in defaults.c. + - force disable browse mode for amd format maps. + - fix hosts map options check in lookup_amd_instance(). ++- fix memory leak in create_client(). + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c +index 5d6ead0..846c40e 100644 +--- a/lib/rpc_subs.c ++++ b/lib/rpc_subs.c +@@ -720,8 +720,10 @@ static int create_client(struct conn_info *info, CLIENT **client) + ret = rpc_do_create_client(haddr->ai_addr, info, &fd, client); + if (ret == 0) + break; +- if (ret == -EHOSTUNREACH) ++ if (ret == -EHOSTUNREACH) { ++ freeaddrinfo(ai); + goto out_close; ++ } + + if (!info->client && fd != RPC_ANYSOCK) { + close(fd); diff --git a/autofs-5.1.0-fix-memory-leak-in-get_defaults_entry.patch b/autofs-5.1.0-fix-memory-leak-in-get_defaults_entry.patch new file mode 100644 index 0000000..7cb5bc3 --- /dev/null +++ b/autofs-5.1.0-fix-memory-leak-in-get_defaults_entry.patch @@ -0,0 +1,39 @@ +autofs-5.1.0 - fix memory leak in get_defaults_entry() + +From: Ian Kent + +In get_defaults_entry(), if parsing of the expanded defaults string fails +the expanded string used for the parse is not freed. +--- + CHANGELOG | 1 + + modules/parse_amd.c | 4 +++- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 2bb0500..439a51f 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -25,6 +25,7 @@ + - fix hosts map options check in lookup_amd_instance(). + - fix memory leak in create_client(). + - fix memory leak in get_exports(). ++- fix memory leak in get_defaults_entry(). + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/modules/parse_amd.c b/modules/parse_amd.c +index a912385..ebf3807 100644 +--- a/modules/parse_amd.c ++++ b/modules/parse_amd.c +@@ -1797,8 +1797,10 @@ static struct amd_entry *get_defaults_entry(struct autofs_point *ap, + char *expand; + if (!expand_selectors(ap, defaults, &expand, sv)) + goto out; +- if (amd_parse_list(ap, expand, &dflts, &sv)) ++ if (amd_parse_list(ap, expand, &dflts, &sv)) { ++ free(expand); + goto out; ++ } + entry = select_default_entry(ap, &dflts, sv); + if (!entry->map_type) { + /* diff --git a/autofs-5.1.0-fix-memory-leak-in-get_exports.patch b/autofs-5.1.0-fix-memory-leak-in-get_exports.patch new file mode 100644 index 0000000..fd89d9c --- /dev/null +++ b/autofs-5.1.0-fix-memory-leak-in-get_exports.patch @@ -0,0 +1,85 @@ +autofs-5.1.0 - fix memory leak in get_exports() + +From: Ian Kent + +In modules/lookup_hosts.c:get_exports() looping over the returned list of +exports uses the pointer that contains the list. The pointer is updated +in the process of creating the exports multi-mount so a pointer to the +returned list is no longer available to be freed when done. +--- + CHANGELOG | 1 + + modules/lookup_hosts.c | 17 +++++++++-------- + 2 files changed, 10 insertions(+), 8 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 0cb1d36..2bb0500 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -24,6 +24,7 @@ + - force disable browse mode for amd format maps. + - fix hosts map options check in lookup_amd_instance(). + - fix memory leak in create_client(). ++- fix memory leak in get_exports(). + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/modules/lookup_hosts.c b/modules/lookup_hosts.c +index ea8f5d6..9d689ff 100644 +--- a/modules/lookup_hosts.c ++++ b/modules/lookup_hosts.c +@@ -82,18 +82,19 @@ static char *get_exports(struct autofs_point *ap, const char *host) + { + char buf[MAX_ERR_BUF]; + char *mapent; +- exports exp; ++ exports exp, this; + + debug(ap->logopt, MODPREFIX "fetchng export list for %s", host); + + exp = rpc_get_exports(host, 10, 0, RPC_CLOSE_NOLINGER); + + mapent = NULL; +- while (exp) { ++ this = exp; ++ while (this) { + if (mapent) { + int len = strlen(mapent) + 1; + +- len += strlen(host) + 2*(strlen(exp->ex_dir) + 2) + 3; ++ len += strlen(host) + 2*(strlen(this->ex_dir) + 2) + 3; + mapent = realloc(mapent, len); + if (!mapent) { + char *estr; +@@ -103,10 +104,10 @@ static char *get_exports(struct autofs_point *ap, const char *host) + return NULL; + } + strcat(mapent, " \""); +- strcat(mapent, exp->ex_dir); ++ strcat(mapent, this->ex_dir); + strcat(mapent, "\""); + } else { +- int len = 2*(strlen(exp->ex_dir) + 2) + strlen(host) + 3; ++ int len = 2*(strlen(this->ex_dir) + 2) + strlen(host) + 3; + + mapent = malloc(len); + if (!mapent) { +@@ -117,16 +118,16 @@ static char *get_exports(struct autofs_point *ap, const char *host) + return NULL; + } + strcpy(mapent, "\""); +- strcat(mapent, exp->ex_dir); ++ strcat(mapent, this->ex_dir); + strcat(mapent, "\""); + } + strcat(mapent, " \""); + strcat(mapent, host); + strcat(mapent, ":"); +- strcat(mapent, exp->ex_dir); ++ strcat(mapent, this->ex_dir); + strcat(mapent, "\""); + +- exp = exp->ex_next; ++ this = this->ex_next; + } + rpc_exports_free(exp); + diff --git a/autofs-5.1.0-fix-out-of-order-clearing-of-options-buffer.patch b/autofs-5.1.0-fix-out-of-order-clearing-of-options-buffer.patch new file mode 100644 index 0000000..ff7e71e --- /dev/null +++ b/autofs-5.1.0-fix-out-of-order-clearing-of-options-buffer.patch @@ -0,0 +1,43 @@ +autofs-5.1.0 - fix out of order clearing of options buffer + +From: Ian Kent + +When setting the result of parsing an options string the options buffer +was being cleared before use. +--- + CHANGELOG | 1 + + modules/amd_parse.y | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 439a51f..51c935d 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -26,6 +26,7 @@ + - fix memory leak in create_client(). + - fix memory leak in get_exports(). + - fix memory leak in get_defaults_entry(). ++- fix out of order clearing of options buffer. + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/modules/amd_parse.y b/modules/amd_parse.y +index f65ab7a..a7f38f8 100644 +--- a/modules/amd_parse.y ++++ b/modules/amd_parse.y +@@ -396,7 +396,6 @@ option_assignment: MAP_OPTION OPTION_ASSIGN FS_TYPE + } + | MNT_OPTION OPTION_ASSIGN options + { +- memset(opts, 0, sizeof(opts)); + if (!strcmp($1, "opts")) + entry.opts = amd_strdup(opts); + else if (!strcmp($1, "addopts")) +@@ -407,6 +406,7 @@ option_assignment: MAP_OPTION OPTION_ASSIGN FS_TYPE + amd_notify($1); + YYABORT; + } ++ memset(opts, 0, sizeof(opts)); + } + | MNT_OPTION OPTION_ASSIGN + { diff --git a/autofs-5.1.0-fix-reset-amd-lexer-scan-buffer.patch b/autofs-5.1.0-fix-reset-amd-lexer-scan-buffer.patch new file mode 100644 index 0000000..2d64e3f --- /dev/null +++ b/autofs-5.1.0-fix-reset-amd-lexer-scan-buffer.patch @@ -0,0 +1,231 @@ +autofs-5.1.0 - fix reset amd lexer scan buffer + +From: Ian Kent + +When the amd parser encounters an error often the lexer is left in +a state where a new parse can't be started. Fix this by explicitly +naming our start states and resetting to the proper start state at +buffer initialization on each scan. +--- + CHANGELOG | 1 + + modules/amd_tok.l | 59 +++++++++++++++++++++++++++++++-------------------- + modules/parse_amd.c | 3 +++ + 3 files changed, 40 insertions(+), 23 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 51c935d..fe9b2f9 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -27,6 +27,7 @@ + - fix memory leak in get_exports(). + - fix memory leak in get_defaults_entry(). + - fix out of order clearing of options buffer. ++- fix reset amd lexer scan buffer. + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/modules/amd_tok.l b/modules/amd_tok.l +index 1d9c234..36bce49 100644 +--- a/modules/amd_tok.l ++++ b/modules/amd_tok.l +@@ -1,4 +1,3 @@ +-%{ + /* ----------------------------------------------------------------------- * + * + * Copyright 2013 Ian Kent +@@ -18,6 +17,12 @@ + * + * ----------------------------------------------------------------------- */ + ++%s START MAPOPTVAL FSOPTVAL MNTOPTVAL SELOPTVAL SELARGVAL ++ ++%{ ++ ++static int reset_start_state = 0; ++ + #ifdef ECHO + # undef ECHO + #endif +@@ -71,8 +76,6 @@ int amd_yyinput(char *, int); + + %option nounput + +-%x MAPOPTVAL FSOPTVAL MNTOPTVAL SELOPTVAL SELARGVAL +- + NL \r?\n + OPTWS [[:blank:]]* + OTHR [^!;:=/|\- \t\r\n#]* +@@ -120,7 +123,14 @@ CUTSEP (\|\||\/) + + %% + +-{ ++%{ ++ if (reset_start_state) { ++ BEGIN START; ++ reset_start_state = 0; ++ } ++%} ++ ++{ + {NL} | + \x00 { } + +@@ -179,23 +189,23 @@ CUTSEP (\|\||\/) + + { + {NL} { +- BEGIN(INITIAL); ++ BEGIN(START); + yyless(1); + } + + \x00 { +- BEGIN(INITIAL); ++ BEGIN(START); + return SEPERATOR; + yyless(1); + } + + ";" { +- BEGIN(INITIAL); ++ BEGIN(START); + return SEPERATOR; + } + + {OPTWS} { +- BEGIN(INITIAL); ++ BEGIN(START); + return SPACE; + } + +@@ -224,23 +234,23 @@ CUTSEP (\|\||\/) + + { + {NL} { +- BEGIN(INITIAL); ++ BEGIN(START); + yyless(1); + } + + \x00 { +- BEGIN(INITIAL); ++ BEGIN(START); + return SEPERATOR; + yyless(1); + } + + ";" { +- BEGIN(INITIAL); ++ BEGIN(START); + return SEPERATOR; + } + + {OPTWS} { +- BEGIN(INITIAL); ++ BEGIN(START); + return SPACE; + } + +@@ -254,23 +264,23 @@ CUTSEP (\|\||\/) + + { + {NL} { +- BEGIN(INITIAL); ++ BEGIN(START); + yyless(1); + } + + \x00 { +- BEGIN(INITIAL); ++ BEGIN(START); + return SEPERATOR; + yyless(1); + } + + ";" { +- BEGIN(INITIAL); ++ BEGIN(START); + return SEPERATOR; + } + + {OPTWS} { +- BEGIN(INITIAL); ++ BEGIN(START); + return SPACE; + } + +@@ -286,23 +296,23 @@ CUTSEP (\|\||\/) + + { + {NL} { +- BEGIN(INITIAL); ++ BEGIN(START); + yyless(1); + } + + \x00 { +- BEGIN(INITIAL); ++ BEGIN(START); + return SEPERATOR; + yyless(1); + } + + ";" { +- BEGIN(INITIAL); ++ BEGIN(START); + return SEPERATOR; + } + + {OPTWS} { +- BEGIN(INITIAL); ++ BEGIN(START); + return SPACE; + } + +@@ -318,18 +328,18 @@ CUTSEP (\|\||\/) + + { + {NL} { +- BEGIN(INITIAL); ++ BEGIN(START); + yyless(1); + } + + \x00 { +- BEGIN(INITIAL); ++ BEGIN(START); + return SEPERATOR; + yyless(1); + } + + ";" { +- BEGIN(INITIAL); ++ BEGIN(START); + return SEPERATOR; + } + +@@ -391,6 +401,9 @@ static void amd_echo(void) + + void amd_set_scan_buffer(const char *buffer) + { ++ YY_FLUSH_BUFFER; ++ reset_start_state = 1; ++ + line = buffer; + line_pos = &line[0]; + /* +diff --git a/modules/parse_amd.c b/modules/parse_amd.c +index ebf3807..9590cf4 100644 +--- a/modules/parse_amd.c ++++ b/modules/parse_amd.c +@@ -1798,6 +1798,9 @@ static struct amd_entry *get_defaults_entry(struct autofs_point *ap, + if (!expand_selectors(ap, defaults, &expand, sv)) + goto out; + if (amd_parse_list(ap, expand, &dflts, &sv)) { ++ error(ap->logopt, MODPREFIX ++ "failed to parse defaults entry, " ++ "attempting to use internal default"); + free(expand); + goto out; + } diff --git a/autofs-5.1.0-fix-typo-in-flagdir-configure-option.patch b/autofs-5.1.0-fix-typo-in-flagdir-configure-option.patch new file mode 100644 index 0000000..01698e5 --- /dev/null +++ b/autofs-5.1.0-fix-typo-in-flagdir-configure-option.patch @@ -0,0 +1,51 @@ +autofs-5.1.0 - fix typo in flagdir configure option + +From: Michael Tokarev + +This problem was originally reported, and a patch offered, by +Michael Tokarev but was inadvertantly missed, so the change is +credited to him in retrospect. +--- + CHANGELOG | 1 + + configure | 2 +- + configure.in | 2 +- + 3 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 2b7d55a..519fea3 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -29,6 +29,7 @@ + - fix out of order clearing of options buffer. + - fix reset amd lexer scan buffer. + - ignore multiple commas in options strings. ++- fix typo in flagdir configure option. + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/configure b/configure +index dcb82cd..2349bf9 100755 +--- a/configure ++++ b/configure +@@ -2381,7 +2381,7 @@ if test "${with_flagdir+set}" = set; then : + then + : + else +- filagdir="${withval}" ++ flagdir="${withval}" + fi + + fi +diff --git a/configure.in b/configure.in +index cd3e7a3..b92f3c5 100644 +--- a/configure.in ++++ b/configure.in +@@ -114,7 +114,7 @@ AC_ARG_WITH(flagdir, + then + : + else +- filagdir="${withval}" ++ flagdir="${withval}" + fi + ) + AC_MSG_CHECKING([for autofs flag file directory]) diff --git a/autofs-5.1.0-force-disable-browse-mode-for-amd-format-maps.patch b/autofs-5.1.0-force-disable-browse-mode-for-amd-format-maps.patch new file mode 100644 index 0000000..e07ffbc --- /dev/null +++ b/autofs-5.1.0-force-disable-browse-mode-for-amd-format-maps.patch @@ -0,0 +1,52 @@ +autofs-5.1.0 - force disable browse mode for amd format maps + +From: Ian Kent + +As in am-utils amd format maps using autofs file system don't support +the browse option and in autofs they don't work properly if it is used. + +This might be implemented later but for now forcefully disable it. +--- + CHANGELOG | 1 + + lib/master_parse.y | 2 ++ + modules/mount_autofs.c | 2 ++ + 3 files changed, 5 insertions(+) + +diff --git a/CHANGELOG b/CHANGELOG +index 31a804d..f291095 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -21,6 +21,7 @@ + - fix copy and paste error in dup_defaults_entry(). + - fix leak in parse_mount(). + - add mutex call return check in defaults.c. ++- force disable browse mode for amd format maps. + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/lib/master_parse.y b/lib/master_parse.y +index e31023d..9da78fc 100644 +--- a/lib/master_parse.y ++++ b/lib/master_parse.y +@@ -810,6 +810,8 @@ int master_parse_entry(const char *buffer, unsigned int default_timeout, unsigne + logopt = LOGOPT_DEBUG; + else if (loglevel <= LOG_INFO && loglevel > LOG_ERR) + logopt = LOGOPT_VERBOSE; ++ /* amd mounts don't support browse mode */ ++ ghost = 0; + } + + +diff --git a/modules/mount_autofs.c b/modules/mount_autofs.c +index c7cba3a..4846e7f 100644 +--- a/modules/mount_autofs.c ++++ b/modules/mount_autofs.c +@@ -261,6 +261,8 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, + nap->pref = am_entry->pref; + am_entry->pref = NULL; + } ++ /* amd mounts don't support browse mode */ ++ nap->flags &= ~MOUNT_FLAG_GHOST; + } + + if (handle_mounts_startup_cond_init(&suc)) { diff --git a/autofs-5.1.0-gaurd-against-incorrect-umount-return.patch b/autofs-5.1.0-gaurd-against-incorrect-umount-return.patch new file mode 100644 index 0000000..8c231ab --- /dev/null +++ b/autofs-5.1.0-gaurd-against-incorrect-umount-return.patch @@ -0,0 +1,63 @@ +autofs-5.1.0 - gaurd against incorrect umount return + +From: Ian Kent + +If umount(8) returns a fail but the mount is actually umounted autofs +can incorrectly try reconstruct mount triggers. This can lead to the +automount point becoming unresponsive. +--- + CHANGELOG | 1 + + daemon/automount.c | 3 ++- + lib/mounts.c | 6 ++++-- + 3 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index c6d8933..f7b2ec1 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -31,6 +31,7 @@ + - ignore multiple commas in options strings. + - fix typo in flagdir configure option. + - clarify multiple mounts description. ++- gaurd against incorrect umount return. + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/daemon/automount.c b/daemon/automount.c +index 64dc305..229cb1a 100644 +--- a/daemon/automount.c ++++ b/daemon/automount.c +@@ -532,7 +532,8 @@ static int umount_subtree_mounts(struct autofs_point *ap, const char *path, unsi + if (!is_mm_root && is_mounted(_PATH_MOUNTED, path, MNTS_REAL)) { + struct amd_entry *entry; + debug(ap->logopt, "unmounting dir = %s", path); +- if (umount_ent(ap, path)) { ++ if (umount_ent(ap, path) && ++ is_mounted(_PATH_MOUNTED, path, MNTS_REAL)) { + warn(ap->logopt, "could not umount dir %s", path); + left++; + goto done; +diff --git a/lib/mounts.c b/lib/mounts.c +index f635371..27ea744 100644 +--- a/lib/mounts.c ++++ b/lib/mounts.c +@@ -2165,7 +2165,8 @@ int umount_multi_triggers(struct autofs_point *ap, struct mapent *me, char *root + */ + if (is_mounted(_PATH_MOUNTED, root, MNTS_REAL)) { + info(ap->logopt, "unmounting dir = %s", root); +- if (umount_ent(ap, root)) { ++ if (umount_ent(ap, root) && ++ is_mounted(_PATH_MOUNTED, root, MNTS_REAL)) { + if (mount_multi_triggers(ap, me, root, strlen(root), "/") < 0) + warn(ap->logopt, + "failed to remount offset triggers"); +@@ -2266,7 +2267,8 @@ int clean_stale_multi_triggers(struct autofs_point *ap, + */ + if (oe->ioctlfd != -1 || + is_mounted(_PROC_MOUNTS, oe->key, MNTS_REAL)) { +- if (umount_ent(ap, oe->key)) { ++ if (umount_ent(ap, oe->key) && ++ is_mounted(_PROC_MOUNTS, oe->key, MNTS_REAL)) { + debug(ap->logopt, + "offset %s has active mount, invalidate", + oe->key); diff --git a/autofs-5.1.0-ignore-multiple-commas-in-options-strings.patch b/autofs-5.1.0-ignore-multiple-commas-in-options-strings.patch new file mode 100644 index 0000000..50d6c62 --- /dev/null +++ b/autofs-5.1.0-ignore-multiple-commas-in-options-strings.patch @@ -0,0 +1,56 @@ +autofs-5.1.0 - ignore multiple commas in options strings + +From: Ian Kent + +When parsing options strings (such as opts, addopts or remopts) the parser +would object to multiple occurrances of the comma character. But this is +probably not a significant problem and the parser should just ignore them. +--- + CHANGELOG | 1 + + modules/amd_parse.y | 4 ++++ + modules/amd_tok.l | 4 ++-- + 3 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index fe9b2f9..2b7d55a 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -28,6 +28,7 @@ + - fix memory leak in get_defaults_entry(). + - fix out of order clearing of options buffer. + - fix reset amd lexer scan buffer. ++- ignore multiple commas in options strings. + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/modules/amd_parse.y b/modules/amd_parse.y +index a7f38f8..ce8623d 100644 +--- a/modules/amd_parse.y ++++ b/modules/amd_parse.y +@@ -465,6 +465,10 @@ options: OPTION + { + prepend_opt(opts, $1); + } ++ | OPTION COMMA ++ { ++ prepend_opt(opts, $1); ++ } + ; + + %% +diff --git a/modules/amd_tok.l b/modules/amd_tok.l +index 36bce49..03e716f 100644 +--- a/modules/amd_tok.l ++++ b/modules/amd_tok.l +@@ -284,9 +284,9 @@ CUTSEP (\|\||\/) + return SPACE; + } + +- ":=" { return OPTION_ASSIGN; } ++ (:=)(,+)? { return OPTION_ASSIGN; } + +- "," { return COMMA; } ++ ,+ { return COMMA; } + + {OPTS} { + amd_copy_buffer(); diff --git a/autofs-5.1.0-update-man-page-autofs-8-for-systemd.patch b/autofs-5.1.0-update-man-page-autofs-8-for-systemd.patch new file mode 100644 index 0000000..bdd47c4 --- /dev/null +++ b/autofs-5.1.0-update-man-page-autofs-8-for-systemd.patch @@ -0,0 +1,116 @@ +autofs-5.1.0 - update man page autofs(8) for systemd + +From: Ian Kent + +Update the autofs(8) man page to account for systems using systemd. +--- + CHANGELOG | 1 + + man/autofs.8.in | 51 +++++++++++++++++++++++++++++++++++++-------------- + 2 files changed, 38 insertions(+), 14 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index f7b2ec1..b0dce1e 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -32,6 +32,7 @@ + - fix typo in flagdir configure option. + - clarify multiple mounts description. + - gaurd against incorrect umount return. ++- update man page autofs(8) for systemd. + + 04/06/2014 autofs-5.1.0 + ======================= +diff --git a/man/autofs.8.in b/man/autofs.8.in +index 7ab4242..dffbeac 100644 +--- a/man/autofs.8.in ++++ b/man/autofs.8.in +@@ -1,23 +1,30 @@ + .TH AUTOFS 8 "9 Sep 1997" + .SH NAME +-@@initdir@@/autofs \- Control Script for automounter ++Service control for the automounter + .SH SYNOPSIS ++If a SysV init script system is being used: ++.br + .B @@initdir@@/autofs + .I start|stop|restart|reload|status ++.P ++or if the systemd init system is being used: ++.br ++.B systemctl ++.I start|stop|restart|reload|status ++.B autofs.service + .SH "DESCRIPTION" + .B autofs + controls the operation of the + .BR automount (8) +-daemons running on the Linux system. Usually ++daemon(s) running on the Linux system. Usually + .B autofs + is invoked at system boot time with the + .I start + parameter and at shutdown time with the + .I stop +-parameter. The +-.B autofs +-script can also be manually invoked by the system administrator to shut +-down, restart or reload the automounters. ++parameter. Service control actions can also be manually invoked by ++the system administrator to shut down, restart, reload or obtain ++service status. + .P + .SH "OPERATION" + .B autofs +@@ -31,28 +38,44 @@ will mount and start a thread, with the appropriate parameters, to + manage the mount point. + .P + .B @@initdir@@/autofs reload +-will check the current auto.master map against running daemons. It will kill +-those daemons whose entries have changed and then start daemons for new or +-changed entries. ++or ++.B systemctl autofs.service reload ++will check the current auto.master map against the current automount managed ++mounts. It will terminate those daemons or threads (depending on ++.B autofs ++version) whose entries have been removed, re-read the automount maps for ++entries that have changed and start new daemons or threads for entries ++that have been added. + .P +-If a map is modified then the change will become effective immediately. If +-the ++If an indirect map is modified then the change will become effective immediately. ++If an indirect map uses the ++.B browse ++option, the master map contains direct mount maps or the + .I auto.master + map is modified then the + .B autofs +-script must be rerun to activate the changes. ++service control reload action must be rerun to activate the changes. + .P + .B @@initdir@@/autofs status ++or ++.B systemctl autofs.service status + will display the status of, + .BR automount (8) +-,running or not. ++,running or not. When using the systemd init system the status output includes ++somewhat more information related to the service status. ++.P ++.B systemctl(1) ++has more functions than the actions mentioned here, see ++.B systemctl(1) ++for more information. + .SH "SEE ALSO" + .BR automount (8), + .BR autofs (5), + .BR autofs.conf (5), + .BR auto.master (5). + .BR autofs_ldap_auth.conf (5) ++.BR systemctl(1) + .SH AUTHOR + This manual page was written by Christoph Lameter , + for the Debi GNU/Linux system. Edited by H. Peter Anvin +-. ++ and Ian Kent . diff --git a/autofs.spec b/autofs.spec index 33b9402..2a590f6 100644 --- a/autofs.spec +++ b/autofs.spec @@ -8,7 +8,7 @@ Summary: A tool for automatically mounting and unmounting filesystems Name: autofs Version: 5.1.0 -Release: 6%{?dist} +Release: 7%{?dist} Epoch: 1 License: GPLv2+ Group: System Environment/Daemons @@ -34,6 +34,18 @@ Patch18: autofs-5.1.0-fix-some-out-of-order-evaluations-in-parse_amd_c.patch Patch19: autofs-5.1.0-fix-copy-and-paste-error-in-dup_defaults_entry.patch Patch20: autofs-5.1.0-fix-leak-in-parse_mount.patch Patch21: autofs-5.1.0-add-mutex-call-return-check-in-defaults_c.patch +Patch22: autofs-5.1.0-force-disable-browse-mode-for-amd-format-maps.patch +Patch23: autofs-5.1.0-fix-hosts-map-options-check-in-lookup_amd_instance.patch +Patch24: autofs-5.1.0-fix-mem-leak-in-create_client.patch +Patch25: autofs-5.1.0-fix-memory-leak-in-get_exports.patch +Patch26: autofs-5.1.0-fix-memory-leak-in-get_defaults_entry.patch +Patch27: autofs-5.1.0-fix-out-of-order-clearing-of-options-buffer.patch +Patch28: autofs-5.1.0-fix-reset-amd-lexer-scan-buffer.patch +Patch29: autofs-5.1.0-ignore-multiple-commas-in-options-strings.patch +Patch30: autofs-5.1.0-fix-typo-in-flagdir-configure-option.patch +Patch31: autofs-5.1.0-clarify-multiple-mounts-description.patch +Patch32: autofs-5.1.0-gaurd-against-incorrect-umount-return.patch +Patch33: autofs-5.1.0-update-man-page-autofs-8-for-systemd.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if %{with_systemd} BuildRequires: systemd-units @@ -41,7 +53,6 @@ BuildRequires: systemd-units BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, libxml2-devel, cyrus-sasl-devel, openssl-devel module-init-tools util-linux nfs-utils e2fsprogs libtirpc-devel BuildRequires: libsss_autofs Conflicts: cyrus-sasl-lib < 2.1.23-9 -Requires: kernel >= 2.6.17 Requires: bash coreutils sed gawk textutils sh-utils grep module-init-tools /bin/ps %if %{with_systemd} Requires(post): systemd-sysv @@ -112,6 +123,18 @@ echo %{version}-%{release} > .version %patch19 -p1 %patch20 -p1 %patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 +%patch27 -p1 +%patch28 -p1 +%patch29 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 %build LDFLAGS=-Wl,-z,now @@ -204,6 +227,21 @@ fi %dir /etc/auto.master.d %changelog +* Wed Oct 15 2014 Ian Kent - 1:5.1.0-7 +- force disable browse mode for amd format maps. +- fix hosts map options check in lookup_amd_instance(). +- fix memory leak in create_client(). +- fix memory leak in get_exports(). +- fix memory leak in get_defaults_entry(). +- fix out of order clearing of options buffer. +- fix reset amd lexer scan buffer. +- ignore multiple commas in options strings. +- fix typo in flagdir configure option. +- clarify multiple mounts description. +- gaurd against incorrect umount return. +- update man page autofs(8) for systemd. +- remove ancient kernel Requires. + * Fri Aug 15 2014 Fedora Release Engineering - 1:5.1.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild