atom feed9 messages in org.freebsd.freebsd-bugsRe: kern/14201: setpassent() in libc ...
FromSent OnAttachments
robe...@wojo.comOct 7, 1999 10:58 pm 
Robert Wojciechowski Jr.Oct 7, 1999 11:59 pm 
Ruslan ErmilovOct 8, 1999 12:29 am 
Stephane LegrandOct 8, 1999 1:19 am 
Robert Wojciechowski Jr.Oct 8, 1999 2:49 pm 
Robert Wojciechowski Jr.Oct 8, 1999 7:39 pm 
Robert Wojciechowski Jr.Oct 8, 1999 11:09 pm 
Robert Wojciechowski Jr.Oct 11, 1999 12:59 pm 
ac...@FreeBSD.orgOct 16, 1999 4:54 am 
Subject:Re: kern/14201: setpassent() in libc does not function properly
From:Stephane Legrand (Step@bigfoot.com)
Date:Oct 8, 1999 1:19:39 am
List:org.freebsd.freebsd-bugs

The following reply was made to PR kern/14201; it has been noted by GNATS.

From: Stephane Legrand <Step@bigfoot.com> To: robe@wojo.com Cc: free@freebsd.org Subject: Re: kern/14201: setpassent() in libc does not function properly Date: Fri, 8 Oct 1999 10:11:15 +0200 (CEST)

robe@wojo.com writes: > > >Number: 14201 > >Category: kern > >Synopsis: setpassent() in libc does not function properly > >Confidential: no > >Severity: serious > >Priority: high > >Responsible: freebsd-bugs > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: sw-bug > >Submitter-Id: current-users > >Arrival-Date: Thu Oct 7 23:00:00 PDT 1999 > >Closed-Date: > >Last-Modified: > >Originator: Robert S. Wojciechowski Jr. > >Release: FreeBSD 3.3-RELEASE i386 > >Organization: > >Environment: > FreeBSD max.millenniumworks.com 3.3-RELEASE FreeBSD 3.3-RELEASE #9: > Sun Oct 3 02:40:16 EDT 1999 > ro@max.millenniumworks.com:/usr/src/sys/compile/MYKERNEL i386 > >Description: > (This was taken from another post, just reposting this bug on 3.3-RELEASE) >

Yes, indeed :) . This is the same bug report than the kern/7781.

> The manual page for the setpassent(int stayopen) function says : > > "The setpassent() function accomplishes two purposes. First, it > causes getpwent() to ``rewind'' to the beginning of the database. > Additionally, if stayopen is non-zero, file descriptors are left open, > significantly speeding up subsequent accesses for all of the routines. > (This latter functionality is unnecessary for getpwent() as it doesn't > close its file descriptors by default.)" > > The problem is that in the file getpwent.c which implements the > setpassent() function in the libc, the stayopen variable seems not > used. And then, code like setpassent(1) doesn't work as expected. > > This problem is particularly annoying with ProFTPD > (/usr/ports/net/proftpd) which uses a such code. > > >How-To-Repeat: > The problem is visible using ProFTPD (latest at the time of this bug report
is 1.2.0pre8). > >Fix: > (Again taken from the previous post. It's a quick one line fix!!) > > A patch has been proposed by Adam Mackler > (mack@barter.dewline.com). It adds a "if" to check the value of > "_pw_stayopen" BEFORE calling "endpwent()". > > > Adam Mackler writes: > > > Date: Thu, 6 Aug 1998 17:50:08 -0400 > > > From: Floody <flo@evcom.net> > > > Reply-To: prof@evcom.net > > > To: Karl Pielorz <kpie@tdx.co.uk> > > > Cc: prof@evcom.net > > > Subject: Re: [proftpd-l] New ProFTPd user - Security, Incoming and
pwd.db? > > > > > > Ok. I put up a test FreeBSD 2.2.7 system. There appears to be a libc > > > problem with the setpassent() function, which doesn't work on FreeBSD
as > > > documented in the man pages (or on any other BSD). This is the heart
of > > > the problem. There is no workaround until libc is fixed. > > > > Hi: > > > > I think the following patch may fix the problem, but I'm afraid > > I don't know how to rebuild my c library. If you find out if this > > works can you let me know? Thanks. > > > > > > *** getpwent.c Wed Aug 19 02:00:13 1998 > > --- getpwent.c.dist Wed Aug 19 01:58:33 1998 > > *************** > > *** 194,201 **** > > if (rval && (_pw_passwd.pw_name[0] == '+'|| > > _pw_passwd.pw_name[0] == '-')) rval = 0; > > > > ! if (!_pw_stayopen) > > ! endpwent(); > > return(rval ? &_pw_passwd : (struct passwd *)NULL); > > } > > > > --- 194,200 ---- > > if (rval && (_pw_passwd.pw_name[0] == '+'|| > > _pw_passwd.pw_name[0] == '-')) rval = 0; > > > > ! endpwent(); > > return(rval ? &_pw_passwd : (struct passwd *)NULL); > > } > > > > > > -- > > Adam Mackler > > Dewline Communications, LLC > > 212-505-9149 > > >

To Unsubscribe: send mail to majo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message