From dcadcad1c3775fd53904b483df3bdb6e2e5efe3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Fri, 7 Dec 2007 13:43:25 +0000 Subject: [PATCH] Can't call getpwuid(getuid()) at all since that causes recursive lookups. Pointed out by Hai Zaar. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22199 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hcrypto/rand.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/hcrypto/rand.c b/lib/hcrypto/rand.c index 7a17c8a21..5271c5228 100644 --- a/lib/hcrypto/rand.c +++ b/lib/hcrypto/rand.c @@ -189,13 +189,12 @@ RAND_file_name(char *filename, size_t size) pathp = 1; } } - if (e == NULL) { - struct passwd *pw = getpwuid(getuid()); - if (pw) { - e = pw->pw_dir; - pathp = 1; - } - } + /* + * Here we really want to call getpwuid(getuid()) but this will + * cause recursive lookups if the nss library uses + * gssapi/krb5/hcrypto to authenticate to the ldap servers. + */ + if (e == NULL) return NULL;