summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--support/nfs/conffile.c16
-rw-r--r--systemd/nfs.conf.man8
2 files changed, 22 insertions, 2 deletions
diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
index eaff5f5..e4f685c 100644
--- a/support/nfs/conffile.c
+++ b/support/nfs/conffile.c
@@ -519,12 +519,24 @@ char *
conf_get_str(char *section, char *tag)
{
struct conf_binding *cb;
-
+retry:
cb = LIST_FIRST (&conf_bindings[conf_hash (section)]);
for (; cb; cb = LIST_NEXT (cb, link)) {
if (strcasecmp (section, cb->section) == 0
- && strcasecmp (tag, cb->tag) == 0)
+ && strcasecmp (tag, cb->tag) == 0) {
+ if (cb->value[0] == '$') {
+ /* expand $name from [environment] section,
+ * or from environment
+ */
+ char *env = getenv(cb->value+1);
+ if (env)
+ return env;
+ section = "environment";
+ tag = cb->value + 1;
+ goto retry;
+ }
return cb->value;
+ }
}
return 0;
}
diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man
index 8cf5566..03f1f2b 100644
--- a/systemd/nfs.conf.man
+++ b/systemd/nfs.conf.man
@@ -45,6 +45,14 @@ or
.RB \*(lq ; \*(rq
is ignored, as is any blank line.
.PP
+If the assigned value started with a
+.RB \*(lq $ \*(rq
+then the remainder is treated as a name and looked for in the section
+.B [environment]
+or in the processes environment (see
+.BR environ (7)).
+The value found is used for this value.
+.PP
The value name
.B include
is special. If a section contains