Feature Request - Notify Prompt - Willing to create PR
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
Direzione di ricerca
The proof of concept points to src/tgetpass.c, in tgetpass just before the prompt is written. First read how prompt handling and sudoers defaults are defined and validated, including their visudo editing path; the issue does not identify those entry points. Done means a scoped, safe configuration design and implementation that notifies when sudo waits for a password, with behavior and security expectations defined.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I often have multiple terminals open with each terminal running some pipeline, (compiling, linting, installing, etc).
Some of those pipelines take a very long time and other than intermittently checking back in with each terminal, I have no way of knowing if a pipeline is done compiling and waiting to install and sitting at a sudo prompt for installation permission.
I would like to provide a user-configurable way to hook some (pre-approved and defined) external tool to let me know that sudo is waiting for input before it eventually times out the and pipeline fails.
I have a proof of concept which accomplishes exactly what I want:
// in src/tgetpass.c::tgetpass
// right before writing the prompt to output
if (notify) {
system("notify-send \"sudo\" \"sudo is prompting for a password\"");
}
I realize I don't want the external tool to be any arbitrary executable which could allow an injection and I don't want the notification to be configurable either. I would imagine that the user could specify something in the sudoers conf file something like:
Defaults promptpass_notify=notify-send
And the values for that option would be checked at init time to ensure there are no arbitrary calls to unexpected notifier scripts. (Although I realize someone could just symlink whatever they want, is this even a concern? This would be executed before sudo was even authorized to execute the given command)
I would be willing to do the legwork on this feature, but I got stuck in understanding how to implement this with support for editing with visudo and where a flag like this would live in conf or if it should just be an env flag.
- Lingua principale
- C
- Stelle
- 1.7k
- Fork
- 306
- Merge medio
- 1g 2h
- PR unite (30g)
- 22
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sudo-project/sudo
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
sudo-project/sudo#583 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
sudo-project/sudo#581 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Signal forwarded to the command is lost when it arrives between fork() and execve() of the commandAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
sudo-project/sudo#566 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
sudo-project/sudo#553 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
sudo-project/sudo#552 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di sudo-project/sudo
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
InukaAsith/TwinDesk#84 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
CanadaHonk/porffor#426 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
FujiNetWIFI/fujinet-firmware#2221 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 77/100
raysan5/raylib.com#132 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100