summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2014-08-11 12:09:16 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-08-19 13:45:10 +0200
commita8e9aedbf7f6ada4e9f505da5fad8a61e4066684 (patch)
tree172a04ea0955a3a31d12a9333b54e8b74fc8a3e8
parent193ff97ae3bd19e71c984fb3baa1805a4164549b (diff)
downloadsssd-a8e9aedbf7f6ada4e9f505da5fad8a61e4066684.tar.gz
sssd-a8e9aedbf7f6ada4e9f505da5fad8a61e4066684.tar.xz
sssd-a8e9aedbf7f6ada4e9f505da5fad8a61e4066684.zip
sudo: work with correct D-Bus iterator
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
-rw-r--r--src/providers/data_provider_be.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index fbcdf073d..d5dc02419 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -1578,14 +1578,15 @@ static int be_sudo_handler(struct sbus_request *dbus_req, void *user_data)
/* read the rules */
for (i = 0; i < rules_num; i++) {
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING) {
+ if (dbus_message_iter_get_arg_type(&array_iter)
+ != DBUS_TYPE_STRING) {
DEBUG(SSSDBG_CRIT_FAILURE, "Failed, to parse the message!\n");
ret = EIO;
err_msg = "Invalid D-Bus message format";
goto fail;
}
- dbus_message_iter_get_basic(&iter, &rule);
+ dbus_message_iter_get_basic(&array_iter, &rule);
sudo_req->rules[i] = talloc_strdup(sudo_req->rules, rule);
if (sudo_req->rules[i] == NULL) {
DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed.\n");
@@ -1593,7 +1594,7 @@ static int be_sudo_handler(struct sbus_request *dbus_req, void *user_data)
goto fail;
}
- dbus_message_iter_next(&iter);
+ dbus_message_iter_next(&array_iter);
}
sudo_req->rules[rules_num] = NULL;