Commit 08672cb5 authored by Lennart Poettering's avatar Lennart Poettering
Browse files

dbus: return DBUS_ERROR_UNKNOWN_OBJECT when an object is unknown

parent 83310f16
......@@ -193,8 +193,11 @@ static DBusHandlerResult bus_job_message_handler(DBusConnection *connection, DBu
if (r == -ENOMEM)
return DBUS_HANDLER_RESULT_NEED_MEMORY;
if (r == -ENOENT)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
if (r == -ENOENT) {
DBusError e;
dbus_set_error_const(&e, DBUS_ERROR_UNKNOWN_OBJECT, "Unknown job");
return bus_send_error_reply(m, connection, message, &e, r);
}
return bus_send_error_reply(m, connection, message, NULL, r);
}
......
......@@ -567,8 +567,11 @@ static DBusHandlerResult bus_unit_message_handler(DBusConnection *connection, DB
if (r == -ENOMEM)
return DBUS_HANDLER_RESULT_NEED_MEMORY;
if (r == -ENOENT)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
if (r == -ENOENT) {
DBusError e;
dbus_set_error_const(&e, DBUS_ERROR_UNKNOWN_OBJECT, "Unknown unit");
return bus_send_error_reply(m, connection, message, &e, r);
}
return bus_send_error_reply(m, connection, message, NULL, r);
}
......
......@@ -24,6 +24,14 @@
#include <dbus/dbus.h>
#ifndef DBUS_ERROR_UNKNOWN_OBJECT
#define DBUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error.UnknownObject"
#endif
#ifndef DBUS_ERROR_UNKNOWN_INTERFACE
#define DBUS_ERROR_UNKNOWN_INTERFACE "org.freedesktop.DBus.Error.UnknownInterface"
#endif
#include "manager.h"
typedef int (*BusPropertyCallback)(Manager *m, DBusMessageIter *iter, const char *property, void *data);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment