From fd8cf2c89baf7c323d8f6c0bf30e61a5846a11fd Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 24 Oct 2014 11:28:39 -0600 Subject: [PATCH] No need to convert sudoedit -> sudo in sudo_debug_get_instance() as we store the actual program name and only do the sudoedit -> sudo conversion when reading the sudo.conf file. Fixes debugging when invoked as sudoedit. --- lib/util/sudo_debug.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/util/sudo_debug.c b/lib/util/sudo_debug.c index 33546d166..fb29b21ab 100644 --- a/lib/util/sudo_debug.c +++ b/lib/util/sudo_debug.c @@ -370,19 +370,12 @@ sudo_debug_deregister(int instance_id) int sudo_debug_get_instance(const char *program) { - size_t proglen; int idx; - /* Treat "sudoedit" as an alias for "sudo". */ - proglen = strlen(program); - if (proglen > 4 && strcmp(program + proglen - 4, "edit") == 0) - proglen -= 4; - for (idx = 0; idx <= sudo_debug_last_instance; idx++) { if (sudo_debug_instances[idx] == NULL) continue; - if (strncmp(sudo_debug_instances[idx]->program, program, proglen) == 0 - && sudo_debug_instances[idx]->program[proglen] == '\0') + if (strcmp(sudo_debug_instances[idx]->program, program) == 0) return SUDO_DEBUG_MKINSTANCE(idx); } return SUDO_DEBUG_INSTANCE_INITIALIZER;