NGROUPS_MAX on Linux

Darren Tucker dtucker at zip.com.au
Fri Feb 20 14:57:04 EST 2004


Ben Lindstrom wrote:
> On Fri, 20 Feb 2004, Darren Tucker wrote:
>> >diff -u -u -r1.42 uidswap.c
>> >+	saved_egroups = xrealloc(saved_egroups,
>> >+	    saved_egroupslen * sizeof(*saved_egroups));
> 
> I stared at that code for a while before I saw your message.  I would have
> used sizeof(gid_t *) myself, but I was unsure if it was anything major.

I think it's fine, the issue is on my system, the master sshd daemon 
(started via sudo) is running with no supplemental gids...

>>I get a fatal here during authentication:
>>debug1: temporarily_use_uid: 500/500 (e=0/0)
>>xrealloc: zero size
> 
> What is the value of saved_egroupslen?

zero.

(gdb) bt
#0  0x401a6da1 in kill () from /lib/libc.so.6
#1  0x401a6b6c in raise () from /lib/libc.so.6
#2  0x401a7d95 in abort () from /lib/libc.so.6
#3  0x08067c15 in fatal (fmt=0x80807e3 "xrealloc: zero size") at 
../fatal.c:39
#4  0x0806cdd5 in xrealloc (ptr=0x0, new_size=0) at ../xmalloc.c:40
#5  0x0805313f in temporarily_use_uid (pw=0x0) at ../uidswap.c:76
#6  0x08059bc8 in user_key_allowed2 (pw=0x808ba10, key=0x8094740,
     file=0x80958c0 "/home/dtucker/.ssh/authorized_keys")
     at ../auth2-pubkey.c:179
#7  0x08059f29 in user_key_allowed (pw=0x808ba10, key=0x8094740)
     at ../auth2-pubkey.c:264
#8  0x0805ba49 in mm_answer_keyallowed (socket=9, m=0xbfffe9c0)
     at ../monitor.c:955
#9  0x0805b0ba in monitor_read (pmonitor=0x808dbc8, ent=0x8083ea8,
     pent=0xbfffea08) at ../monitor.c:414
#10 0x0805add6 in monitor_child_preauth (_authctxt=0xbfffea08,
     pmonitor=0x808dbc8) at ../monitor.c:302
#11 0x0804c91f in privsep_preauth (authctxt=0x808dcf8) at ../sshd.c:600
#12 0x0804d800 in main (ac=134798232, av=0x808dd28) at ../sshd.c:1473
#13 0x4019562d in __libc_start_main () from /lib/libc.so.6
(gdb) frame 5
#5  0x0805313f in temporarily_use_uid (pw=0x0) at ../uidswap.c:76
76              saved_egroups = xrealloc(saved_egroups,
(gdb) print saved_egroupslen
$1 = 0

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
     Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.




More information about the openssh-unix-dev mailing list