terminal line settings are not reset if SIGINT is received while waiting for pam plugin
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
- Ambito
- cli, operating-systems
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
sudoin that shell - press CTRL-C
- wait for sudo to return
- execute '
tty -aagain 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
- 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à 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
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100