summaryrefslogtreecommitdiffstats
path: root/src/util/sss_ssh.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/sss_ssh.c')
-rw-r--r--src/util/sss_ssh.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/util/sss_ssh.c b/src/util/sss_ssh.c
index 0163c1d89..60ed5878a 100644
--- a/src/util/sss_ssh.c
+++ b/src/util/sss_ssh.c
@@ -136,13 +136,18 @@ char *
sss_ssh_format_pubkey(TALLOC_CTX *mem_ctx,
struct sss_ssh_ent *ent,
struct sss_ssh_pubkey *pubkey,
- enum sss_ssh_pubkey_format format)
+ enum sss_ssh_pubkey_format format,
+ const char *comment)
{
TALLOC_CTX *tmp_ctx;
char *blob;
char *algo;
char *result = NULL;
+ if (!comment) {
+ comment = ent->name;
+ }
+
tmp_ctx = talloc_new(NULL);
if (!tmp_ctx) {
return NULL;
@@ -166,7 +171,7 @@ sss_ssh_format_pubkey(TALLOC_CTX *mem_ctx,
goto done;
}
- result = talloc_asprintf(mem_ctx, "%s %s %s", algo, blob, ent->name);
+ result = talloc_asprintf(mem_ctx, "%s %s %s", algo, blob, comment);
break;
}