Change Debug sudo.conf setting to take a program name as the first
argument. In the future, this will allow visudo and sudoreplay to use their own Debug entries.
This commit is contained in:
@@ -97,12 +97,27 @@ static struct sudo_conf_paths sudo_conf_paths[] = {
|
|||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* "Debug progname debug_file debug_flags"
|
||||||
|
*/
|
||||||
static int
|
static int
|
||||||
set_debug(const char *entry, void *data)
|
set_debug(const char *entry, void *data)
|
||||||
{
|
{
|
||||||
size_t filelen;
|
size_t filelen, proglen;
|
||||||
|
const char *progname;
|
||||||
|
|
||||||
|
/* Is this debug setting for me? */
|
||||||
|
progname = getprogname();
|
||||||
|
if (strcmp(progname, "sudoedit") == 0)
|
||||||
|
progname = "sudo";
|
||||||
|
proglen = strlen(progname);
|
||||||
|
if (strncmp(entry, progname, proglen) != 0 ||
|
||||||
|
!isblank((unsigned char)entry[proglen]))
|
||||||
|
return FALSE;
|
||||||
|
entry += proglen + 1;
|
||||||
|
while (isblank((unsigned char)*entry))
|
||||||
|
entry++;
|
||||||
|
|
||||||
/* Parse Debug line */
|
|
||||||
debug_flags = strpbrk(entry, " \t");
|
debug_flags = strpbrk(entry, " \t");
|
||||||
if (debug_flags == NULL)
|
if (debug_flags == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Reference in New Issue
Block a user