diff options
author | Santosh Kumar Pradhan <spradhan@redhat.com> | 2014-06-10 10:43:28 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2014-06-24 09:59:19 -0700 |
commit | 55880a7168d5b7ef85f6de3b1870634156e6ddfa (patch) | |
tree | 6d7886fae733c0dfd26aa563ae4eec6593d7de28 /rpc/rpc-lib | |
parent | f5b203fbaba2c4179c126f5db82cc89569ae1697 (diff) |
rpc: Reconfigure() does not work for auth-reject
Problem:
If volume is set for rpc-auth.addr.<volname>.reject with value
as "host1", ideally the NFS mount from "host1" should FAIL. It
works as expected. But when the volume is RESET, then previous
value set for auth-reject should go off, and further NFS mount
from "host1" should PASS. But it FAILs because of stale value
in dict for key "rpc-auth.addr.<volname>.reject".
It does not impact rpc-auth.addr.<volname>.allow key because,
each time NFS volfile gets generated, allow key ll have "*"
as default value. But reject key does not have default value.
FIX:
Delete the OLD value for key irrespective of anything. Add
NEW value for the key, if and only if that is SET in the
reconfigured new volfile.
Upstream review: http://review.gluster.org/7931
Change-Id: I9d1cb37002aad978a3a59e4b45b42d881d0d20e3
BUG: 1103050
Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com>
Reviewed-on: http://review.gluster.org/8022
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'rpc/rpc-lib')
-rw-r--r-- | rpc/rpc-lib/src/rpcsvc.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index e5beba05b0a..9374ee7328f 100644 --- a/rpc/rpc-lib/src/rpcsvc.c +++ b/rpc/rpc-lib/src/rpcsvc.c @@ -1959,11 +1959,16 @@ rpcsvc_reconfigure_options (rpcsvc_t *svc, dict_t *options) return (-1); } - /* If found the srchkey, delete old key/val pair - * and set the key with new value. + /* key-string: rpc-auth.addr.<volname>.reject + * + * IMP: Delete the OLD key/value pair from dict. + * And set the NEW key/value pair IFF the option is SET + * in reconfigured volfile. + * + * NB: No default value for reject key. */ + dict_del (svc->options, srchkey); if (!dict_get_str (options, srchkey, &keyval)) { - dict_del (svc->options, srchkey); ret = dict_set_str (svc->options, srchkey, keyval); if (ret < 0) { gf_log (GF_RPCSVC, GF_LOG_ERROR, @@ -1987,11 +1992,17 @@ rpcsvc_reconfigure_options (rpcsvc_t *svc, dict_t *options) return (-1); } - /* If found the srchkey, delete old key/val pair - * and set the key with new value. + /* key-string: rpc-auth.addr.<volname>.allow + * + * IMP: Delete the OLD key/value pair from dict. + * And set the NEW key/value pair IFF the option is SET + * in reconfigured volfile. + * + * NB: If rpc-auth.addr.<volname>.allow is not SET explicitly, + * build_nfs_graph() sets it as "*" i.e. anonymous. */ + dict_del (svc->options, srchkey); if (!dict_get_str (options, srchkey, &keyval)) { - dict_del (svc->options, srchkey); ret = dict_set_str (svc->options, srchkey, keyval); if (ret < 0) { gf_log (GF_RPCSVC, GF_LOG_ERROR, |