Bug 477

Summary: sudo: symbol 'crypt': can't resolve symbol in lib '/usr/libexec/sudoers.so'
Product: Sudo Reporter: Natanael Copa <ncopa>
Component: ConfigureAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: high    
Priority: low    
Version: 1.8.0   
Hardware: PC   
OS: Linux   
Attachments: libcrypt.patch

Description Natanael Copa 2011-03-04 03:55:46 MST
When upgrading to sudo-1.8.0 on Alpine Linux sudo failed to work (breraking all our build boxes)

sudo: symbol 'crypt': can't resolve symbol in lib '/usr/libexec/sudoers.so'.
sudo: unable to dlopen /usr/libexec/sudoers.so: (null)


I notice something that looks like a bug in configure.in:
...
checking for strsignal... yes
./configure: line 17464: test: =: unary operator expected
checking for library containing crypt... -lcrypt
...

Alpine Linux is a non-GNU x86/86_64 linux distro based on uclibc/busybox.

(uclibc is fairly POSIX compliant nowdays)

My guess is that the sudoers.so needs -lcrypt, but GNU compiles fine without it.
Comment 1 Natanael Copa 2011-03-04 04:57:11 MST
Created attachment 305 [details]
libcrypt.patch

The attched patch fixes the issue for Alpine Linux.

Basicly it just adds -lcrypt hard to sudoers.so.
Comment 2 Todd C. Miller 2011-03-04 08:28:28 MST
Some libraries used for authentication were being added to SUDO_LIBS where they should be added to SUDOERS_LIBS.  In the case of shared libraries, this is not a big deal, but if the libraries are static this could cause the problem you report.

I've fixed that in the source repo, can you try ftp://ftp.sudo.ws/pub/millert/sudo/configure and verify that it works correctly for you?
Comment 3 Natanael Copa 2011-03-07 04:09:55 MST
(In reply to comment #2)
> Some libraries used for authentication were being added to SUDO_LIBS
> where they should be added to SUDOERS_LIBS.  In the case of shared
> libraries, this is not a big deal, but if the libraries are static this
> could cause the problem you report.
> 
> I've fixed that in the source repo, can you try
> ftp://ftp.sudo.ws/pub/millert/sudo/configure and verify that it works
> correctly for you?

Yes, that seems to work. Please make sure it gets included in the 1.8.1 release. Thanks!
Comment 4 Todd C. Miller 2011-03-22 09:47:08 MDT
This is fixed in 1.8.1 which is currently in beta test, see
http://www.sudo.ws/sudo/devel.html
Comment 5 Todd C. Miller 2011-04-11 08:05:09 MDT
Fixed in sudo 1.8.1