summaryrefslogtreecommitdiffstats
path: root/src/sss_client/sudo/sss_sudo_response.c
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2012-03-12 10:07:35 +0100
committerStephen Gallagher <sgallagh@redhat.com>2012-06-29 11:37:16 -0400
commit46d3d2c731e8c7e138462e5b60a39a279dc77d81 (patch)
treebf34e85372bbffbed1e4f648d284cc9cc487da1a /src/sss_client/sudo/sss_sudo_response.c
parentcda8ff6cfdef22356dc3c06ec5204344912f0f0b (diff)
downloadsssd-46d3d2c731e8c7e138462e5b60a39a279dc77d81.tar.gz
sssd-46d3d2c731e8c7e138462e5b60a39a279dc77d81.tar.xz
sssd-46d3d2c731e8c7e138462e5b60a39a279dc77d81.zip
sudo api: send uid, username and domainname
https://fedorahosted.org/sssd/ticket/1239 Test client was changed accordingly. The new usage is: sss_sudo_cli username [uid] If uid is not set, getpwnam(username) is called. It will retrieve both default options and rules.
Diffstat (limited to 'src/sss_client/sudo/sss_sudo_response.c')
-rw-r--r--src/sss_client/sudo/sss_sudo_response.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sss_client/sudo/sss_sudo_response.c b/src/sss_client/sudo/sss_sudo_response.c
index 4e74d83ab..471d42ed4 100644
--- a/src/sss_client/sudo/sss_sudo_response.c
+++ b/src/sss_client/sudo/sss_sudo_response.c
@@ -51,10 +51,12 @@ static int sss_sudo_parse_string(const char *message,
int sss_sudo_parse_response(const char *message,
size_t message_len,
+ char **_domainname,
struct sss_sudo_result **_result,
uint32_t *_error)
{
struct sss_sudo_result *result = NULL;
+ char *domainname = NULL;
size_t cursor = 0;
int ret = EOK;
int i = 0;
@@ -65,6 +67,16 @@ int sss_sudo_parse_response(const char *message,
return ret;
}
+ /* domain name */
+ ret = sss_sudo_parse_string(message, message_len, &cursor, &domainname);
+ if (ret != EOK) {
+ return ret;
+ }
+
+ if (_domainname != NULL) {
+ *_domainname = domainname;
+ }
+
/* result */
result = malloc(sizeof(struct sss_sudo_result));
if (result == NULL) {