From owner-freebsd-bugs Sun Sep 29 21:20: 5 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C350A37B401 for ; Sun, 29 Sep 2002 21:20:02 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 805A143E65 for ; Sun, 29 Sep 2002 21:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8U4K1Co013481 for ; Sun, 29 Sep 2002 21:20:01 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8U4K1Ck013480; Sun, 29 Sep 2002 21:20:01 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E91437B401 for ; Sun, 29 Sep 2002 21:17:31 -0700 (PDT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1EAF843E4A for ; Sun, 29 Sep 2002 21:17:31 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.6/8.12.6) with ESMTP id g8U4HU7R004326 for ; Sun, 29 Sep 2002 21:17:30 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.6/8.12.6/Submit) id g8U4HUZK004325; Sun, 29 Sep 2002 21:17:30 -0700 (PDT) Message-Id: <200209300417.g8U4HUZK004325@www.freebsd.org> Date: Sun, 29 Sep 2002 21:17:30 -0700 (PDT) From: John Mechalas To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/43501: getpwnam, getpwuid fail when linking against Berkley DB v2 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 43501 >Category: bin >Synopsis: getpwnam, getpwuid fail when linking against Berkley DB v2 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Sep 29 21:20:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: John Mechalas >Release: 4.6.2-RELEASE >Organization: >Environment: FreeBSD medley 4.6.2-RELEASE FreeBSD 4.6.2-RELEASE #0: Sat Sep 28 11:05:14 PDT 2002 root@medley:/usr/src/sys/compile/MEDLEY i386 >Description: When linking a program against libdb2, from the Berkley DB v2 package, calls to getpwuid(2) and getpwnam(2) fail on EINVAL. Note that you don't actually have to invoke any of the DB functions...merely linking against the library is enough to cause a failure. This problem *may* be related to PR bin/21659. getpw* work if you link against BDB v3 or v4. >How-To-Repeat: Compile this program and link with -ldb2: #include #include #include #include #include int main (int argc, char **argv) { struct passwd *pw; pw= getpwuid(getuid()); if ( pw == NULL ) { perror("getpwuid"); return 1; } printf("name= %s\n", pw->pw_name); } [medley] /local/export1/home/johnm/src/db > make cc -c main.c -I/usr/local/include cc -o main main.o -L/usr/local/lib -ldb2 [medley] /local/export1/home/johnm/src/db > ./main getpwuid: Invalid argument [medley] /local/export1/home/johnm/src/db > >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message