libsss_sudo  1.8.4
src/sss_client/sudo/sss_sudo.h
00001 /*
00002     Authors:
00003         Pavel Březina <pbrezina@redhat.com>
00004 
00005     Copyright (C) 2011 Red Hat
00006 
00007     This program is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 3 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 #ifndef SSS_SUDO_H_
00022 #define SSS_SUDO_H_
00023 
00032 #include <stdint.h>
00033 
00035 #ifndef EOK
00036 #define EOK 0
00037 #endif
00038 
00042 #define SSS_SUDO_ERROR_OK   0
00043 
00049 struct sss_sudo_attr {
00051     char *name;
00053     char **values;
00054 
00059     unsigned int num_values;
00060 };
00061 
00066 struct sss_sudo_rule {
00068     unsigned int num_attrs;
00069 
00071     struct sss_sudo_attr *attrs;
00072 };
00073 
00079 struct sss_sudo_result {
00087     unsigned int num_rules;
00088 
00090     struct sss_sudo_rule *rules;
00091 };
00092 
00117 int sss_sudo_send_recv(const char *username,
00118                        uint32_t *_error,
00119                        struct sss_sudo_result **_result);
00120 
00141 int sss_sudo_send_recv_defaults(uint32_t *_error,
00142                                 struct sss_sudo_result **_result);
00143 
00150 void sss_sudo_free_result(struct sss_sudo_result *result);
00151 
00168 int sss_sudo_get_values(struct sss_sudo_rule *e,
00169                         const char *attrname,
00170                         char ***values);
00171 
00178 void sss_sudo_free_values(char **values);
00179 
00183 #endif /* SSS_SUDO_H_ */