Skip to content

fix(gokrb5.config): do not panic on auth_to_local*#550

Open
matchaxnb wants to merge 3 commits into
jcmturner:masterfrom
matchaxnb:master
Open

fix(gokrb5.config): do not panic on auth_to_local*#550
matchaxnb wants to merge 3 commits into
jcmturner:masterfrom
matchaxnb:master

Conversation

@matchaxnb
Copy link
Copy Markdown

auth_to_local* directives are still not supported, but that's not a good reason to panic when we encounter them. Now we will just explicitly ignore them.

Also improve error reporting in general when we encounter incomplete parser situations. Now, if we are in an unhandled parser situation, we will return an explicit error instead of panicking on an IndexError.

Previous situation: passing an "auth_to_local" directive caused a Panic when doing v := strings.TrimSpace(p[1])
Now we are just explicitly saying we do not support that which is objectively better.

When we encounter an unsupported configuration directive and the parser reaches an incorrect state, we will report the error and output the config. There's a good chance that the latest configuration directive put is the unsupported one. This way, we can easily fix such mistakes when they come in issues.

Extended:
Also improve error reporting when we encounter incomplete parser
situations. Now, if we are in an unhandled parser situation, we will
return an explicit error instead of panicking on an IndexError.

Previous situation: passing an "auth_to_local" directive caused a Panic
when doing v := strings.TrimSpace(p[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant