summaryrefslogtreecommitdiff
path: root/src/login/logind-user-dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-08 11:27:28 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-12 13:43:32 +0200
commit6eb7c172b58d81a5f6c3998ce304a7324fc65050 (patch)
treea720b0f860bc65bfc09cbbafe869b2974d7d0c16 /src/login/logind-user-dbus.c
parent4c310c073aec5a31a7e626ea8ceb86d3a28291aa (diff)
tree-wide: add new SIGNAL_VALID() macro-like function that validates signal numbers
And port all code over to use it.
Diffstat (limited to 'src/login/logind-user-dbus.c')
-rw-r--r--src/login/logind-user-dbus.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/login/logind-user-dbus.c b/src/login/logind-user-dbus.c
index fd98c7beca..b73f9ea69e 100644
--- a/src/login/logind-user-dbus.c
+++ b/src/login/logind-user-dbus.c
@@ -25,6 +25,7 @@
#include "formats-util.h"
#include "logind-user.h"
#include "logind.h"
+#include "signal-util.h"
#include "strv.h"
#include "user-util.h"
@@ -222,7 +223,7 @@ int bus_user_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *
if (r < 0)
return r;
- if (signo <= 0 || signo >= _NSIG)
+ if (!SIGNAL_VALID(signo))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid signal %i", signo);
r = user_kill(u, signo);