Support MIT dump formats 5 and 6 in hprop

Dump formats 5 and 6 differ from the supported version 4 dump format
only in that they include policy information for each principal in an
extension that the dump parsing code already knows how to ignore and
that they include policy lines.  Ignore the policy information, since
there isn't a corresponding concept in Heimdal, and accept the new
dump format versions.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
This commit is contained in:
Russ Allbery
2010-02-01 20:10:13 -08:00
committed by Love Hornquist Astrand
parent 73d0fc23a4
commit 20c65310ea

View File

@@ -256,8 +256,11 @@ mit_prop_dump(void *arg, const char *file)
q = nexttoken(&p); /* x.0 */
if(sscanf(q, "%d", &major) != 1)
errx(1, "line %d: unknown version", lineno);
if(major != 4)
errx(1, "unknown dump file format, got %d, expected 4", major);
if(major != 4 && major != 5 && major != 6)
errx(1, "unknown dump file format, got %d, expected 4-6",
major);
continue;
} else if(strcmp(q, "policy") == 0) {
continue;
} else if(strcmp(q, "princ") != 0) {
warnx("line %d: not a principal", lineno);