Re: sudo -h, -U, and []

"Todd C. Miller" <[email protected]>
Newsgroups gmane.comp.tools.sudo.user
Message-ID <[email protected]>
On Wed, 29 May 2019 16:09:01 -0400, "Michael W. Lucas" wrote:

> Under certain conditions, I can get sudo -h to return the wrong
> hostname. Not sure if this is a bug or a weird "working as designed,"
> so I'm reporting it.
>
> Testing a user's access on a new policy. Running as root.
>
> User pete has this policy in sudoers, installed on a machine called
> "freebsd."
>
> pete    dns[0-9]=ALL
>
> # sudo -l -U pete -h dns1
> User pete may run the following commands on dns1:
>     (root) ALL
>
> All good. If I get fancy with the brackets, though:
>
> pete    dns[1,3,5,7,9]=ALL
>
> # sudo -l -U pete -h dns1
> User pete is not allowed to run sudo on freebsd.
>
> I get the result for the local machine, "freebsd," and not "dns1."
>
> I'm guessing that this is because fnmatch and glob choke on the
> commas. Fine, I can't use them.
>
> The odd bit is that sudo returns the wrong hostname. I would expect it
> to return the same hostname I give in the command line?

Yes, you need to remove the commas.  The wrong host being printed
is a bug.  I've fixed it in:

    https://www.sudo.ws/repos/sudo/rev/8e6836ff952c

 - todd
____________________________________________________________
sudo-users mailing list <[email protected]>
For list information, options, or to unsubscribe, visit:
https://www.sudo.ws/mailman/listinfo/sudo-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.