+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,
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
#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