From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 763 invoked by alias); 9 Dec 2005 07:11:38 -0000 Received: (qmail 750 invoked by uid 48); 9 Dec 2005 07:11:36 -0000 Date: Fri, 09 Dec 2005 07:11:00 -0000 Message-ID: <20051209071136.749.qmail@sourceware.org> From: "kukuk at suse dot de" To: glibc-bugs@sources.redhat.com In-Reply-To: <20051202172121.1970.burnus@gmx.de> References: <20051202172121.1970.burnus@gmx.de> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/1970] getgrnam_r() and groups with more than 1024 bytes X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2005-12/txt/msg00051.txt.bz2 List-Id: ------- Additional Comments From kukuk at suse dot de 2005-12-09 07:11 ------- (In reply to comment #0) > If I have a group with many entries (`/usr/bin/getent group test |wc -c > ` > 1024), getgrnam() duely returns the entry whereas getgrnam_r() has some > troubles. > > a) sysconf(_SC_GETGR_R_SIZE_MAX); > returns always 1024, which is not large enough, but as there is ENORANGE, it is > not too bad. > SUSv3: "_SC_GETGR_R_SIZE_MAX Maximum size of getgrgid_r() and getgrnam_r() data > buffers" and "The maximum size needed for this buffer [3rd argument of > getgrnam_r] can be determined with the {_SC_GETGR_R_SIZE_MAX} sysconf() parameter." > > > b) Using getgrnam_r() with a big group and a too small buffer = > _SC_GETGR_R_SIZE_MAX == 1024: > (i) group: files (in /etc/nsswitch.conf) > returned value: ERANGE, which is ok > (ii) group: compat (in /etc/nsswitch.conf) > getgrnam_r crashes with a memory access error. > Expected: ERANGE or e.g. EIO. > > c) Using getgrnam_r() with a buffer bigger than 1024 > (i) entry < 1024: Ok > (ii) entry > 1024 (independent of group:files vs. group:compat) > Memory access error As I told you already in Novell bugzilla: Your testprogram works fine and does not crash for me: _SC_GETGR_R_SIZE_MAX = 2048 mygetgrnam("testg", 1024) returned: ERANGE DONE So please explain exactly how to reproduce and deliver a backtrace. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |kukuk at suse dot de http://sourceware.org/bugzilla/show_bug.cgi?id=1970 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.