All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Kent <raven@themaw.net>
To: autofs mailing list <autofs@vger.kernel.org>
Subject: [PATCH 06/20] autofs-5.1.4 - fix prefix option handling in expand_entry()
Date: Wed, 14 Feb 2018 14:43:25 +0800	[thread overview]
Message-ID: <151859060538.8026.6393319689523285634.stgit@pluto.themaw.net> (raw)
In-Reply-To: <151859051902.8026.13693256398323544616.stgit@pluto.themaw.net>

The changes to fix the defaults handling in the amd map parser caused
the prefix option to not be expanded and also to not be propagated to
submounts in some cases.

But the prefix should be expanded in modules/parse_amd.c:expand_entry()
along with the reset of the amd map entry fields.

Just adding this to modules/parse_amd.c:expand_entry() (where it should
be) fixes the amd map entry expansion and also fixes the propagation
of the prefix to submounts.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG           |    1 +
 modules/parse_amd.c |   11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/CHANGELOG b/CHANGELOG
index 13f01397..19aec2ae 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,7 @@ xx/xx/2018 autofs-5.1.5
 - fix use after free in do_master_list_reset().
 - fix deadlock in dumpmaps.
 - dont use array for path when not necessary.
+- fix prefix option handling in expand_entry().
 
 19/12/2017 autofs-5.1.4
 - fix spec file url.
diff --git a/modules/parse_amd.c b/modules/parse_amd.c
index 2cce5417..1a5a2960 100644
--- a/modules/parse_amd.c
+++ b/modules/parse_amd.c
@@ -725,6 +725,17 @@ static struct substvar *expand_entry(struct autofs_point *ap,
 		entry->rhost = host;
 	}
 next:
+	if (entry->pref) {
+		if (expand_selectors(ap, entry->pref, &expand, sv)) {
+			debug(logopt, MODPREFIX
+			      "pref expand(\"%s\") -> %s",
+			      entry->pref, expand);
+			free(entry->pref);
+			entry->pref = expand;
+		}
+		sv = macro_addvar(sv, "pref", 4, entry->pref);
+	}
+
 	if (entry->sublink) {
 		if (expand_selectors(ap, entry->sublink, &expand, sv)) {
 			debug(logopt, MODPREFIX

--
To unsubscribe from this list: send the line "unsubscribe autofs" in

  parent reply	other threads:[~2018-02-14  6:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14  6:42 [PATCH 00/20] Current patch queue Ian Kent
2018-02-14  6:42 ` [PATCH 01/20] autofs-5.1.4 - fix flag file permission Ian Kent
2018-02-14  6:43 ` [PATCH 02/20] autofs-5.1.4 - fix directory create permission Ian Kent
2018-02-14  6:43 ` [PATCH 03/20] autofs-5.1.4 - fix use after free in do_master_list_reset() Ian Kent
2018-02-14  6:43 ` [PATCH 04/20] autofs-5.1.4 - fix deadlock in dumpmaps Ian Kent
2018-02-14  6:43 ` [PATCH 05/20] autofs-5.1.4 - dont use array for path when not necessary Ian Kent
2018-02-14  6:43 ` Ian Kent [this message]
2018-02-14  6:43 ` [PATCH 07/20] autofs-5.1.4 - fix sublink option not set from defaults Ian Kent
2018-02-14  6:43 ` [PATCH 08/20] autofs-5.1.4 - fix error return in do_nfs_mount() Ian Kent
2018-02-14  6:43 ` [PATCH 09/20] autofs-5.1.4 - add error handling for ext_mount_add() Ian Kent
2018-02-14  6:43 ` [PATCH 10/20] autofs-5.1.4 - account for recent libnsl changes Ian Kent
2018-02-14  6:43 ` [PATCH 11/20] autofs-5.1.4 - use_hostname_for_mounts shouldn't prevent selection among replicas Ian Kent
2018-02-14  6:43 ` [PATCH 12/20] autofs-5.1.4 - fix monotonic_elapsed Ian Kent
2018-02-14  6:44 ` [PATCH 13/20] autofs-5.1.4 - Makefiles.rules: remove 'samples' from SUBDIRS Ian Kent
2018-02-14  6:44 ` [PATCH 14/20] autofs-5.1.4 - dont allow trailing slash in master map mount points Ian Kent
2018-02-14  6:44 ` [PATCH 15/20] autofs-5.1.4 - fix libresolv configure check Ian Kent
2018-02-14  6:44 ` [PATCH 16/20] autofs-5.1.4 - add fedfs-getsrvinfo.c Ian Kent
2018-02-14  6:44 ` [PATCH 17/20] autofs-5.1.4 - add mount.fedfs.c Ian Kent
2018-02-14  6:44 ` [PATCH 18/20] autofs-5.1.4 - add fedfs-map-nfs4.c Ian Kent
2018-02-14  6:44 ` [PATCH 19/20] autofs-5.1.4 - add conditional inclusion of fedfs binaries Ian Kent
2018-02-14  6:44 ` [PATCH 20/20] autofs-5.1.4 - add an example fedfs master map entry to the installed master map Ian Kent
2018-02-14 23:47   ` Vincent McIntyre
2018-02-14 23:57     ` Ian Kent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=151859060538.8026.6393319689523285634.stgit@pluto.themaw.net \
    --to=raven@themaw.net \
    --cc=autofs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.