From b4e1104f9549c3ddb4b6f7c1a0977b729a48fe57 Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Mon, 14 Oct 2013 16:20:19 +0800 Subject: [PATCH] config-parser: never returns a NULL pointer for In current implementation, the user of dbus parser always pre-allocated, so it's always non-null. So in the case there isn't a or a empty configured in system.conf, we need to check parser->user is "". We do not touch the case in dbus-daemon but the one in servicehelper because in dbus-daemon * dump a pointer always work if it's not NULL * it's better if we can find the invalid user from log In the servicehelper case, without this fix, it always failed with "org.freedesktop.DBus.Error.Spawn.PermissionsInvalid: The permission of the setuid helper is not correct" This is quite confusing and misleading. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66728 diff --git a/bus/activation-helper.c b/bus/activation-helper.c index 394f393..a71e5ba 100644 --- a/bus/activation-helper.c +++ b/bus/activation-helper.c @@ -494,7 +494,7 @@ check_dbus_user (BusConfigParser *parser, DBusError *error) const char *dbus_user; dbus_user = bus_config_parser_get_user (parser); - if (dbus_user == NULL) + if (dbus_user == NULL || dbus_user[0] == '\0') { dbus_set_error (error, DBUS_ERROR_SPAWN_CONFIG_INVALID, "could not get user from config file\n"); -- 1.7.9.5