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

terminal line settings are not reset if SIGINT is received while waiting for pam plugin

Aperta
#402 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
c, linux

Direzione di ricerca

Start by tracing how sudo handles SIGINT while waiting for PAM authentication and where terminal line settings are saved and restored; the payload does not name source files or tests. Reproduce with an interactive PAM module and compare stty -a before and after pressing Ctrl-C. Done means the original terminal settings are restored and the interrupted authentication returns cleanly.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When sudo is configured to use a pam module like pam_agent_auth trying to abort with CTRL-C(/SIGINT) sudo before the pam module returns, will break terminals. As line settings are not reset back to their original state potentially requiring the terminal to be restarted to use it again or settings to be reset in extra command if still possible.

The time window for that is generally short, but if the pam module requires interactive authentication, like physical touch for presence detection, it becomes much more likely for this to be triggered.

Further sudo wont early anyway, waiting for the authentication to timeout or succeed before finally failing.

Environment

Operating System: Nixos 24.11
Sudo version: 1.1.15p5
terminal and shell: kitty+zsh, also reproduced using different shells and terminals.

Reproduce
  • use ssh-key that requires interactive authentication (password protected/yubikey/etc)
  • Add pam module like pam_agent_auth to /etc/pam.d/sudo
    auth sufficient pam_ssh_agent_auth.so file=/etc/ssh/authorized_keys.d/%u
  • add ssh key to for user to directory
  • ensure user is in sudoers file
  • open new shell and check terminal line settings with stty -a
  • execute command with sudo in that shell
  • press CTRL-C
  • wait for sudo to return
  • execute 'tty -a again and compare to before. some settings will be changed and terminal might be broken
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.