Background sudo leaves terminal settings in raw-ish state after suspend/resume
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
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- c, linux
- Ambito
- cli, operating-systems
Direzione di ricerca
Start by tracing how sudo's use_pty handling saves and restores terminal settings when a background command is suspended and resumed; the report identifies this path but names no source files or tests. Reproduce with the supplied bash script on Linux Mint with use_pty enabled, then inspect the relevant terminal and job-control code. Done means the terminal settings are sane after resuming with fg, including when the command's standard streams are redirected.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
To reproduce:
- Run the following test script (which runs a background sudo process) in bash with active job control:
test.sh:
#!/bin/bash
sudo -v #ask for password if needed, so prompt doesn't interfere with the following
sudo bash -c "sleep 10" & #start sudo background process
sleep 1
stty #show terminal settings
echo "press ctrl-Z to suspend"
sleep 2
stty
sleep 2
stty sane #restore terminal settings
-
When prompted, suspend by pressing Ctrl-Z within 2 seconds
-
Resume with
fg.
Expected results:
After resume, sudo should leave the controlling terminal in a sane state.
stty output should be roughly speed 38400 baud; line = 0;, as before suspending.
Observed results:
Output is as follows. Terminal settings after resuming are similar to raw mode, and output formatting is garbled because of this:
Notably, this also happens when stdin,stdout and stderr of the sudo process are all redirected (unlike the example above). sudo nevertheless seems to interfere with the controlling terminal.
sudo version / configuration:
sudo -V
Sudo version 1.9.15p5
Sudoers policy plugin version 1.9.15p5
Sudoers file grammar version 50
Sudoers I/O plugin version 1.9.15p5
Sudoers audit plugin version 1.9.15p5
Linux mint 22.3
/etc/sudo.conf: everything commented out (Linux Mint default)
/etc/sudoers: Linux Mint default, use_pty is set
sudoers.txt
Thanks for your consideration!
- 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
-
Documentation text overflows container instead of wrappingForse di nuovo libera @BittuBarnwal7479 l’ha presa 130 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 58/100
sudo-project/sudo#547 · 1 commento ·
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
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 78/100
libsdl-org/SDL#16607 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
PowerShell/Win32-OpenSSH#2482 · 1 reazione ·
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SoftEtherVPN/SoftEtherVPN#2322 ·
I maintainer di solito rispondono entro 1 giorno