summaryrefslogtreecommitdiffstats
path: root/src/responder/ifp
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2014-12-12 15:14:09 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-01-23 21:29:34 +0100
commit71c9027d4192bf149afa4fcf9fef93bf6e901121 (patch)
tree823982d4ff67ccf906608742b7b73174db413851 /src/responder/ifp
parent46ee931314e6a5517f5c6b6b14f759364be119cc (diff)
downloadsssd-71c9027d4192bf149afa4fcf9fef93bf6e901121.tar.gz
sssd-71c9027d4192bf149afa4fcf9fef93bf6e901121.tar.xz
sssd-71c9027d4192bf149afa4fcf9fef93bf6e901121.zip
sbus: add object path to sbus request
Object path is heavily used in implementation of methods from interfaces that are supported on whole subtrees. Although it can be obtained from a D-Bus message, it is nice to have it accessible directly. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/responder/ifp')
-rw-r--r--src/responder/ifp/ifp_components.c18
-rw-r--r--src/responder/ifp/ifp_domains.c4
2 files changed, 8 insertions, 14 deletions
diff --git a/src/responder/ifp/ifp_components.c b/src/responder/ifp/ifp_components.c
index c8ad7673c..2b76a480d 100644
--- a/src/responder/ifp/ifp_components.c
+++ b/src/responder/ifp/ifp_components.c
@@ -691,7 +691,6 @@ int ifp_component_change_debug_level_tmp(struct sbus_request *dbus_req,
{
struct ifp_ctx *ctx = NULL;
DBusError *error = NULL;
- const char *path = dbus_message_get_path(dbus_req->message);
char *name = NULL;
enum component_type type;
errno_t ret;
@@ -704,7 +703,7 @@ int ifp_component_change_debug_level_tmp(struct sbus_request *dbus_req,
}
ret = check_and_get_component_from_path(dbus_req, ctx->rctx->cdb,
- path, &type, &name);
+ dbus_req->path, &type, &name);
if (ret != EOK) {
goto done;
}
@@ -736,7 +735,6 @@ void ifp_component_get_name(struct sbus_request *dbus_req,
const char **_out)
{
struct ifp_ctx *ctx = NULL;
- const char *path = dbus_message_get_path(dbus_req->message);
char *name = NULL;
errno_t ret;
@@ -749,7 +747,7 @@ void ifp_component_get_name(struct sbus_request *dbus_req,
}
ret = check_and_get_component_from_path(dbus_req, ctx->rctx->cdb,
- path, NULL, &name);
+ dbus_req->path, NULL, &name);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, "Unknown object [%d]: %s\n",
ret, strerror(ret));
@@ -764,7 +762,6 @@ void ifp_component_get_debug_level(struct sbus_request *dbus_req,
uint32_t *_out)
{
struct ifp_ctx *ctx = NULL;
- const char *path = dbus_message_get_path(dbus_req->message);
const char *confdb_path = NULL;
char *name = NULL;
enum component_type type;
@@ -780,7 +777,7 @@ void ifp_component_get_debug_level(struct sbus_request *dbus_req,
}
ret = check_and_get_component_from_path(dbus_req, ctx->rctx->cdb,
- path, &type, &name);
+ dbus_req->path, &type, &name);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, "Unknown object [%d]: %s\n",
ret, strerror(ret));
@@ -820,7 +817,6 @@ void ifp_component_get_enabled(struct sbus_request *dbus_req,
bool *_out)
{
struct ifp_ctx *ctx = NULL;
- const char *path = dbus_message_get_path(dbus_req->message);
const char *param = NULL;
char **values = NULL;
char *name = NULL;
@@ -837,7 +833,7 @@ void ifp_component_get_enabled(struct sbus_request *dbus_req,
}
ret = check_and_get_component_from_path(dbus_req, ctx->rctx->cdb,
- path, &type, &name);
+ dbus_req->path, &type, &name);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, "Unknown object [%d]: %s\n",
ret, strerror(ret));
@@ -877,7 +873,6 @@ void ifp_component_get_type(struct sbus_request *dbus_req,
const char **_out)
{
struct ifp_ctx *ctx = NULL;
- const char *path = dbus_message_get_path(dbus_req->message);
enum component_type type;
errno_t ret;
@@ -890,7 +885,7 @@ void ifp_component_get_type(struct sbus_request *dbus_req,
}
ret = check_and_get_component_from_path(dbus_req, ctx->rctx->cdb,
- path, &type, NULL);
+ dbus_req->path, &type, NULL);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, "Unknown object [%d]: %s\n",
ret, strerror(ret));
@@ -917,7 +912,6 @@ void ifp_backend_get_providers(struct sbus_request *dbus_req,
{
TALLOC_CTX *tmp_ctx = NULL;
struct ifp_ctx *ctx = NULL;
- const char *path = dbus_message_get_path(dbus_req->message);
const char *confdb_path = NULL;
char *name = NULL;
enum component_type type;
@@ -952,7 +946,7 @@ void ifp_backend_get_providers(struct sbus_request *dbus_req,
}
ret = check_and_get_component_from_path(tmp_ctx, ctx->rctx->cdb,
- path, &type, &name);
+ dbus_req->path, &type, &name);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, "Unknown object [%d]: %s\n",
ret, strerror(ret));
diff --git a/src/responder/ifp/ifp_domains.c b/src/responder/ifp/ifp_domains.c
index 0d50dac32..1841cbe58 100644
--- a/src/responder/ifp/ifp_domains.c
+++ b/src/responder/ifp/ifp_domains.c
@@ -254,7 +254,6 @@ get_domain_info_from_req(struct sbus_request *dbus_req, void *data)
struct ifp_ctx *ctx = NULL;
struct sss_domain_info *domains = NULL;
struct sss_domain_info *iter = NULL;
- const char *path = dbus_message_get_path(dbus_req->message);
const char *raw_name = NULL;
char *name = NULL;
@@ -264,7 +263,8 @@ get_domain_info_from_req(struct sbus_request *dbus_req, void *data)
return NULL;
}
- raw_name = ifp_path_strip_prefix(path, INFOPIPE_DOMAIN_PATH_PFX "/");
+ raw_name = ifp_path_strip_prefix(dbus_req->path,
+ INFOPIPE_DOMAIN_PATH_PFX "/");
if (raw_name == NULL) {
return NULL;
}