Bugzilla – Bug 211
strange order dependence in sudoers
Last modified: 2007-11-02 15:39:25 MDT
If my sudoers file contains just two lines, like this: jack ALL=ALL jack ALL=(jill)ALL Then jack can successfully run sudo -u jill whoami However, if I reverse the order of those two lines in sudoers: jack ALL=(jill)ALL jack ALL=ALL Then sudo will fail jack with the usual message: "Sorry, user jack is not allowed to execute '/usr/bin/whoami' as jill on hill" This is a contrived example, of course. My objective is to make it as short and simple as possible. If this sudo behavior is intentional, I apologize for not comprehending. This is with 1.6.8p12, no special --configure options.
This is indeed a bug. The problem is that the parser is not distinguishing between a lack of a match in the runas user and a negative match (ie: !user).
This has been fixed in sudo 1.6.9p8.