Use of "-l" and stdout redirected to /dev/null hangs sudo
vincentbernat opened this issue · 2 comments
vincentbernat commented
Hey!
Since 1.9.15, sudo -l ls > /dev/null
locks the sudo process on fcntl(1, F_SETLKW, {l_type=F_WRLCK, l_whence=SEEK_CUR, l_start=0, l_len=0})
. I believe this is because of the tentative to avoid multiple sudo processes to modify the terminal settings.
millert commented
Locking /dev/null on Linux always seems to block, which is an interesting choice. Only locking if the fd is actually a tty fixes the problem.
millert commented
The fix is present in sudo 1.9.15p3