From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 17 02:02:12 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC0AF16A4CE for ; Fri, 17 Dec 2004 02:02:12 +0000 (GMT) Received: from delight.idiom.com (delight.idiom.com [216.240.32.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 683EA43D31 for ; Fri, 17 Dec 2004 02:02:12 +0000 (GMT) (envelope-from mwm-dated-1104112930.b99bad@mired.org) Received: from idiom.com (idiom.com [216.240.32.1]) by delight.idiom.com (Postfix) with ESMTP id 1A0211D121D for ; Thu, 16 Dec 2004 18:02:12 -0800 (PST) Received: from mired.org (mwm@idiom [216.240.32.1]) by idiom.com (8.12.11/8.12.11) with SMTP id iBH22B5D055950 for ; Thu, 16 Dec 2004 18:02:11 -0800 (PST) (envelope-from mwm-dated-1104112930.b99bad@mired.org) Received: (qmail 65449 invoked by uid 1001); 17 Dec 2004 02:02:10 -0000 Received: by guru.mired.org (tmda-sendmail, from uid 1001); Thu, 16 Dec 2004 20:02:10 -0600 (CST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16834.15906.60580.929003@guru.mired.org> Date: Thu, 16 Dec 2004 20:02:10 -0600 To: hackers@freebsd.org X-Mailer: VM 7.17 under 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid X-Primary-Address: mwm@mired.org X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: Mike Meyer X-Delivery-Agent: TMDA/1.0.3 (Seattle Slew) X-Mailman-Approved-At: Fri, 17 Dec 2004 13:25:29 +0000 Subject: files_getstate X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2004 02:02:13 -0000 I am, for perverse reasons, writing my own version of getpwuid_r on 5-STABLE. The real source to this lives in /usr/src/lib/libc/gen/getpwent.c There, the code looks values up in a db database using a key that consists of a magic cookie prepended to the userid. The magic cookie is built from a constant in pwd.h and the version member of a files_state struct. The files_state struct is presumably filled in by a call to files_getstate. I can't find the source to files_getstate *anywhere* in /usr/src. See? guru% pwd /usr/src guru% find . -type f | xargs grep files_getstate /dev/null ./lib/libc/gen/getgrent.c: rv = files_getstate(&st); ./lib/libc/gen/getgrent.c: *errnop = files_getstate(&st); ./lib/libc/gen/getpwent.c: rv = files_getstate(&st); ./lib/libc/gen/getpwent.c: *errnop = files_getstate(&st); For that matter, the files_state structure is declared in getpwent.c. Since I can't figure out what value the version member has, I'm sort of stuck Can anyone tell me where to find this missing function/macro? Thanks, http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information.