File sudo-1.8.10p3-fix_env_and_rc.patch of Package sudo.18794
diff -Naur sudo-1.8.10p3.orig/plugins/sudoers/env.c sudo-1.8.10p3/plugins/sudoers/env.c
--- sudo-1.8.10p3.orig/plugins/sudoers/env.c 2014-03-07 22:51:13.000000000 +0100
+++ sudo-1.8.10p3/plugins/sudoers/env.c 2017-01-12 15:00:57.997006757 +0100
@@ -478,6 +478,7 @@
if (strncmp(var, *ep, len) == 0 && (*ep)[len] == '=') {
/* Found it; shift remainder + NULL over by one. */
char **cur = ep;
+ env.env_len--;
while ((*cur = *(cur + 1)) != NULL)
cur++;
/* Keep going, could be multiple instances of the var. */
diff -Naur sudo-1.8.10p3.orig/plugins/sudoers/ldap.c sudo-1.8.10p3/plugins/sudoers/ldap.c
--- sudo-1.8.10p3.orig/plugins/sudoers/ldap.c 2014-03-07 22:51:19.000000000 +0100
+++ sudo-1.8.10p3/plugins/sudoers/ldap.c 2017-01-12 15:02:12.269006757 +0100
@@ -2380,7 +2380,7 @@
static int
sudo_ldap_bind_s(LDAP *ld)
{
- int rc;
+ int rc,rc2;
debug_decl(sudo_ldap_bind_s, SUDO_DEBUG_LDAP)
#ifdef HAVE_LDAP_SASL_INTERACTIVE_BIND_S
@@ -2415,8 +2415,8 @@
rc = ldap_sasl_interactive_bind_s(ld, ldap_conf.binddn, "GSSAPI",
NULL, NULL, LDAP_SASL_QUIET, sudo_ldap_sasl_interact, auth_id);
if (new_ccname != NULL) {
- rc = sudo_set_krb5_ccache_name(old_ccname, NULL);
- if (rc == 0) {
+ rc2 = sudo_set_krb5_ccache_name(old_ccname, NULL);
+ if (rc2 == 0) {
sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO,
"restore ccache name %s -> %s", new_ccname, old_ccname);
} else {