summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2016-12-07 07:36:19 -0500
committerAtin Mukherjee <amukherj@redhat.com>2016-12-14 07:27:51 -0800
commitd6527c7194a7d3db7b8270ed5e24c76cb0a91ad4 (patch)
tree0fea52f8e3cd65b712aba5374d5222a2888e017e /libglusterfs
parente8b4e119e00f3599acb0ea95f8237cf9b07546a3 (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 >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> Change-Id: I26b7230433ecbbed6e6914ed39221a478c0266a8 BUG: 1403108 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/16084 Tested-by: Atin Mukherjee <amukherj@redhat.com> 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: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/compat.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h
index 69adfbcd7fe..ea722028eb5 100644
--- a/libglusterfs/src/compat.h
+++ b/libglusterfs/src/compat.h
@@ -158,6 +158,10 @@ enum {
#define s6_addr32 __u6_addr.__u6_addr32
#endif
+#ifndef LOGIN_NAME_MAX
+#define LOGIN_NAME_MAX 256
+#endif
+
/* Posix dictates NAME_MAX to be used */
# ifndef NAME_MAX
# ifdef MAXNAMLEN