diff options
author | Greg Hudson <ghudson@mit.edu> | 2017-06-19 11:30:38 -0400 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2017-07-17 19:18:08 -0400 |
commit | 17e970f8c8e9e0d3847fb72112c63a3f93f696e9 (patch) | |
tree | 4771878d9fee3f00f2a6e11d28b19016bf8bcc64 | |
parent | 856ae7d866f7d89b367acf1b81118bf19e51a2e9 (diff) | |
download | krb5-17e970f8c8e9e0d3847fb72112c63a3f93f696e9.zip krb5-17e970f8c8e9e0d3847fb72112c63a3f93f696e9.tar.gz krb5-17e970f8c8e9e0d3847fb72112c63a3f93f696e9.tar.bz2 |
Fix kadm5.acl error reporting
In kadm5int_acl_get_line(), increment *lnp after skipping a blank or
comment line, so that kadm5int_acl_load_acl_file() correctly reports
the line number if it fails to parse a line.
In acl_syn_err_msg, use %.10s to limit the amount of the line included
in the error message, not %10s to left-pad it with spaces if it is
shorter than ten characters.
(cherry picked from commit 3efb19294012ad38ac3a95d407e739313838c68a)
ticket: 8588
version_fixed: 1.14.6
-rw-r--r-- | src/lib/kadm5/srv/server_acl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/kadm5/srv/server_acl.c b/src/lib/kadm5/srv/server_acl.c index e41a94d..931d5f2 100644 --- a/src/lib/kadm5/srv/server_acl.c +++ b/src/lib/kadm5/srv/server_acl.c @@ -90,7 +90,7 @@ static const char *acl_line2long_msg = N_("%s: line %d too long, truncated"); static const char *acl_op_bad_msg = N_("Unrecognized ACL operation '%c' in " "%s"); static const char *acl_syn_err_msg = N_("%s: syntax error at line %d " - "<%10s...>"); + "<%.10s...>"); static const char *acl_cantopen_msg = N_("%s while opening ACL file %s"); @@ -107,9 +107,9 @@ kadm5int_acl_get_line(fp, lnp) static int line_incr = 0; static char acl_buf[BUFSIZ]; - *lnp += line_incr; - line_incr = 0; for (domore = 1; domore && !feof(fp); ) { + *lnp += line_incr; + line_incr = 0; /* Copy in the line, with continuations */ for (i = 0; ((i < BUFSIZ) && !feof(fp)); i++) { int byte; |