From 75ce8d9fc3ccabbd5bd15bcf79ab1e7da8a5b4cb Mon Sep 17 00:00:00 2001 From: Hasso Tepper Date: Sat, 3 Jan 2009 00:48:31 +0200 Subject: [PATCH] Temporary hack out reentrant user database functions. Bringing in reentrant user database functions caused major issues with pkgsrc and there is no time to fix these (2008Q4 is released really soon now). Also there seem to be some missing pieces to conform SUSv3. The hack will be reverted after 2.2 release. The patch by pavalos@, requested by me. --- include/grp.h | 5 ++++- include/pwd.h | 4 +++- lib/libc/gen/Makefile.inc | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/grp.h b/include/grp.h index e6feac5..be76f6f 100644 --- a/include/grp.h +++ b/include/grp.h @@ -74,13 +74,16 @@ const char *group_from_gid(gid_t, int); #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE /* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */ int setgrent(void); +#if 0 int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **); int getgrnam_r(const char *, struct group *, char *, size_t, struct group **); #endif +#endif + #if __BSD_VISIBLE -int getgrent_r(struct group *, char *, size_t, struct group **); +/* int getgrent_r(struct group *, char *, size_t, struct group **); */ int setgroupent(int); #endif __END_DECLS diff --git a/include/pwd.h b/include/pwd.h index 148b8b8..bee63ad 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -148,14 +148,16 @@ struct passwd *getpwuid(uid_t); void endpwent(void); struct passwd *getpwent(void); void setpwent(void); +#if 0 int getpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **); int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **); #endif +#endif #if __BSD_VISIBLE -int getpwent_r(struct passwd *, char *, size_t, struct passwd **); +/* int getpwent_r(struct passwd *, char *, size_t, struct passwd **); */ int setpassent(int); const char *user_from_uid(uid_t, int); #endif diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index b410bc1..de49860 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -37,6 +37,11 @@ SRCS+= _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \ ualarm.c ucontext.c ulimit.c uname.c unvis.c usleep.c utime.c \ valloc.c vis.c wait.c wait3.c waitpid.c wordexp.c +# Temporary hack to hide these symbols until we get a full implementation. +CFLAGS+= -Dgetgrent_r=GETGRENT_R -Dgetgrnam_r=GETGRNAM_R \ + -Dgetgrgid_r=GETGRGID_R -Dgetpwent_r=GETPWENT_R \ + -Dgetpwnam_r=GETPWNAM_R -Dgetpwuid_r=GETPWUID_R + .if ${LIB} != {c_rtld} SRCS+= tls.c .endif -- 1.7.7.2