Fix LDIF conversion of commands with an associated digest.

This commit is contained in:
Todd C. Miller
2018-02-21 21:24:53 -07:00
parent 91f97d2f23
commit 8b22ed7837
2 changed files with 7 additions and 5 deletions

View File

@@ -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);

View File

@@ -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