summaryrefslogtreecommitdiffstats
path: root/src/sss_client
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2012-11-13 15:42:48 +0100
committerJakub Hrozek <jhrozek@redhat.com>2012-11-14 17:33:48 +0100
commit9a27d5d673dc89cc8b99268ebbc5534b96343d69 (patch)
tree4b59b0bfc39f1a219cda73a3d1fe233ddcc5f8fb /src/sss_client
parent7e315b08152b1340511d4f6211d524482107e481 (diff)
downloadsssd-9a27d5d673dc89cc8b99268ebbc5534b96343d69.tar.gz
sssd-9a27d5d673dc89cc8b99268ebbc5534b96343d69.tar.xz
sssd-9a27d5d673dc89cc8b99268ebbc5534b96343d69.zip
sudo: do not send domain name with username
This caused troubles with subdomain users and it is not really necessary. This patch does not change the protocol itself, that should be done on the earliest possible occasion. Part of https://fedorahosted.org/sssd/ticket/1616
Diffstat (limited to 'src/sss_client')
-rw-r--r--src/sss_client/sudo/sss_sudo.c15
-rw-r--r--src/sss_client/sudo/sss_sudo_response.c7
2 files changed, 6 insertions, 16 deletions
diff --git a/src/sss_client/sudo/sss_sudo.c b/src/sss_client/sudo/sss_sudo.c
index e2bb3e00d..92f575411 100644
--- a/src/sss_client/sudo/sss_sudo.c
+++ b/src/sss_client/sudo/sss_sudo.c
@@ -100,23 +100,10 @@ int sss_sudo_send_recv(uid_t uid,
return EINVAL;
}
- if (domainname != NULL) {
- ret = asprintf(&fullname, "%s@%s", username, domainname);
- if (ret == -1) {
- return ENOMEM;
- }
- } else {
- fullname = strdup(username);
- if (fullname == NULL) {
- return ENOMEM;
- }
- }
-
/* send query and receive response */
- ret = sss_sudo_send_recv_generic(SSS_SUDO_GET_SUDORULES, uid, fullname,
+ ret = sss_sudo_send_recv_generic(SSS_SUDO_GET_SUDORULES, uid, username,
_error, NULL, _result);
- free(fullname);
return ret;
}
diff --git a/src/sss_client/sudo/sss_sudo_response.c b/src/sss_client/sudo/sss_sudo_response.c
index 471d42ed4..7d4bcc5d2 100644
--- a/src/sss_client/sudo/sss_sudo_response.c
+++ b/src/sss_client/sudo/sss_sudo_response.c
@@ -67,14 +67,17 @@ int sss_sudo_parse_response(const char *message,
return ret;
}
- /* domain name */
+ /* domain name - deprecated
+ * it won't be used, but we will read it anyway to ease parsing
+ * TODO: when possible change the protocol */
ret = sss_sudo_parse_string(message, message_len, &cursor, &domainname);
if (ret != EOK) {
return ret;
}
+ free(domainname);
if (_domainname != NULL) {
- *_domainname = domainname;
+ *_domainname = NULL;
}
/* result */