sudo-project / sudo

Utility to execute a command as another user
https://www.sudo.ws
Other
1.15k stars 208 forks source link

I am trying to learn sudo #323

Closed trackers-lover closed 6 months ago

trackers-lover commented 8 months ago

Hello, I have created a test user and joined the wheel group, so that I can be authorized. I want to know where to parse the "% wheel ALL=(ALL) ALL" line in the sudoers file in the sudo source code? Thank you, teacher.

millert commented 6 months ago

The sudoers parser is somewhat complicated. The actual parser is written using flex and yacc (or bison) and is found in plugins/sudoers/toke.l and plugins/sudoers/gram.y. If you are not familiar with those tools it may be hard to understand. The actual rule evaluation is performed separately in plugins/sudoers/lookup.c.