sudo-ldap segfaults in 14.04 if ldap is being used
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sudo (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
NOTE: I was asked in https:/
raub@testfirewa
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty
raub@testfirewa
Linux testfirewall 3.13.0-27-generic #50-Ubuntu SMP Thu May 15 18:06:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
raub@testfirewa
and have before upgrading to 14.04 been using sudo-ldap so network admins can do some work. However, in 14.04, I am seeing
raub@testfirewa
sudo: LDAP Config Summary
sudo: ===================
sudo: uri ldap://
sudo: ldap_version 3
sudo: sudoers_base ou=SUDOers,
sudo: binddn (anonymous)
sudo: bindpw (anonymous)
sudo: bind_timelimit 3
sudo: timelimit 3
sudo: deref 0
sudo: ssl start_tls
sudo: tls_cacertfile /etc/ssl/
sudo: use_sasl yes
sudo: sasl_auth_id (NONE)
sudo: rootuse_sasl -1
sudo: rootsasl_auth_id (NONE)
sudo: sasl_secprops (NONE)
sudo: krb5_ccname FILE:/tmp/host.tkt
sudo: ===================
sudo: ldap_set_option: debug -> 0
sudo: ldap_set_option: tls_cacertfile -> /etc/ssl/
sudo: ldap_set_option: tls_cacert -> /etc/ssl/
sudo: ldap_initialize(ld, ldap://
sudo: ldap_set_option: ldap_version -> 3
sudo: ldap_set_option: timelimit -> 3
sudo: ldap_set_
sudo: ldap_set_
sudo: ldap_start_tls_s() ok
sudo: sudo_ldap_
Segmentation fault (core dumped)
raub@testfirewa
From syslog:
Jun 5 15:16:26 testfirewall kernel: [2068248.457275] sudo[22925]: segfault at 0 ip 00007f2feb02692a sp 00007ffff55073b8 error 4 in libc-2.
That affects both local and network users *and* was observed in a new install and an upgrade from 12.04LTS. Now, if I disable ldap for sudoers in /etc/nsswitch.conf,
# sudoers: files ldap
sudoers: files
I can sudo from a local user with sudo rights. What am I missing here?
I talked to Todd C. Miller, the author of sudo, who proposed the following patch:
diff -r 6c0cc2def911 plugins/ sudoers/ ldap.c sudoers/ ldap.c Wed Jun 04 11:43:39 2014 -0600 sudoers/ ldap.c Mon Jun 16 13:41:02 2014 -0600 interactive_ bind_s( ld, ldap_conf.binddn, "GSSAPI", sasl_interact, auth_id); krb5_ccache_ name(old_ ccname, NULL); krb5_ccache_ name(old_ ccname ? old_ccname : "", NULL);
sudo_ debug_printf( SUDO_DEBUG_ INFO|SUDO_ DEBUG_LINENO,
sudo_ debug_printf( SUDO_DEBUG_ WARN|SUDO_ DEBUG_LINENO,
" gss_krb5_ ccache_ name() failed: %d", rc);
--- a/plugins/
+++ b/plugins/
@@ -2429,10 +2429,11 @@
rc = ldap_sasl_
NULL, NULL, LDAP_SASL_QUIET, sudo_ldap_
if (new_ccname != NULL) {
- rc = sudo_set_
+ rc = sudo_set_
if (rc == 0) {
- "restore ccache name %s -> %s", new_ccname, old_ccname);
+ "restore ccache name %s -> %s", new_ccname,az
+ old_ccname ? old_ccname : "(none)");
} else {
We tested it in my 14.04LTS amd64 (sudo 1.8.9p5) install and that solved the problem. The above patch will be incorporated in the next version of sudo. But, I am posting it here in case someone wants to backport it to the sudo 1.8.9 ubuntu package