Properly concat DBUS_CONSOLE_AUTH_DIR with username
authorDave Reisner <dreisner@archlinux.org>
Thu, 28 Jun 2012 14:50:46 +0000 (15:50 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 28 Jun 2012 15:46:41 +0000 (16:46 +0100)
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 <simon.mcvittie@collabora.co.uk>
dbus/dbus-sysdeps-util-unix.c

index ef86d73..caa38d0 100644 (file)
@@ -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;