[sudo-workers] change the "user is not in sudoers..." message

Todd C. Miller Todd.Miller at courtesan.com
Wed Sep 6 13:07:25 MDT 2017


On Wed, 06 Sep 2017 15:04:01 -0300, Joao Pedro Abreu De Souza wrote:

> I want to make something like
> 
> <conf_file>
> 
> Defaults lecture_file="..."
> 
> </conf_file>
> 
> I want to write
> 
> <conf_file>
> Defaults outOfSudoers_file="..."
> </conf_file>
> 
> and the message change.
> 
> I create the def_data.in entry, and want to put in the code that is
> hard-coded, the variable associated with this conf, but I don't found
> how to do. Where is the translation between variable in conf and
> variable in the code, after the perl script make your job? Sorry if
> this is somewhere in the sudo.ws, but i searched and don't found.

When you add a setting to def_data.in and run mkdefaults it will
define a macro prefixed with "def_" in def_data.h.

So if you added a new entry to def_data.in like this:

denial_message_file
	T_STR|T_PATH|T_BOOL
	"File containing the message when a command is denied"

In the code you'd use def_denial_message_file to access the value
after running mkdefaults.

Does that help?

 - todd


More information about the sudo-workers mailing list