From b138aa0f9403878376b8ca4b64cf52f65eecb90f Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 28 Jun 2012 15:50:46 +0100 Subject: [PATCH] Properly concat DBUS_CONSOLE_AUTH_DIR with username This removes the assumption that DBUS_CONSOLE_AUTH_DIR ends with a trailing /. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=51521 Reviewed-by: Simon McVittie --- dbus/dbus-sysdeps-util-unix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c index ef86d73..caa38d0 100644 --- a/dbus/dbus-sysdeps-util-unix.c +++ b/dbus/dbus-sysdeps-util-unix.c @@ -540,7 +540,7 @@ _dbus_user_at_console (const char *username, DBusError *error) { - DBusString f; + DBusString u, f; dbus_bool_t result; result = FALSE; @@ -556,8 +556,9 @@ _dbus_user_at_console (const char *username, goto out; } + _dbus_string_init_const (&u, username); - if (!_dbus_string_append (&f, username)) + if (!_dbus_concat_dir_and_file (&f, &u)) { _DBUS_SET_OOM (error); goto out; -- 2.7.4