summaryrefslogtreecommitdiff
path: root/dbus/dbus-sysdeps-unix.c
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2020-03-11 14:15:29 +0000
committerSimon McVittie <smcv@collabora.com>2020-03-11 14:15:29 +0000
commit3197cbe3694b324cd1b3431df34cc2b5d471ff68 (patch)
treef46c86e3d9e9cadd6279464fa7181bd10f491949 /dbus/dbus-sysdeps-unix.c
parente70f19d48fda463566ef315ab29e7e606b843e9f (diff)
parenta7bf808cca79a95631e3c82223a0bc8982c94d94 (diff)
downloaddbus-3197cbe3694b324cd1b3431df34cc2b5d471ff68.tar.gz
Merge branch 'non-posix-getwpnam-r' into 'master'
Remove support for non-POSIX getpwnam_r() See merge request dbus/dbus!11
Diffstat (limited to 'dbus/dbus-sysdeps-unix.c')
-rw-r--r--dbus/dbus-sysdeps-unix.c12
1 files changed, 3 insertions, 9 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