sudo_testcli.c revision 968e2bc3bb28458b25c3b19868ea50f0325d8b0a
5fe5ea74285e2fc0fbf7568c53f251aa894650fbTimo Sirainen Pavel Březina <pbrezina@redhat.com>
5fe5ea74285e2fc0fbf7568c53f251aa894650fbTimo Sirainen Copyright (C) 2011 Red Hat
5fe5ea74285e2fc0fbf7568c53f251aa894650fbTimo Sirainen This program is free software; you can redistribute it and/or modify
5fe5ea74285e2fc0fbf7568c53f251aa894650fbTimo Sirainen it under the terms of the GNU General Public License as published by
5fe5ea74285e2fc0fbf7568c53f251aa894650fbTimo Sirainen the Free Software Foundation; either version 3 of the License, or
0dffa25d211be541ee3c953b23566a1a990789dfTimo Sirainen (at your option) any later version.
5fe5ea74285e2fc0fbf7568c53f251aa894650fbTimo Sirainen This program is distributed in the hope that it will be useful,
5fe5ea74285e2fc0fbf7568c53f251aa894650fbTimo Sirainen but WITHOUT ANY WARRANTY; without even the implied warranty of
a33b41b1dc19c692b1283049ec4de492fdadeb9aTimo Sirainen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5fe5ea74285e2fc0fbf7568c53f251aa894650fbTimo Sirainen GNU General Public License for more details.
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen You should have received a copy of the GNU General Public License
5fe5ea74285e2fc0fbf7568c53f251aa894650fbTimo Sirainen along with this program. If not, see <http://www.gnu.org/licenses/>.
a33b41b1dc19c692b1283049ec4de492fdadeb9aTimo Sirainenvoid print_sss_result(struct sss_sudo_result *result);
a33b41b1dc19c692b1283049ec4de492fdadeb9aTimo Sirainen fprintf(stderr, "Usage: sss_sudo_cli username\n");
a33b41b1dc19c692b1283049ec4de492fdadeb9aTimo Sirainen /* get sss_result - it will send new query to responder */
1de2b5a16a455e018d8cbf72ee114d4b5d557a48Timo Sirainen ret = sss_sudo_send_recv_defaults(&error, &result);
8ad2759cf4073e3bf4fcb9222a86e2153ed31875Timo Sirainen fprintf(stderr, "sss_sudo_send_recv_defaults() failed: %s\n", strerror(ret));
8ad2759cf4073e3bf4fcb9222a86e2153ed31875Timo Sirainen ret = sss_sudo_send_recv(argv[1], &error, &result);
8ad2759cf4073e3bf4fcb9222a86e2153ed31875Timo Sirainen fprintf(stderr, "sss_sudo_send_recv() failed: %s\n", strerror(ret));
8ad2759cf4073e3bf4fcb9222a86e2153ed31875Timo Sirainenvoid print_sss_result(struct sss_sudo_result *result)
8ad2759cf4073e3bf4fcb9222a86e2153ed31875Timo Sirainen printf("Number of rules: %d\n", result->num_rules);
8ad2759cf4073e3bf4fcb9222a86e2153ed31875Timo Sirainen printf("=== Rule %d has %d attributes\n", i, rule->num_attrs);
8ad2759cf4073e3bf4fcb9222a86e2153ed31875Timo Sirainen printf(" === Attribute named %s has %d values:\n", attr->name,