Bug 1020

Summary: Does not find its pty in qemu-user-static
Product: Sudo Reporter: Marc Haber <mh+sudo-bugzilla>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.9.8   
Hardware: PC   
OS: Linux   
URL: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=940533

Description Marc Haber 2022-02-02 04:34:00 MST
Hi,

in qemu-user-static, /proc/self/stat contains a lot of zeroes. Sudo tries to read its tty from that file and fails if run in qemu-user-static.

The URL contains instructions how to reproduce this.

The reporter suggests to fall back to reading /proc/self/fd/0 if /proc/self/stat fails.

Greetings
Marc
Comment 1 Todd C. Miller 2022-02-02 11:26:14 MST
I've added fallback code in https://www.sudo.ws/repos/sudo/rev/c32620c9f115 which should work around the qemu problem.
Comment 2 Todd C. Miller 2022-03-04 09:15:31 MST
Fixed in sudo 1.9.10