[sudo-workers] [PATCH] sudo/plugins/suoders/sudoers2ldif: Support #include and #includedir recursively

Todd C. Miller Todd.Miller at courtesan.com
Tue Oct 17 14:29:40 MDT 2017


On Mon, 16 Oct 2017 16:11:03 +0200, Natale Vinto wrote:

> as said sometimes ago in the mailing list, I was wondering on how
> better extend sudoers2ldif script, starting from supporting #include
> and #includedir.
> 
> The idea is to look recursively for any #include and #includedir
> directive in file parsed, and then parse it accordingly maintaining
> the same behavior as now.

Thanks, that looks great.  I made a few minor changes to handle
relative include paths, for example:

#include sudoers.other

should look in the same parent directory as the file it was included
from.

I also added checks to skip reading file with a '.' in them or that
end in '~' when scanning an include dir.  This is consistent with
how the sudoers parser behaves.

This has been committed as https://www.sudo.ws/repos/sudo/rev/926deea0d506

 - todd


More information about the sudo-workers mailing list