From 8b22ed783786bb6e53f0d20b2dc36f1a8486342c Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 21 Feb 2018 21:24:53 -0700 Subject: [PATCH] Fix LDIF conversion of commands with an associated digest. --- plugins/sudoers/cvtsudoers_ldif.c | 6 ++++-- plugins/sudoers/regress/sudoers/test14.ldif.ok | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/sudoers/cvtsudoers_ldif.c b/plugins/sudoers/cvtsudoers_ldif.c index cf35c3939..6da4ca58c 100644 --- a/plugins/sudoers/cvtsudoers_ldif.c +++ b/plugins/sudoers/cvtsudoers_ldif.c @@ -139,8 +139,10 @@ print_member_ldif(FILE *fp, char *name, int type, bool negated, case COMMAND: c = (struct sudo_command *)name; fprintf(fp, "%s: ", prefix); - if (c->digest != NULL) - fprintf(fp, "%s:", digest_type_to_name(c->digest->digest_type)); + if (c->digest != NULL) { + fprintf(fp, "%s:%s ", digest_type_to_name(c->digest->digest_type), + c->digest->digest_str); + } fprintf(fp, "%s%s", negated ? "!" : "", c->cmnd); if (c->args != NULL) fprintf(fp, " %s", c->args); diff --git a/plugins/sudoers/regress/sudoers/test14.ldif.ok b/plugins/sudoers/regress/sudoers/test14.ldif.ok index 6c8b9c3a5..abb48867a 100644 --- a/plugins/sudoers/regress/sudoers/test14.ldif.ok +++ b/plugins/sudoers/regress/sudoers/test14.ldif.ok @@ -4,8 +4,8 @@ objectClass: sudoRole cn: millert sudoUser: millert sudoHost: ALL -sudoCommand: sha224:/bin/ls -sudoCommand: sha256:/bin/sh -sudoCommand: sha512:/bin/kill +sudoCommand: sha224:d06a2617c98d377c250edd470fd5e576327748d82915d6e33b5f8db1 /bin/ls +sudoCommand: sha256:hOtoe/iK6SlGg7w4BfZBBdSsXjUmTJ5+ts51yjh7vkM= /bin/sh +sudoCommand: sha512:srzYEQ2aqzm+it3f74opTMkIImZRLxBARVpb0g9RSouJYdLt7DTRMEY4Ry9NyaOiDoUIplpNjqYH0JMYPVdFnw /bin/kill sudoOrder: 1 -- 2.40.0