Bug 741

Summary: SIGSEGV on sudo cp pam_unix.so /usr/lib/security/
Product: Sudo Reporter: kitteboss
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED INVALID    
Severity: normal CC: kitteboss
Priority: normal    
Version: 1.8.15   
Hardware: PC   
OS: Linux   
Attachments: Output of valgrind and ltrace

Description kitteboss 2016-03-26 08:00:28 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
Comment 1 Todd C. Miller 2016-03-26 08:16:45 MDT
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/