Re: retrieving the remain time of a cached credential
Dennis Schwartz via sudo-users <[email protected]> Fri, 27 Sep 2019 13:24:57 +0000
| Newsgroups | gmane.comp.tools.sudo.user |
|---|---|
| Message-ID | <NGsnUnCQ7HgLsxbrMFN-1rqOeLCz1OP7fIfqpn0OibY7jnutADpXQOY0wJx5fDhsfnOvJbzVwNEnXXQwzloTx2UNEA3mTU_ABNYHgL3vILM=@protonmail.com> |
On Thursday, September 26, 2019 6:20 PM, Dennis Schwartz via sudo-users <[email protected]> wrote: > On Thursday, September 26, 2019 5:56 PM, Todd C. Miller [email protected] wrote: > > > On Thu, 26 Sep 2019 15:41:04 -0000, Dennis Schwartz via sudo-users wrote: > > > > > This, that `sudo` can be quite easily prevented of sending security email > > > is the only thing that still bothers me a bit. > > > For example, one could define the function > > > > > > sudo-no-email () { > > > ( > > > trap "" XFSZ > > > limit filesize 0 > > > sudo $@ > > > ) > > > } > > > > > > > > > and run `sudo-no-email touch /root/some-file` and no security email would > > > ever be sent if the sudo command fails. > > > > This doesn't work in my experiance. If you set the filesize to > > zero sudo won't be able to function, at least with the current > > version of sudo. It might have worked on older versions of sudo > > where the time stamp record was a zero-length file. > > Here's what I see on Ubuntu 18.04.3 with filesize set to 0: > > $ sudo id > > Filesize limit exceeded (core dumped) > > It probably makes sense for sudo to enforce minimum resource limits > > but it's not clear exactly what those minimum values should be. > > Hmm, strange. I don't run Ubuntu, but under Arch Linux and Debian (buster) > I get > > $ sudo-no-mail ls > sudo: unable to write to /run/sudo/ts/[username]: File too large > [sudo] password for [username]: > test > $ sudo-no-mail ls > sudo: unable to write to /run/sudo/ts/[username]: File too large > [sudo] password for [username]: > Sorry, try again. > [sudo] password for [username]: > Sorry, try again. > [sudo] password for [username]: > sudo: 3 incorrect password attempts > $ sudo --version Just to be sure I went ahead and installed Ubuntu 18.04.3 in a VM. Fresh out of the box, I installed zsh and ran zsh$ ( trap "" XFSZ; limit filesize 0; sudo id ) I get the exact same results as above. I cannot replicate your result of sudo failing to operate like you indicated. - Dennis ____________________________________________________________ sudo-users mailing list <[email protected]> For list information, options, or to unsubscribe, visit: https://www.sudo.ws/mailman/listinfo/sudo-users