Subject: pkg/7053: netatalk/afpd - 'nforks' gets set wrong
To: None <gnats-bugs@gnats.netbsd.org>
From: None <seebs@plethora.net>
List: netbsd-bugs
Date: 02/26/1999 23:39:55
>Number:         7053
>Category:       pkg
>Synopsis:       netatalk/afpd - 'nforks' gets set wrong
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 26 21:50:00 1999
>Last-Modified:
>Originator:     Peter Seebach
>Organization:
>Release:        1.3.3
>Environment:
System: NetBSD binder.fleet.plethora.net 1.3.3 NetBSD 1.3.3 (BINDER) #0: Thu Jan 28 08:16:10 PST 1999 root@binder.fleet.plethora.net:/usr/src/sys/arch/i386/compile/BINDER i386

>Description:
In 'etc/afpd/ofork.c', if getrlimit is used to set rl.rlim_cur, rl.rlim_cur
apparently gets reset - such that the calculation
	nforks = (rl.rlim_cur - 10) / 2;
produces -6.

I resolved this by adding a second round of 'getrlimit', after which I was
able to mount filesystems on my mac.

It may actually be that 'setrlimit' is writing to the rlimit structure,
which I would find surprising and maybe that's the actual problem.

>How-To-Repeat:
add some debugging code to ofork.c.
>Fix:
>Audit-Trail:
>Unformatted: