You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bo...@apache.org on 2007/09/01 10:19:02 UTC

svn commit: r571744 - in /apr/apr/branches/1.2.x/user/unix: groupinfo.c userinfo.c

Author: bojan
Date: Sat Sep  1 01:19:01 2007
New Revision: 571744

URL: http://svn.apache.org/viewvc?rev=571744&view=rev
Log:
Backport r532789 and r390410 from the trunk
Use GRBUF_SIZE for getgr*_r buffer size and bump to 8192 bytes
Bump to 2048 to avoid issues with LDAP-backed lookups on FreeBSD

Modified:
    apr/apr/branches/1.2.x/user/unix/groupinfo.c
    apr/apr/branches/1.2.x/user/unix/userinfo.c

Modified: apr/apr/branches/1.2.x/user/unix/groupinfo.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/user/unix/groupinfo.c?rev=571744&r1=571743&r2=571744&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/user/unix/groupinfo.c (original)
+++ apr/apr/branches/1.2.x/user/unix/groupinfo.c Sat Sep  1 01:19:01 2007
@@ -28,6 +28,8 @@
 #include <unistd.h> /* for _POSIX_THREAD_SAFE_FUNCTIONS */
 #endif
 
+#define GRBUF_SIZE 8192
+
 APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid,
                                            apr_pool_t *p)
 {
@@ -35,7 +37,7 @@
 
 #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
     struct group grp;
-    char grbuf[512];
+    char grbuf[GRBUF_SIZE];
     apr_status_t rv;
 
     /* See comment in getpwnam_safe on error handling. */
@@ -63,7 +65,7 @@
 
 #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRNAM_R)
     struct group grp;
-    char grbuf[512];
+    char grbuf[GRBUF_SIZE];
     apr_status_t rv;
 
     /* See comment in getpwnam_safe on error handling. */

Modified: apr/apr/branches/1.2.x/user/unix/userinfo.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/user/unix/userinfo.c?rev=571744&r1=571743&r2=571744&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/user/unix/userinfo.c (original)
+++ apr/apr/branches/1.2.x/user/unix/userinfo.c Sat Sep  1 01:19:01 2007
@@ -30,7 +30,7 @@
 #define APR_WANT_MEMFUNC
 #include "apr_want.h"
 
-#define PWBUF_SIZE 512
+#define PWBUF_SIZE 2048
 
 static apr_status_t getpwnam_safe(const char *username,
                                   struct passwd *pw,