summaryrefslogtreecommitdiff
path: root/dbus
diff options
context:
space:
mode:
Diffstat (limited to 'dbus')
-rw-r--r--dbus/dbus-sysdeps-unix.c12
-rw-r--r--dbus/dbus-sysdeps-util-unix.c9
2 files changed, 6 insertions, 15 deletions
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
index 4607f537..71e5d86d 100644
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -2656,7 +2656,7 @@ fill_user_info (DBusUserInfo *info,
* checks
*/
-#if defined (HAVE_POSIX_GETPWNAM_R) || defined (HAVE_NONPOSIX_GETPWNAM_R)
+#ifdef HAVE_GETPWNAM_R
{
struct passwd *p;
int result;
@@ -2685,20 +2685,12 @@ fill_user_info (DBusUserInfo *info,
}
p = NULL;
-#ifdef HAVE_POSIX_GETPWNAM_R
if (uid != DBUS_UID_UNSET)
result = getpwuid_r (uid, &p_str, buf, buflen,
&p);
else
result = getpwnam_r (username_c, &p_str, buf, buflen,
&p);
-#else
- if (uid != DBUS_UID_UNSET)
- p = getpwuid_r (uid, &p_str, buf, buflen);
- else
- p = getpwnam_r (username_c, &p_str, buf, buflen);
- result = 0;
-#endif /* !HAVE_POSIX_GETPWNAM_R */
//Try a bigger buffer if ERANGE was returned
if (result == ERANGE && buflen < 512 * 1024)
{
@@ -2734,6 +2726,8 @@ fill_user_info (DBusUserInfo *info,
/* I guess we're screwed on thread safety here */
struct passwd *p;
+#warning getpwnam_r() not available, please report this to the dbus maintainers with details of your OS
+
if (uid != DBUS_UID_UNSET)
p = getpwuid (uid);
else
diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c
index ccf3d9f5..d29cbd1f 100644
--- a/dbus/dbus-sysdeps-util-unix.c
+++ b/dbus/dbus-sysdeps-util-unix.c
@@ -824,7 +824,7 @@ fill_group_info (DBusGroupInfo *info,
* to add more configure checks.
*/
-#if defined (HAVE_POSIX_GETPWNAM_R) || defined (HAVE_NONPOSIX_GETPWNAM_R)
+#ifdef HAVE_GETPWNAM_R
{
struct group *g;
int result;
@@ -854,17 +854,12 @@ fill_group_info (DBusGroupInfo *info,
}
g = NULL;
-#ifdef HAVE_POSIX_GETPWNAM_R
if (group_c_str)
result = getgrnam_r (group_c_str, &g_str, buf, buflen,
&g);
else
result = getgrgid_r (gid, &g_str, buf, buflen,
&g);
-#else
- g = getgrnam_r (group_c_str, &g_str, buf, buflen);
- result = 0;
-#endif /* !HAVE_POSIX_GETPWNAM_R */
/* Try a bigger buffer if ERANGE was returned:
https://bugs.freedesktop.org/show_bug.cgi?id=16727
*/
@@ -899,6 +894,8 @@ fill_group_info (DBusGroupInfo *info,
/* I guess we're screwed on thread safety here */
struct group *g;
+#warning getpwnam_r() not available, please report this to the dbus maintainers with details of your OS
+
g = getgrnam (group_c_str);
if (g != NULL)