Blame SOURCES/autofs-5.1.7-Fix-option-for-master_read_wait.patch

96dc52
autofs-5.1.7 - Fix option for master read wait
96dc52
96dc52
From: Goldwyn Rodrigues <rgoldwyn@suse.de>
96dc52
96dc52
The master-wait program option expects a value, and if provided
96dc52
automount crashes with the following trace:
96dc52
96dc52
#0  __GI_____strtoul_l_internal (nptr=0x0, endptr=0x7fffffffe120, base=0, group=<optimized out>,
96dc52
    loc=0x7ffff77a63a0 <_nl_global_locale>) at ../stdlib/strtol_l.c:292
96dc52
#1  0x0000555555562c52 in getnumopt ()
96dc52
#2  0x0000555555564ec0 in main ()
96dc52
96dc52
This is because the options string is not correct and does not expect
96dc52
an argument for master-wait (M), which sets optarg to NULL.
96dc52
96dc52
Fixes: e68f07f ("autofs-5.1.2 - add master read wait option")
96dc52
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
96dc52
Signed-off-by: Ian Kent <raven@themaw.net>
96dc52
---
96dc52
 CHANGELOG          |    1 +
96dc52
 daemon/automount.c |    2 +-
96dc52
 2 files changed, 2 insertions(+), 1 deletion(-)
96dc52
96dc52
diff --git a/CHANGELOG b/CHANGELOG
96dc52
index fe49740e..0b577909 100644
96dc52
--- a/CHANGELOG
96dc52
+++ b/CHANGELOG
96dc52
@@ -4,6 +4,7 @@
96dc52
 - dont use realloc in host exports list processing.
96dc52
 - use sprintf() when constructing hosts mapent.
96dc52
 - fix mnts_remove_amdmount() uses wrong list.
96dc52
+- Fix option for master read wait.
96dc52
 
96dc52
 25/01/2021 autofs-5.1.7
96dc52
 - make bind mounts propagation slave by default.
96dc52
diff --git a/daemon/automount.c b/daemon/automount.c
96dc52
index e476f6b2..7fa92877 100644
96dc52
--- a/daemon/automount.c
96dc52
+++ b/daemon/automount.c
96dc52
@@ -2274,7 +2274,7 @@ int main(int argc, char *argv[])
96dc52
 	time_t timeout;
96dc52
 	time_t age = monotonic_time(NULL);
96dc52
 	struct rlimit rlim;
96dc52
-	const char *options = "+hp:t:vmdD:SfVrO:l:n:CFUM";
96dc52
+	const char *options = "+hp:t:vmdD:SfVrO:l:n:CFUM:";
96dc52
 	static const struct option long_options[] = {
96dc52
 		{"help", 0, 0, 'h'},
96dc52
 		{"pid-file", 1, 0, 'p'},