summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-geo-rep.h
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2016-12-07 07:36:19 -0500
committerAtin Mukherjee <amukherj@redhat.com>2016-12-08 01:12:07 -0800
commit41a71b47f75a52f50ad2754cce679407ebade767 (patch)
tree4538a7caa5646c5c669b2d909bd55d2e2866c8e9 /xlators/mgmt/glusterd/src/glusterd-geo-rep.h
parent369c619f946f9ec1cf86cc83a7dcb11c29f1f0c7 (diff)
glusterd/geo-rep: Fix glusterd crash
Problem: glusterd crashes when geo-rep mountbroker setup is created if the slave user length is more than 8 characters. Cause: _POSIX_LOGIN_NAME_MAX is used which is 9 including NULL byte. Analysis: While the man page says it sufficient for portability, but acutally it's not. Linux allows the creation of username upto 32 characters by default where the max length is 256. And NetBSD's max is 17. Linux: #getconf LOGIN_NAME_MAX 256 NetBSD: #getconf LOGIN_NAME_MAX 17 Fix: Use LOGIN_NAME_MAX instead of _POSIX_LOGIN_NAME_MAX Change-Id: I26b7230433ecbbed6e6914ed39221a478c0266a8 BUG: 1368138 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/16053 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-geo-rep.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.h b/xlators/mgmt/glusterd/src/glusterd-geo-rep.h
index 0524ec48fca..045bc2e4ba7 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.h
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.h
@@ -20,7 +20,7 @@
/* slave info format:
* <master host uuid>:ssh://{<slave_user>@}<slave host>::<slave volume> \
* :<slave volume uuid> */
-#define VOLINFO_SLAVE_URL_MAX (_POSIX_LOGIN_NAME_MAX + (2*GF_UUID_BUF_SIZE) \
+#define VOLINFO_SLAVE_URL_MAX (LOGIN_NAME_MAX + (2*GF_UUID_BUF_SIZE) \
+ SLAVE_URL_INFO_MAX + 10)
typedef struct glusterd_gsync_status_temp {