diff options
author | Rajesh Amaravathi <rajesh@redhat.com> | 2012-02-21 13:39:29 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-02-21 03:19:02 -0800 |
commit | 0344a8a12e7675bee24c770d71eff52db6b2d128 (patch) | |
tree | f3213af53d3434813c1c3919428d5af802f224f7 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 6a6abb5367f46bab4a7363db9e181c845a334cdb (diff) |
glusterd/auth: 3.2.x compatibility
volumes created with GlusterFS 3.2.x will be compatible
with GlusterFS 3.3 w.r.t auth.allow enhancements
Change-Id: I615e46d648e1270a7b856cd71fab24cfe791ddb8
BUG: 795634
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/2779
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 117e5e8f3a8..f122acbf6ce 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -584,7 +584,6 @@ char * glusterd_auth_get_username (glusterd_volinfo_t *volinfo) { GF_ASSERT (volinfo); - GF_ASSERT (volinfo->auth.username); return volinfo->auth.username; } @@ -593,7 +592,6 @@ char * glusterd_auth_get_password (glusterd_volinfo_t *volinfo) { GF_ASSERT (volinfo); - GF_ASSERT (volinfo->auth.password); return volinfo->auth.password; } @@ -2118,28 +2116,20 @@ glusterd_import_volinfo (dict_t *vols, int count, memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "volume%d.username", count); ret = dict_get_str (vols, key, &str); - if (ret) { - snprintf (msg, sizeof (msg), - "%s missing in payload for %s", - key, volname); - goto out; + if (!ret) { + ret = glusterd_auth_set_username (new_volinfo, str); + if (ret) + goto out; } - ret = glusterd_auth_set_username (new_volinfo, str); - if (ret) - goto out; memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "volume%d.password", count); ret = dict_get_str (vols, key, &str); - if (ret) { - snprintf (msg, sizeof (msg), - "%s missing in payload for %s", - key, volname); - goto out; + if (!ret) { + ret = glusterd_auth_set_password (new_volinfo, str); + if (ret) + goto out; } - ret = glusterd_auth_set_password (new_volinfo, str); - if (ret) - goto out; memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "volume%d.transport_type", count); |