File 0012-sudo-work-with-correct-D-Bus-iterator.patch of Package sssd.openSUSE_Leap_42.1_Update

From fd7ff2baca95403bac19091b4a19c6ca2d91bb77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
Date: Mon, 11 Aug 2014 12:09:16 +0200
Subject: [PATCH] sudo: work with correct D-Bus iterator

Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
(cherry picked from commit a8e9aedbf7f6ada4e9f505da5fad8a61e4066684)

Line numbers are slightly adjusted by Howard Guo <hguo@suse.com> to fit into this older version of SSSD.

diff -rupN sssd-1.11.5.1/src/providers/data_provider_be.c sssd-1.11.5.1-patched/src/providers/data_provider_be.c
--- sssd-1.11.5.1/src/providers/data_provider_be.c	2016-05-09 15:42:29.527890768 +0200
+++ sssd-1.11.5.1-patched/src/providers/data_provider_be.c	2016-05-09 15:45:10.945481401 +0200
@@ -1668,14 +1668,14 @@ static int be_sudo_handler(DBusMessage *
 
         /* 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"));
@@ -1683,7 +1683,7 @@ static int be_sudo_handler(DBusMessage *
                 goto fail;
             }
 
-            dbus_message_iter_next(&iter);
+            dbus_message_iter_next(&array_iter);
         }
 
         sudo_req->rules[rules_num] = NULL;