diff options
author | NeilBrown <neilb@suse.com> | 2016-12-06 13:14:33 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2016-12-20 13:29:04 -0500 |
commit | be38fd8b8011c6bd6a83ec391f881507c1b047ae (patch) | |
tree | d3cb36cce5db79cd0e4a2b56a816c606c8bb196e /support | |
parent | 08c6be49aa7261c2beff099687a6186a6596b1f5 (diff) | |
download | nfs-utils-be38fd8b8011c6bd6a83ec391f881507c1b047ae.tar.gz nfs-utils-be38fd8b8011c6bd6a83ec391f881507c1b047ae.tar.xz nfs-utils-be38fd8b8011c6bd6a83ec391f881507c1b047ae.zip |
conffile: add support for include files.
A tag
include = filename
will be replaced by the content of the file.
This must appear after a section heading, and any assignments
not in their own section will be included in the section that this
directive is in.
e.g
[environment]
include = /etc/sysconfig/nfs
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support')
-rw-r--r-- | support/nfs/conffile.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c index 965726c..8de580b 100644 --- a/support/nfs/conffile.c +++ b/support/nfs/conffile.c @@ -52,6 +52,7 @@ #pragma GCC visibility push(hidden) static void conf_load_defaults(void); +static int conf_load(int trans, char *path); static int conf_set(int , char *, char *, char *, char *, int , int ); @@ -308,8 +309,11 @@ conf_parse_line(int trans, char *line, size_t sz) break; } } - /* XXX Perhaps should we not ignore errors? */ - conf_set(trans, section, arg, line, val, 0, 0); + if (strcasecmp(line, "include") == 0) + conf_load(trans, val); + else + /* XXX Perhaps should we not ignore errors? */ + conf_set(trans, section, arg, line, val, 0, 0); return; } } |