Yay: [Feature]- Can we get a terminal bell before sudo prompt on long builds.

Created on 23 Sep 2019  路  10Comments  路  Source: Jguer/yay

Affected Version

yay v9.3.1 - libalpm v11.0.3

Issue

Steps to reproduce

  1. build large package such as linux-ck
  2. Miss sudo prompt
  3. have to redo the intial build process
    FEATURE Request

Cam we get a terminal bell before the sudo prompt shows up (especially after a long build) to prompt us that our password has to be entered.

Won't Fix Feature Request

Most helpful comment

Doesn't seem to be going anywhere and people clamoring for it seem satisfied with --sudoloop.
@raxod502 , I forgot to answer you but sudoloop is a security vulnerability therefore it won't be set as default. I was actually looking for the pull request where this was thoroughly explained 26 days ago but I couldn't find it.

All 10 comments

If you missed sudo that means it already built the package. You should be able to go the the yay cache and just pacman -U the package

You can. However this seems like a less then ideal solution. Perhaps we can detect when there is a up to date built package and just install that instead of going through prebuild when clean-build is not chosen.

Or maybe just a desktop notification with notify-send or dunstify?

That also works. However this would not work over ssh and assumes that the user is in an desktop environment.

What about requesting sudo up front and then running sudo -v in the background every minute so at least you don't have to continually check back to see if compilation has finished (else sudo will time out if you don't check back soon enough, and you have to redo everything)? I've seen this technique used before in scripts that perform a similar function to Yay.

What about requesting sudo up front and then running sudo -v in the background every minute so at least you don't have to continually check back to see if compilation has finished (else sudo will time out if you don't check back soon enough, and you have to redo everything)? I've seen this technique used before in scripts that perform a similar function to Yay.

You mean yay --sudoloop? https://github.com/Jguer/yay/blob/de95a0e2539a804a581a6d3cff32d59637b03057/doc/yay.8#L486-L488

In regards to the feature request itself, I don't like using notify-send or dunstifyexactly for the reasons @alexcote1 pointed out. I'm open to implementation suggestions/examples how other projects deal with it though.

@Jguer Oh, indeed you're right. I feel like this usability problem would be well-addressed if that were the default and you could disable it with --nosudoloop. I guess I can make a configuration file, but the default mode of operation seems strictly inferior given its nondeterminism with respect to depending on how long the build takes.

Doesn't seem to be going anywhere and people clamoring for it seem satisfied with --sudoloop.
@raxod502 , I forgot to answer you but sudoloop is a security vulnerability therefore it won't be set as default. I was actually looking for the pull request where this was thoroughly explained 26 days ago but I couldn't find it.

as of sudo version 1.8.28, sudo has a -B option which sends a terminal bell. You could use the above commits with sudoflags = -B.
https://www.sudo.ws/man/1.8.28/sudo.man.html

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AdrienLemaire picture AdrienLemaire  路  3Comments

captn3m0 picture captn3m0  路  4Comments

makeworld-the-better-one picture makeworld-the-better-one  路  3Comments

nivaca picture nivaca  路  4Comments

muesli picture muesli  路  4Comments