]> granicus.if.org Git - sudo/commitdiff
Fix LDIF conversion of commands with an associated digest.
authorTodd C. Miller <Todd.Miller@sudo.ws>
Thu, 22 Feb 2018 04:24:53 +0000 (21:24 -0700)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Thu, 22 Feb 2018 04:24:53 +0000 (21:24 -0700)
plugins/sudoers/cvtsudoers_ldif.c
plugins/sudoers/regress/sudoers/test14.ldif.ok

index cf35c3939e4dd100e53190a8252677d84405235a..6da4ca58ce690c60cf471a0eb9fe9d056446614e 100644 (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);
index 6c8b9c3a503161a6181645818a5177ab5cce5bef..abb48867ade7e316d422b38e5653f57d08ebba36 100644 (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