summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2005-03-26 02:06:43 +0000
committerKen Raeburn <raeburn@mit.edu>2005-03-26 02:06:43 +0000
commit9d1b0fed83ec13d1d758d817b081ad1d8fa1f11f (patch)
tree4bc18fbacc72463e0d9aa6f184358064c3d0c21e /src/util
parent74cc2af420298ff9cf4e494d89b0c5219ea26d0b (diff)
downloadkrb5-9d1b0fed83ec13d1d758d817b081ad1d8fa1f11f.tar.gz
krb5-9d1b0fed83ec13d1d758d817b081ad1d8fa1f11f.tar.xz
krb5-9d1b0fed83ec13d1d758d817b081ad1d8fa1f11f.zip
* 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
Diffstat (limited to 'src/util')
-rw-r--r--src/util/profile/ChangeLog5
-rw-r--r--src/util/profile/configure.in2
-rw-r--r--src/util/profile/prof_file.c19
3 files changed, 9 insertions, 17 deletions
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 <raeburn@mit.edu>
+
+ * configure.in: Don't check for getpwuid_r here.
+ * prof_file.c (profile_open_file): Use k5_getpwuid_r.
+
2005-03-13 Ken Raeburn <raeburn@mit.edu>
* 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 <sys/types.h>
#include <sys/stat.h>])
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