Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feature Request - Notify Prompt - Willing to create PR

Aperta
#365 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
c
Ambito
cli, security

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sudo-project/sudo

Tutte le issue di sudo-project/sudo

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.