summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2017-01-17 11:58:06 +0100
committerJakub Hrozek <jhrozek@redhat.com>2017-02-08 11:05:18 +0100
commite33744e8cc82390153c94ace53c16f72365b9fd9 (patch)
tree0a8660c2a803d70a9835f7172df951381be181c8
parentd8c459feab7659a51c23c941fea486867c2b9dae (diff)
downloadsssd-e33744e8cc82390153c94ace53c16f72365b9fd9.tar.gz
sssd-e33744e8cc82390153c94ace53c16f72365b9fd9.tar.xz
sssd-e33744e8cc82390153c94ace53c16f72365b9fd9.zip
ssh: do not create again fq name
We store fully qualified name in sysdb so there is no need to append the domain part again which result in name@domain@domain string. This field is not actually used in ssh client so it doesn't cause any issue but we should stay correct here. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
-rw-r--r--src/responder/ssh/sshsrv_cmd.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/responder/ssh/sshsrv_cmd.c b/src/responder/ssh/sshsrv_cmd.c
index bd6270d0f..195d5763e 100644
--- a/src/responder/ssh/sshsrv_cmd.c
+++ b/src/responder/ssh/sshsrv_cmd.c
@@ -982,8 +982,7 @@ ssh_cmd_build_reply(struct ssh_cmd_ctx *cmd_ctx)
struct ldb_message_element *el_user_cert_keys = NULL;
uint32_t count = 0;
const char *name;
- char *fqname;
- uint32_t fqname_len;
+ uint32_t name_len;
TALLOC_CTX *tmp_ctx;
struct ssh_ctx *ssh_ctx;
struct cli_protocol *pctx;
@@ -1060,38 +1059,31 @@ ssh_cmd_build_reply(struct ssh_cmd_ctx *cmd_ctx)
goto done;
}
- fqname = talloc_asprintf(cmd_ctx, "%s@%s",
- name, cmd_ctx->domain->name);
- if (!fqname) {
- ret = ENOMEM;
- goto done;
- }
-
- fqname_len = strlen(fqname)+1;
+ name_len = strlen(name) + 1;
ret = decode_and_add_base64_data(cmd_ctx, el, false, ssh_ctx,
- fqname_len, fqname, &c);
+ name_len, name, &c);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, "decode_and_add_base64_data failed.\n");
goto done;
}
ret = decode_and_add_base64_data(cmd_ctx, el_orig, false, ssh_ctx,
- fqname_len, fqname, &c);
+ name_len, name, &c);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, "decode_and_add_base64_data failed.\n");
goto done;
}
ret = decode_and_add_base64_data(cmd_ctx, el_override, false, ssh_ctx,
- fqname_len, fqname, &c);
+ name_len, name, &c);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, "decode_and_add_base64_data failed.\n");
goto done;
}
ret = decode_and_add_base64_data(cmd_ctx, el_user_cert_keys, true, ssh_ctx,
- fqname_len, fqname, &c);
+ name_len, name, &c);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, "decode_and_add_base64_data failed.\n");
goto done;