[sudo-users] How to Use Special Chars in Polices From SSSD

Johnathan Smith 1johnathan.smith at gmail.com
Thu Oct 17 14:48:01 MDT 2019


In sudo 1.8.25 with the policy coming through SSSD, how do I setup a policy
that includes special chars with an LDAP based policy?

As a simple example, I am trying to run:
sudo echo "q\nq"
where the \n is treated as a newline.

Currently, the only way I have been able to do this is with
sudoCommand: /bin/echo -e "q\nq"
and by running
sudo echo -e \"q\nq\"

If I remove the quotes in the policy, sudo -l shows
/bin/echo -e q\\nq
as the allowed command and the double slashes won't ever match what I need.

Having to escape the quotes while running the command is not ideal. If
there is another way to do this, I would appreciate the help.

Thanks,
John


More information about the sudo-users mailing list