Skip to content
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

Read /etc/gss/mech if no mech.d/*.conf found #138

Closed
wants to merge 1 commit into from

Conversation

greghudson
Copy link
Member

I introduced this bug when integrating gd's patch. Here is a fix. I think pretty much everything that can go wrong with glob() should still result in trying to read /etc/gss/mech.

@kaduk
Copy link
Member

kaduk commented May 29, 2014

I think it is permitted for glob() to return an error without having allocated/initialized gl_pathv, in which case the subsequent for loop will not have a proper termination condition.

@greghudson
Copy link
Member Author

gd's patch had a memset for globbuf, which I think is adequate to address this. I added one into the patch.

@kaduk
Copy link
Member

kaduk commented May 29, 2014

This doesn't really help, since gl_pathv is a pointer element of glob_t, so memset() just means that our assignment to gl_pathv[0] is a guaranteed NULL dereference in the case where glob() fails to allocate, as opposed to dereferencing stale register contents.

@greghudson
Copy link
Member Author

Alright, new approach, giving up on GLOB_DOOFFS.

Always read /etc/gss/mech, even if globbing /etc/gss/mech.d/*.conf
doesn't work.  Doing this using GLOB_DOOFFS proved error-prone, so use
a simpler approach: factor out the per-pathname handling into a helper
function load_if_changed, call it with MECH_CONF before the glob, then
pass each glob result through the helper.

ticket: 7925
@greghudson
Copy link
Member Author

Pushed to master as ac98187

@greghudson greghudson closed this Jun 4, 2014
@greghudson greghudson deleted the mechdfix branch June 4, 2014 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants