summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-store.c
diff options
context:
space:
mode:
authorRajesh Amaravathi <rajesh@redhat.com>2012-02-21 13:39:29 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-21 03:19:02 -0800
commit0344a8a12e7675bee24c770d71eff52db6b2d128 (patch)
treef3213af53d3434813c1c3919428d5af802f224f7 /xlators/mgmt/glusterd/src/glusterd-store.c
parent6a6abb5367f46bab4a7363db9e181c845a334cdb (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-store.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index 900c12a82da..56b75ec90f3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -566,6 +566,8 @@ void _storeopts (dict_t *this, char *key, data_t *value, void *data)
int32_t
glusterd_volume_exclude_options_write (int fd, glusterd_volinfo_t *volinfo)
{
+ char *str = NULL;
+
GF_ASSERT (fd > 0);
GF_ASSERT (volinfo);
@@ -631,15 +633,23 @@ glusterd_volume_exclude_options_write (int fd, glusterd_volinfo_t *volinfo)
if (ret)
goto out;
- ret = glusterd_store_save_value (fd, GLUSTERD_STORE_KEY_USERNAME,
- glusterd_auth_get_username (volinfo));
- if (ret)
+ str = glusterd_auth_get_username (volinfo);
+ if (str) {
+ ret = glusterd_store_save_value (fd,
+ GLUSTERD_STORE_KEY_USERNAME,
+ str);
+ if (ret)
goto out;
+ }
- ret = glusterd_store_save_value (fd, GLUSTERD_STORE_KEY_PASSWORD,
- glusterd_auth_get_password (volinfo));
- if (ret)
- goto out;
+ str = glusterd_auth_get_password (volinfo);
+ if (str) {
+ ret = glusterd_store_save_value (fd,
+ GLUSTERD_STORE_KEY_PASSWORD,
+ str);
+ if (ret)
+ goto out;
+ }
out:
if (ret)