NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/40003: Adding wpa_cli to a ramdisk has duplicate symbols
The following reply was made to PR bin/40003; it has been noted by GNATS.
From: Stephen Borrill <netbsd%precedence.co.uk@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: bin/40003: Adding wpa_cli to a ramdisk has duplicate symbols
Date: Sun, 23 Nov 2008 21:34:53 +0000 (GMT)
dholland pointed out that thisproblem is due to a missing symbol in
the libhack version of the source file meaning that the libc version was
being pulled in.
Here's a fix:
Index: distrib/utils/libhack/getpwent.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/libhack/getpwent.c,v
retrieving revision 1.9
diff -u -r1.9 getpwent.c
--- distrib/utils/libhack/getpwent.c 31 Mar 2005 12:56:49 -0000 1.9
+++ distrib/utils/libhack/getpwent.c 23 Nov 2008 19:36:40 -0000
@@ -40,6 +40,7 @@
#ifdef __weak_alias
#define endpwent _endpwent
#define getpwent _getpwent
+#define getpwent_r _getpwent_r
#define getpwuid _getpwuid
#define getpwnam _getpwnam
#define setpwent _setpwent
@@ -49,6 +50,7 @@
__weak_alias(endpwent,_endpwent)
__weak_alias(getpwent,_getpwent)
+__weak_alias(getpwent_r,_getpwent_r)
__weak_alias(getpwuid,_getpwuid)
__weak_alias(getpwnam,_getpwnam)
__weak_alias(setpwent,_setpwent)
@@ -90,6 +92,22 @@
return (&_pw_passwd);
}
+int
+getpwent_r(struct passwd *pwres, char *buf, size_t bufsiz,
+ struct passwd **pwd)
+{
+ int rval;
+
+ if (!_pw_fp && !pwstart())
+ return 1;
+ rval = !pwscan(0, 0, NULL, pwres, buf, bufsiz);
+ if (rval)
+ *pwd = NULL;
+ else
+ *pwd = pwres;
+ return rval;
+}
+
struct passwd *
getpwnam(const char *name)
{
Home |
Main Index |
Thread Index |
Old Index