-
Notifications
You must be signed in to change notification settings - Fork 5.9k
8356997: /etc/krb5.conf parser should not forbid include/includedir directives after sections #25421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back weijun! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
Webrevs
|
@@ -706,6 +770,8 @@ private List<String> loadConfigFile(final String fileName) | |||
if (line.length() > 1) { | |||
// { and content on the same line | |||
result.add(previous); | |||
unwritten.forEach(result::add); | |||
unwritten.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this code is covered by the tests at all.
I have found 2 simple ways to test it:
- change the line 62-66 in IncludeDup from
for (var inc : List.of("outside", "beginsec", "insec", "insec2",
"insubsec", "endsubsec", "endsec")) {
Files.writeString(Path.of(inc), String.format("""
[a]
b = {
c = %s
}
""", inc));
}
to
for (var inc : List.of("outside", "beginsec", "insec", "insec2",
"insubsec", "endsubsec", "endsec")) {
Files.writeString(Path.of(inc), String.format("""
[a]
b =
{ c = %s
}
""", inc));
}
- change
krb5.conf
EXAMPLE_3.COM from
EXAMPLE_3.COM = {
kdc = kdc.example.com
kdc = kdc2.example.com
inner =
{
aaa = nnn
}
}
to
EXAMPLE_3.COM = {
kdc = kdc.example.com
kdc = kdc2.example.com
inner =
{ aaa = nnn
}
}
There are other ways to cover this as well as writing it's own test case, however I feel that it might be an overkill for this.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Instead I've enhanced the random test to cover this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you :)
Several changes are made:
get
returns the first one andgetAll
returns all joining by spaces.Two new tests added. I also separately confirmed that they are parsed in the same way as MIT krb5. MIT krb5 ignores directory name after "include" but here it's an error.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25421/head:pull/25421
$ git checkout pull/25421
Update a local copy of the PR:
$ git checkout pull/25421
$ git pull https://git.openjdk.org/jdk.git pull/25421/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25421
View PR using the GUI difftool:
$ git pr show -t 25421
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25421.diff
Using Webrev
Link to Webrev Comment