Changeset 462


Ignore:
Timestamp:
Jan 16, 2015, 8:45:20 PM (10 years ago)
Author:
katerina
Message:

Fix for ticket #362 (Buffer for getgrnam_r too small).

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/Changelog

    r461 r462  
    113.1.4:
     2        * fix buffer allocation for getgrnam_r for large groups
     3          (problem reported by Sergio B)
    24        * search RPM in $HOME/rpmbuild if test -d _topdir fails (CentOS
    35          recommends '%(echo $HOME)/topdir', reported by E. Taft)
    46
    5 3.1.3:
     73.1.3 (01-11-2014):
    68        * remove initgroups() from the popen call in unix entropy gatherer
    79        * Add error message for update mode if local baseline cannot be found
    810
    9 3.1.2:
     113.1.2 (07-08-2014):
    1012        * Fixed incorrect memset in sh_checksum.c (sha256)
    1113        * Circumvent a gcc compiler bug with inline asm (gcc 4.8)
     
    2426        * Fix a free() on NULL (harmless but avoids spurious warning)
    2527
    26 3.1.1 (01-0-2014):
     283.1.1 (01-05-2014):
    2729        * Disable inline asm on Cygwin (issue reported by Erik)
    2830        * Fix sh_ipvx_is_ipv4 such that numeric hostnames are not
  • trunk/docs/FAQ.html

    r101 r462  
    139139</ul>
    140140</div>
    141 <p><i>FAQ Revised: Saturday 14 April 2007 17:05:58</i></p>
     141<p><i>FAQ Revised: Wednesday 14 January 2015 20:41:15</i></p>
    142142<hr><h2>Table of Contents</h2>
    143143<dl>
     
    148148<li><a href="#Most frequently2">1.3. It does not log anything / Can't stop logging to console</a></li>
    149149<li><a href="#Most frequently3">1.4. Client cannot self-resolve, but nslookup works fine</a></li>
     150<li><a href="#Most frequently4">1.5. Server logs hostname instead of FQDN (or vice versa)</a></li>
    150151</ul></dd>
    151152<dt><b>2. Build and install</b></dt>
     
    332333        xxx.xxx.xxx.xxx myhost.mydomain.tld  myhost
    333334</pre></div><br><br></dd>
     335<dt><b><a name="Most frequently4">1.5. Server logs hostname instead of FQDN (or vice versa)</a></b></dt>
     336<dd>The default is to log the hostname only, if you want the FQDN
     337then there is an option for the server configuration:
     338<div class="block"><pre>
     339        [Misc]
     340        SetStripDomain = true / false
     341</pre></div><br><br></dd>
    334342</dl>
    335343<hr><h2>2. Build and install</h2>
  • trunk/src/sh_unix.c

    r460 r462  
    10121012  struct group     grp;
    10131013  char           * buffer;
     1014  static size_t    gbufsize = SH_GRBUF_SIZE;       
    10141015#endif
    10151016
     
    10351036
    10361037#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
    1037       buffer = SH_ALLOC(SH_GRBUF_SIZE);
    1038       status = sh_getgrnam_r(g, &grp, buffer, SH_GRBUF_SIZE, &w);
     1038
     1039      buffer = SH_ALLOC(gbufsize);
     1040      status = sh_getgrnam_r(g, &grp, buffer, gbufsize, &w);
     1041
     1042      if ((status == ERANGE) && (w == NULL))
     1043        {
     1044          if (SL_TRUE ==  sl_ok_adds( gbufsize, SH_GRBUF_SIZE ))
     1045            {
     1046              SH_FREE(buffer);
     1047              gbufsize += SH_GRBUF_SIZE;
     1048              goto is_a_name;
     1049            }
     1050        }
     1051
    10391052#else
     1053
    10401054      errno = 0;
    10411055      w = sh_getgrnam(g);
    10421056      status = errno;
     1057
    10431058#endif
    10441059
Note: See TracChangeset for help on using the changeset viewer.