fa7d0f0b1e
FreeIPMI is a collection of Intelligent Platform Management IPMI system software. It provides in-band and out-of-band software and a development library conforming to the Intelligent Platform Management Interface (IPMI v1.5 and v2.0) standards.
28 lines
852 B
Plaintext
28 lines
852 B
Plaintext
$OpenBSD: patch-common_src_ipmi-sdr-cache_c,v 1.1.1.1 2007/10/25 18:17:02 wilfried Exp $
|
|
--- common/src/ipmi-sdr-cache.c.orig Wed Oct 10 06:54:44 2007
|
|
+++ common/src/ipmi-sdr-cache.c Tue Oct 23 17:21:22 2007
|
|
@@ -173,7 +173,11 @@ _get_home_directory (sdr_cache_ctx_t ctx,
|
|
unsigned int homebuflen)
|
|
{
|
|
uid_t user_id;
|
|
+#ifdef HAVE_GETPWUID_R
|
|
struct passwd *user_passwd = alloca (sizeof (*user_passwd));
|
|
+#else
|
|
+ struct passwd *user_passwd;
|
|
+#endif
|
|
long int buf_len;
|
|
char *buf;
|
|
int ret;
|
|
@@ -196,7 +200,11 @@ _get_home_directory (sdr_cache_ctx_t ctx,
|
|
}
|
|
|
|
user_id = getuid ();
|
|
+#ifdef HAVE_GETPWUID_R
|
|
if (getpwuid_r (user_id, user_passwd, buf, buf_len, &user_passwd) != 0)
|
|
+#else
|
|
+ if ((user_passwd = getpwuid (user_id)) == 0)
|
|
+#endif
|
|
{
|
|
ctx->errnum = SDR_CACHE_CTX_ERR_INTERNAL;
|
|
return -1;
|