Bugzilla – Bug 670
Segfault when sudo -i run from non-existent directory
Last modified: 2014-10-08 02:34:52 MDT
Hello, I can reproduce a segfault with sudo, version: Sudo version 1.8.11 Sudoers policy plugin version 1.8.11 Sudoers file grammar version 43 Sudoers I/O plugin version 1.8.11 configure options: ./configure --prefix=/usr --libexecdir=/usr/lib --mandir=/usr/man --with-logfac=auth --with-vardir=/var/lib/sudo --with-rundir=/var/run/sudo --without-pam --disable-nls --disable-shadow Steps to reproduce: As user: mkdir ~/test cd ~/test rm -rf ../test sudo -i Output: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory Segmentation fault Let me know if there is anything else I can provide
Created attachment 432 [details] Fix for crash when current working directory cannot be determined
(In reply to Todd C Miller from comment #1) > Created attachment 432 [details] > Fix for crash when current working directory cannot be determined Patch fixes the segfault for me. sudo -i prints the same shell-init and chdir messages, but instead of a segfault I get the root prompt and my cwd is /root. Thanks for the quick turnaround.
Fixed in sudo 1.8.11p1, available now.