Bugzilla – Bug 741
SIGSEGV on sudo cp pam_unix.so /usr/lib/security/
Last modified: 2016-03-26 08:16:45 MDT
Created attachment 473 [details] Output of valgrind and ltrace copying pam_unix.so to /usr/lib/security (Arch Linux) to overwrite the existing one will cause a segmentation fault valgrind and ltrace are attached
This is not a bug in sudo. If you overwrite a shared object that is in use by a program you almost guarantee that the program will crash. You almost never want to install a shared object with cp since it will overwrite the existing file/inode which may be mapped by running processes. It's better to use the install program which unlinks the destination first and thus doesn't suffer from this problem. E.g. $ sudo install pam_unix.so /usr/lib/security/