Add support for multiple Debug lines per program. Callers may

register arbitrary debug facilities or use built-in defaults.  We
now use separate Debug statements for plugins and programs.
This commit is contained in:
Todd C. Miller
2014-10-22 13:23:05 -06:00
parent a7e724b75d
commit 866cfc4fc3
100 changed files with 1509 additions and 949 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2012 Todd C. Miller <Todd.Miller@courtesan.com>
* Copyright (c) 2009-2012, 2014 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -63,7 +63,7 @@ get_pty(int *master, int *slave, char *name, size_t namesz, uid_t ttyuid)
struct group *gr;
gid_t ttygid = -1;
int rval = 0;
debug_decl(get_pty, SUDO_DEBUG_PTY)
debug_decl(get_pty, SUDO_DEBUG_PTY, sudo_debug_instance)
if ((gr = getgrnam("tty")) != NULL)
ttygid = gr->gr_gid;
@@ -82,7 +82,7 @@ get_pty(int *master, int *slave, char *name, size_t namesz, uid_t ttyuid)
{
char *line;
int rval = 0;
debug_decl(get_pty, SUDO_DEBUG_PTY)
debug_decl(get_pty, SUDO_DEBUG_PTY, sudo_debug_instance)
/* IRIX-style dynamic ptys (may fork) */
line = _getpty(master, O_RDWR, S_IRUSR|S_IWUSR|S_IWGRP, 0);
@@ -120,7 +120,7 @@ get_pty(int *master, int *slave, char *name, size_t namesz, uid_t ttyuid)
{
char *line;
int rval = 0;
debug_decl(get_pty, SUDO_DEBUG_PTY)
debug_decl(get_pty, SUDO_DEBUG_PTY, sudo_debug_instance)
*master = posix_openpt(O_RDWR|O_NOCTTY);
if (*master != -1) {
@@ -162,7 +162,7 @@ get_pty(int *master, int *slave, char *name, size_t namesz, uid_t ttyuid)
struct group *gr;
gid_t ttygid = -1;
int rval = 0;
debug_decl(get_pty, SUDO_DEBUG_PTY)
debug_decl(get_pty, SUDO_DEBUG_PTY, sudo_debug_instance)
if ((gr = getgrnam("tty")) != NULL)
ttygid = gr->gr_gid;