From: Ken Raeburn Date: Sat, 26 Mar 2005 02:06:43 +0000 (+0000) Subject: * configure.in: Don't check for getpwuid_r here. X-Git-Tag: ms-bug-test-20060525~300 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9d1b0fed83ec13d1d758d817b081ad1d8fa1f11f;p=krb5.git * configure.in: Don't check for getpwuid_r here. * prof_file.c (profile_open_file): Use k5_getpwuid_r. ticket: 2982 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17158 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog index c2d47942f..de8cb0e78 100644 --- a/src/util/profile/ChangeLog +++ b/src/util/profile/ChangeLog @@ -1,3 +1,8 @@ +2005-03-25 Ken Raeburn + + * configure.in: Don't check for getpwuid_r here. + * prof_file.c (profile_open_file): Use k5_getpwuid_r. + 2005-03-13 Ken Raeburn * configure.in: Check struct stat for fields st_mtimensec, diff --git a/src/util/profile/configure.in b/src/util/profile/configure.in index 0164540d7..5e04820b7 100644 --- a/src/util/profile/configure.in +++ b/src/util/profile/configure.in @@ -5,7 +5,7 @@ AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_HEADERS(unistd.h stdlib.h pwd.h) -AC_CHECK_FUNCS(stat access strdup getpwuid_r) +AC_CHECK_FUNCS(stat access strdup) AC_CHECK_MEMBERS([struct stat.st_mtimensec,struct stat.st_mtimespec.tv_nsec,struct stat.st_mtim.tv_nsec],,,[#include #include ]) AC_PROG_AWK diff --git a/src/util/profile/prof_file.c b/src/util/profile/prof_file.c index 004c3efd7..f31347c37 100644 --- a/src/util/profile/prof_file.c +++ b/src/util/profile/prof_file.c @@ -213,25 +213,12 @@ errcode_t profile_open_file(const_profile_filespec_t filespec, #ifdef HAVE_PWD_H if (home_env == NULL) { uid_t uid; - struct passwd *pw; -#ifdef HAVE_GETPWUID_R - struct passwd pwx; + struct passwd *pw, pwx; char pwbuf[BUFSIZ]; -#endif uid = getuid(); -#ifndef HAVE_GETPWUID_R - pw = getpwuid(uid); -#elif defined(GETPWUID_R_4_ARGS) - /* earlier POSIX drafts */ - pw = getpwuid_r(uid, &pwx, pwbuf, sizeof(pwbuf)); -#else - /* POSIX */ - if (getpwuid_r(uid, &pwx, pwbuf, sizeof(pwbuf), &pw) != 0) - /* Probably already null, but let's make sure. */ - pw = NULL; -#endif /* getpwuid variants */ - if (pw != NULL && pw->pw_dir[0] != 0) + if (!k5_getpwuid_r(uid, &pwx, pwbuf, sizeof(pwbuf), &pw) + && pw != NULL && pw->pw_dir[0] != 0) home_env = pw->pw_dir; } #endif