[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#30963: marked as done (statically-linked getpwuid returns NULL in error)

Your message dated Sat, 8 Jan 2000 04:56:37 -0800
with message-id <v0422080db49ce322062f@[]>
and subject line Unable to reproduce
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Darren Benham
(administrator, Debian Bugs database)

Received: (at submit) by bugs.debian.org; 21 Dec 1998 22:54:27 +0000
Received: (qmail 23927 invoked from network); 21 Dec 1998 22:54:26 -0000
Received: from smtp1.andrew.cmu.edu (
  by master.debian.org with SMTP; 21 Dec 1998 22:54:26 -0000
Received: from gigan (CREAMOFWHEAT-15.SLIP.ANDREW.CMU.EDU []) by smtp1.andrew.cmu.edu (8.8.5/8.8.2) with SMTP id RAA22091; Mon, 21 Dec 1998 17:54:23 -0500 (EST)
Date: Mon, 21 Dec 1998 17:54:23 -0500 (EST)
From: Randy Gobbel <gobbel@andrew.cmu.edu>
Sender: gobbel@gigan
Reply-To: Randy Gobbel <gobbel@andrew.cmu.edu>
Subject: statically-linked getpwuid returns NULL in error
To: submit@bugs.debian.org
cc: Randy Gobbel <gobbel@andrew.cmu.edu>
Message-ID: <ML-3.4.914280863.9383.gobbel@gigan>
MIME-Version: 1.0

Package: libc6
Version: 2.0.7u-7.1

If I compile the program below with shared libraries, it works fine.  If I add
"-static" to the command line, it dies with a segfault:

#include <stdio.h>
#include <pwd.h>

int main(int argc, char **argv)
  struct passwd *pwdptr;
  int uid;

  uid = getuid();
  pwdptr = getpwuid(uid);
  printf("uid = %d, name = %s\n", uid, pwdptr->pw_name);

gigan:~/src> cc -o pwdtest pwdtest.c
gigan:~/src> pwdtest
uid = 1000, name = gobbel
gigan:~/src> cc -static -o pwdtest pwdtest.c
gigan:~/src> pwdtest
Segmentation fault

getuid seems to be doing the right thing, but getpwuid always returns 0 in the
statically-linked library.


Received: (at 30963-done) by bugs.debian.org; 9 Jan 2000 14:39:40 +0000
Received: (qmail 20178 invoked from network); 9 Jan 2000 14:39:37 -0000
Received: from cerberus.espy.org (mail@
  by master.debian.org with SMTP; 9 Jan 2000 14:39:37 -0000
Received: from hercules.espy.org ([]) [::ffff:] 
	by cerberus.espy.org with esmtp (Exim 3.11 #1 (Debian GNU/Linux))
	id 127JVI-000508-01; Sun, 09 Jan 2000 06:39:36 -0800
Mime-Version: 1.0
X-Sender:  (Unverified)
Message-Id: <v0422080db49ce322062f@[]>
Date: Sat, 8 Jan 2000 04:56:37 -0800
To: 30963-done@bugs.debian.org
From: Joel Klecker <espy@debian.org>
Subject: Unable to reproduce
Content-Type: text/plain; charset="us-ascii"

I am unable to reproduce this on either a potato box...

jk::pts/0::cerberus::% cc -static -o pwdtest pwdtest.c     4:48:09 [/scratch]
jk::pts/0::cerberus::% ./pwdtest                           4:48:27 [/scratch]
uid = 1000, name = jk

... or a slink box...

espy::p2::master::% cc -static -o pwdtest pwdtest.c        6:49:27 [~]
espy::p2::master::% ./pwdtest                              6:50:05 [~]
uid = 1117, name = espy
Joel Klecker (aka Espy)       <URL:mailto:espy@debian.org>
Debian Package Maintainer for the GNU C Library.

Reply to: