summaryrefslogtreecommitdiffstats
path: root/support/nfs/conffile.c
diff options
context:
space:
mode:
authorScott Mayhew <smayhew@redhat.com>2013-08-19 13:00:00 -0400
committerSteve Dickson <steved@redhat.com>2013-08-19 13:04:52 -0400
commit95f7dee0fe4ee13c17f31441f5cfe7600381869f (patch)
treebcbcf4c25e620f18ffaa37a8892527185b151723 /support/nfs/conffile.c
parent7c8eba31b6c1888fad2481ed5e365f766ba6120d (diff)
downloadnfs-utils-95f7dee0fe4ee13c17f31441f5cfe7600381869f.tar.gz
nfs-utils-95f7dee0fe4ee13c17f31441f5cfe7600381869f.tar.xz
nfs-utils-95f7dee0fe4ee13c17f31441f5cfe7600381869f.zip
mount.nfs: dont pass options from configuration sections that are not relevant
The nfsmount.conf file has the following format: [ section "arg" ] tag = value conf_get_tag_list() currently doesn't check the arg field so we wind up getting all the options that fall under a particular section value, instead of just the ones that match the specific "arg" field. As a result, we wind up passing options to the mount syscall from sections that aren't even relevant to the mount operation that is being performed. For example, if we have three different server sections, and each section has an Nfsvers tag, then the string we pass to the mount syscall will have two extra occurrences of the nfsvers option. Each option should appear at most 4 times -- once for the system section, once for the server-specific section, once for the mount-specific section, and once for the command line mount options. Acked-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/nfs/conffile.c')
-rw-r--r--support/nfs/conffile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
index 5015e94..c3434d5 100644
--- a/support/nfs/conffile.c
+++ b/support/nfs/conffile.c
@@ -565,7 +565,7 @@ cleanup:
}
struct conf_list *
-conf_get_tag_list(char *section)
+conf_get_tag_list(char *section, char *arg)
{
struct conf_list *list = 0;
struct conf_list_node *node;
@@ -579,6 +579,8 @@ conf_get_tag_list(char *section)
cb = LIST_FIRST(&conf_bindings[conf_hash (section)]);
for (; cb; cb = LIST_NEXT(cb, link)) {
if (strcasecmp (section, cb->section) == 0) {
+ if (arg != NULL && strcasecmp(arg, cb->arg) != 0)
+ continue;
list->cnt++;
node = calloc(1, sizeof *node);
if (!node)