Index: /trunk/docs/Changelog
===================================================================
--- /trunk/docs/Changelog	(revision 461)
+++ /trunk/docs/Changelog	(revision 462)
@@ -1,11 +1,13 @@
 3.1.4:
+	* fix buffer allocation for getgrnam_r for large groups
+	  (problem reported by Sergio B)
 	* search RPM in $HOME/rpmbuild if test -d _topdir fails (CentOS
 	  recommends '%(echo $HOME)/topdir', reported by E. Taft)
 
-3.1.3:
+3.1.3 (01-11-2014):
 	* remove initgroups() from the popen call in unix entropy gatherer
 	* Add error message for update mode if local baseline cannot be found
 
-3.1.2:
+3.1.2 (07-08-2014):
 	* Fixed incorrect memset in sh_checksum.c (sha256)
 	* Circumvent a gcc compiler bug with inline asm (gcc 4.8)
@@ -24,5 +26,5 @@
 	* Fix a free() on NULL (harmless but avoids spurious warning)
 
-3.1.1 (01-0-2014):
+3.1.1 (01-05-2014):
 	* Disable inline asm on Cygwin (issue reported by Erik)
 	* Fix sh_ipvx_is_ipv4 such that numeric hostnames are not
Index: /trunk/docs/FAQ.html
===================================================================
--- /trunk/docs/FAQ.html	(revision 461)
+++ /trunk/docs/FAQ.html	(revision 462)
@@ -139,5 +139,5 @@
 </ul>
 </div>
-<p><i>FAQ Revised: Saturday 14 April 2007 17:05:58</i></p>
+<p><i>FAQ Revised: Wednesday 14 January 2015 20:41:15</i></p>
 <hr><h2>Table of Contents</h2>
 <dl>
@@ -148,4 +148,5 @@
 <li><a href="#Most frequently2">1.3. It does not log anything / Can't stop logging to console</a></li>
 <li><a href="#Most frequently3">1.4. Client cannot self-resolve, but nslookup works fine</a></li>
+<li><a href="#Most frequently4">1.5. Server logs hostname instead of FQDN (or vice versa)</a></li>
 </ul></dd>
 <dt><b>2. Build and install</b></dt>
@@ -332,4 +333,11 @@
         xxx.xxx.xxx.xxx myhost.mydomain.tld  myhost
 </pre></div><br><br></dd>
+<dt><b><a name="Most frequently4">1.5. Server logs hostname instead of FQDN (or vice versa)</a></b></dt>
+<dd>The default is to log the hostname only, if you want the FQDN
+then there is an option for the server configuration:
+<div class="block"><pre>
+        [Misc]
+	SetStripDomain = true / false
+</pre></div><br><br></dd>
 </dl>
 <hr><h2>2. Build and install</h2>
Index: /trunk/src/sh_unix.c
===================================================================
--- /trunk/src/sh_unix.c	(revision 461)
+++ /trunk/src/sh_unix.c	(revision 462)
@@ -1012,4 +1012,5 @@
   struct group     grp;
   char           * buffer;
+  static size_t    gbufsize = SH_GRBUF_SIZE;       
 #endif
 
@@ -1035,10 +1036,24 @@
 
 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-      buffer = SH_ALLOC(SH_GRBUF_SIZE);
-      status = sh_getgrnam_r(g, &grp, buffer, SH_GRBUF_SIZE, &w);
+
+      buffer = SH_ALLOC(gbufsize);
+      status = sh_getgrnam_r(g, &grp, buffer, gbufsize, &w);
+
+      if ((status == ERANGE) && (w == NULL)) 
+	{
+	  if (SL_TRUE ==  sl_ok_adds( gbufsize, SH_GRBUF_SIZE ))
+	    {
+	      SH_FREE(buffer);
+	      gbufsize += SH_GRBUF_SIZE;
+	      goto is_a_name;
+	    }
+	}
+
 #else
+
       errno = 0;
       w = sh_getgrnam(g);
       status = errno;
+
 #endif
 
