summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-14 20:06:20 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-14 20:06:20 +0100
commite341912313db96f400ee5d5450aae7c67ebd44dd (patch)
tree522649c48712088b2cb0d34393fa3a74793d271a
parentf5d8989ce5fc4e6eb338ec7b1b2c6d6a74c44c63 (diff)
bus-proxy: avoid redundant name validity checks
Our API calls check the validity of bus names anyway, hence we don't have to do this before calling them...
-rw-r--r--src/bus-proxyd/bus-proxyd.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index 7037301e4d..9c4f2a6ad9 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -412,8 +412,6 @@ static int get_creds_by_name(sd_bus *bus, const char *name, uint64_t mask, sd_bu
assert(name);
assert(_creds);
- assert_return(service_name_is_valid(name), -EINVAL);
-
r = sd_bus_get_name_creds(bus, name, mask, &c);
if (r == -ESRCH || r == -ENXIO)
return sd_bus_error_setf(error, SD_BUS_ERROR_NAME_HAS_NO_OWNER, "Name %s is currently not owned by anyone.", name);
@@ -769,9 +767,6 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, Policy *polic
if (r < 0)
return synthetic_reply_method_errno(m, r, NULL);
- if (!service_name_is_valid(arg0))
- return synthetic_reply_method_errno(m, -EINVAL, NULL);
-
r = sd_bus_get_name_creds(a, arg0, 0, NULL);
if (r == -ESRCH || r == -ENXIO) {
sd_bus_error_setf(&error, SD_BUS_ERROR_NAME_HAS_NO_OWNER, "Could not get owners of name '%s': no such name.", arg0);
@@ -830,9 +825,6 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, Policy *polic
if (r < 0)
return synthetic_reply_method_errno(m, r, NULL);
- if (!service_name_is_valid(name))
- return synthetic_reply_method_errno(m, -EINVAL, NULL);
-
if (streq(name, "org.freedesktop.DBus"))
return synthetic_reply_method_return(m, "b", true);
@@ -849,9 +841,6 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, Policy *polic
if (r < 0)
return synthetic_reply_method_errno(m, r, NULL);
- if (!service_name_is_valid(name))
- return synthetic_reply_method_errno(m, -EINVAL, NULL);
-
r = sd_bus_release_name(a, name);
if (r < 0) {
if (r == -ESRCH)
@@ -885,8 +874,6 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, Policy *polic
if (policy && !policy_check_own(policy, ucred, name))
return synthetic_reply_method_errno(m, -EPERM, NULL);
- if (!service_name_is_valid(name))
- return synthetic_reply_method_errno(m, -EINVAL, NULL);
if ((flags & ~(BUS_NAME_ALLOW_REPLACEMENT|BUS_NAME_REPLACE_EXISTING|BUS_NAME_DO_NOT_QUEUE)) != 0)
return synthetic_reply_method_errno(m, -EINVAL, NULL);
@@ -927,8 +914,6 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, Policy *polic
if (r < 0)
return synthetic_reply_method_errno(m, r, NULL);
- if (!service_name_is_valid(name))
- return synthetic_reply_method_errno(m, -EINVAL, NULL);
if (flags != 0)
return synthetic_reply_method_errno(m, -EINVAL, NULL);