We don't want to translate debugging messages.

This commit is contained in:
Todd C. Miller
2011-05-17 18:37:18 -04:00
parent c3a259f5ee
commit 917c8d48ad
4 changed files with 50 additions and 54 deletions

View File

@@ -835,7 +835,7 @@ sudo_ldap_check_bool(LDAP *ld, LDAPMessage *entry, char *option)
/* walk through options */ /* walk through options */
for (p = bv; *p != NULL; p++) { for (p = bv; *p != NULL; p++) {
var = (*p)->bv_val;; var = (*p)->bv_val;;
DPRINTF((_("ldap sudoOption: '%s'"), var), 2); DPRINTF(("ldap sudoOption: '%s'", var), 2);
if ((ch = *var) == '!') if ((ch = *var) == '!')
var++; var++;
@@ -868,7 +868,7 @@ sudo_ldap_parse_options(LDAP *ld, LDAPMessage *entry)
/* walk through options */ /* walk through options */
for (p = bv; *p != NULL; p++) { for (p = bv; *p != NULL; p++) {
var = estrdup((*p)->bv_val); var = estrdup((*p)->bv_val);
DPRINTF((_("ldap sudoOption: '%s'"), var), 2); DPRINTF(("ldap sudoOption: '%s'", var), 2);
/* check for equals sign past first char */ /* check for equals sign past first char */
val = strchr(var, '='); val = strchr(var, '=');
@@ -1349,11 +1349,11 @@ sudo_ldap_read_config(void)
value = ldap_conf.krb5_ccname + value = ldap_conf.krb5_ccname +
(ldap_conf.krb5_ccname[4] == ':' ? 5 : 7); (ldap_conf.krb5_ccname[4] == ':' ? 5 : 7);
if ((fp = fopen(value, "r")) != NULL) { if ((fp = fopen(value, "r")) != NULL) {
DPRINTF((_("using krb5 credential cache: %s"), value), 1); DPRINTF(("using krb5 credential cache: %s", value), 1);
fclose(fp); fclose(fp);
} else { } else {
/* Can't open it, just ignore the entry. */ /* Can't open it, just ignore the entry. */
DPRINTF((_("unable to open krb5 credential cache: %s"), value), 1); DPRINTF(("unable to open krb5 credential cache: %s", value), 1);
efree(ldap_conf.krb5_ccname); efree(ldap_conf.krb5_ccname);
ldap_conf.krb5_ccname = NULL; ldap_conf.krb5_ccname = NULL;
} }
@@ -1635,7 +1635,7 @@ sudo_ldap_display_privs(struct sudo_nss *nss, struct passwd *pw,
goto done; goto done;
ld = handle->ld; ld = handle->ld;
DPRINTF((_("ldap search for command list")), 1); DPRINTF(("ldap search for command list"), 1);
lres = sudo_ldap_result_get(nss, pw); lres = sudo_ldap_result_get(nss, pw);
/* Display all matching entries. */ /* Display all matching entries. */
@@ -1668,7 +1668,7 @@ sudo_ldap_display_cmnd(struct sudo_nss *nss, struct passwd *pw)
* The sudo_ldap_result_get() function returns all nodes that match * The sudo_ldap_result_get() function returns all nodes that match
* the user and the host. * the user and the host.
*/ */
DPRINTF((_("ldap search for command list")), 1); DPRINTF(("ldap search for command list"), 1);
lres = sudo_ldap_result_get(nss, pw); lres = sudo_ldap_result_get(nss, pw);
for (i = 0; i < lres->nentries; i++) { for (i = 0; i < lres->nentries; i++) {
entry = lres->entries[i].entry; entry = lres->entries[i].entry;
@@ -1750,7 +1750,7 @@ sudo_ldap_set_options(LDAP *ld)
cur->conf_str, ival, ldap_err2string(rc)); cur->conf_str, ival, ldap_err2string(rc));
return -1; return -1;
} }
DPRINTF((_("ldap_set_option: %s -> %d"), cur->conf_str, ival), 1); DPRINTF(("ldap_set_option: %s -> %d", cur->conf_str, ival), 1);
} }
break; break;
case CONF_STR: case CONF_STR:
@@ -1762,7 +1762,7 @@ sudo_ldap_set_options(LDAP *ld)
cur->conf_str, sval, ldap_err2string(rc)); cur->conf_str, sval, ldap_err2string(rc));
return -1; return -1;
} }
DPRINTF((_("ldap_set_option: %s -> %s"), cur->conf_str, sval), 1); DPRINTF(("ldap_set_option: %s -> %s", cur->conf_str, sval), 1);
} }
break; break;
} }
@@ -1908,7 +1908,7 @@ sudo_ldap_bind_s(LDAP *ld)
if (gss_krb5_ccache_name(&status, ldap_conf.krb5_ccname, &old_ccname) if (gss_krb5_ccache_name(&status, ldap_conf.krb5_ccname, &old_ccname)
!= GSS_S_COMPLETE) { != GSS_S_COMPLETE) {
old_ccname = NULL; old_ccname = NULL;
DPRINTF((_("gss_krb5_ccache_name() failed: %d"), status), 1); DPRINTF(("gss_krb5_ccache_name() failed: %d", status), 1);
} }
# else # else
setenv("KRB5CCNAME", ldap_conf.krb5_ccname, TRUE); setenv("KRB5CCNAME", ldap_conf.krb5_ccname, TRUE);
@@ -1919,7 +1919,7 @@ sudo_ldap_bind_s(LDAP *ld)
if (ldap_conf.krb5_ccname != NULL) { if (ldap_conf.krb5_ccname != NULL) {
# ifdef HAVE_GSS_KRB5_CCACHE_NAME # ifdef HAVE_GSS_KRB5_CCACHE_NAME
if (gss_krb5_ccache_name(&status, old_ccname, NULL) != GSS_S_COMPLETE) if (gss_krb5_ccache_name(&status, old_ccname, NULL) != GSS_S_COMPLETE)
DPRINTF((_("gss_krb5_ccache_name() failed: %d"), status), 1); DPRINTF(("gss_krb5_ccache_name() failed: %d", status), 1);
# else # else
if (old_ccname != NULL) if (old_ccname != NULL)
setenv("KRB5CCNAME", old_ccname, TRUE); setenv("KRB5CCNAME", old_ccname, TRUE);
@@ -1932,7 +1932,7 @@ sudo_ldap_bind_s(LDAP *ld)
ldap_err2string(rc)); ldap_err2string(rc));
return -1; return -1;
} }
DPRINTF((_("ldap_sasl_interactive_bind_s() ok")), 1); DPRINTF(("ldap_sasl_interactive_bind_s() ok"), 1);
} else } else
#endif /* HAVE_LDAP_SASL_INTERACTIVE_BIND_S */ #endif /* HAVE_LDAP_SASL_INTERACTIVE_BIND_S */
#ifdef HAVE_LDAP_SASL_BIND_S #ifdef HAVE_LDAP_SASL_BIND_S
@@ -1948,7 +1948,7 @@ sudo_ldap_bind_s(LDAP *ld)
warningx(_("ldap_sasl_bind_s(): %s"), ldap_err2string(rc)); warningx(_("ldap_sasl_bind_s(): %s"), ldap_err2string(rc));
return -1; return -1;
} }
DPRINTF((_("ldap_sasl_bind_s() ok")), 1); DPRINTF(("ldap_sasl_bind_s() ok"), 1);
} }
#else #else
{ {
@@ -1957,7 +1957,7 @@ sudo_ldap_bind_s(LDAP *ld)
warningx(_("ldap_simple_bind_s(): %s"), ldap_err2string(rc)); warningx(_("ldap_simple_bind_s(): %s"), ldap_err2string(rc));
return -1; return -1;
} }
DPRINTF((_("ldap_simple_bind_s() ok")), 1); DPRINTF(("ldap_simple_bind_s() ok"), 1);
} }
#endif #endif
return 0; return 0;
@@ -2012,7 +2012,7 @@ sudo_ldap_open(struct sudo_nss *nss)
warningx(_("ldap_start_tls_s(): %s"), ldap_err2string(rc)); warningx(_("ldap_start_tls_s(): %s"), ldap_err2string(rc));
return -1; return -1;
} }
DPRINTF((_("ldap_start_tls_s() ok")), 1); DPRINTF(("ldap_start_tls_s() ok"), 1);
#elif defined(HAVE_LDAP_SSL_CLIENT_INIT) && defined(HAVE_LDAP_START_TLS_S_NP) #elif defined(HAVE_LDAP_SSL_CLIENT_INIT) && defined(HAVE_LDAP_START_TLS_S_NP)
if (ldap_ssl_client_init(NULL, NULL, 0, &rc) != LDAP_SUCCESS) { if (ldap_ssl_client_init(NULL, NULL, 0, &rc) != LDAP_SUCCESS) {
warningx(_("ldap_ssl_client_init(): %s"), ldap_err2string(rc)); warningx(_("ldap_ssl_client_init(): %s"), ldap_err2string(rc));
@@ -2023,7 +2023,7 @@ sudo_ldap_open(struct sudo_nss *nss)
warningx(_("ldap_start_tls_s_np(): %s",) ldap_err2string(rc)); warningx(_("ldap_start_tls_s_np(): %s",) ldap_err2string(rc));
return -1; return -1;
} }
DPRINTF((_("ldap_start_tls_s_np() ok")), 1); DPRINTF(("ldap_start_tls_s_np() ok"), 1);
#else #else
warningx(_("start_tls specified but LDAP libs do not support ldap_start_tls_s() or ldap_start_tls_s_np()")); warningx(_("start_tls specified but LDAP libs do not support ldap_start_tls_s() or ldap_start_tls_s_np()"));
#endif /* !HAVE_LDAP_START_TLS_S && !HAVE_LDAP_START_TLS_S_NP */ #endif /* !HAVE_LDAP_START_TLS_S && !HAVE_LDAP_START_TLS_S_NP */
@@ -2060,7 +2060,7 @@ sudo_ldap_setdefs(struct sudo_nss *nss)
ld = handle->ld; ld = handle->ld;
filt = sudo_ldap_build_default_filter(); filt = sudo_ldap_build_default_filter();
DPRINTF((_("Looking for cn=defaults: %s"), filt), 1); DPRINTF(("Looking for cn=defaults: %s", filt), 1);
for (base = ldap_conf.base; base != NULL; base = base->next) { for (base = ldap_conf.base; base != NULL; base = base->next) {
if (ldap_conf.timeout > 0) { if (ldap_conf.timeout > 0) {
@@ -2072,10 +2072,10 @@ sudo_ldap_setdefs(struct sudo_nss *nss)
rc = ldap_search_ext_s(ld, base->val, LDAP_SCOPE_SUBTREE, rc = ldap_search_ext_s(ld, base->val, LDAP_SCOPE_SUBTREE,
filt, NULL, 0, NULL, NULL, NULL, 0, &result); filt, NULL, 0, NULL, NULL, NULL, 0, &result);
if (rc == LDAP_SUCCESS && (entry = ldap_first_entry(ld, result))) { if (rc == LDAP_SUCCESS && (entry = ldap_first_entry(ld, result))) {
DPRINTF((_("found: %s"), ldap_get_dn(ld, entry)), 1); DPRINTF(("found:%s", ldap_get_dn(ld, entry)), 1);
sudo_ldap_parse_options(ld, entry); sudo_ldap_parse_options(ld, entry);
} else } else
DPRINTF((_("no default options found in %s"), base->val), 1); DPRINTF(("no default options found in %s", base->val), 1);
if (result) if (result)
ldap_msgfree(result); ldap_msgfree(result);
@@ -2109,7 +2109,7 @@ sudo_ldap_lookup(struct sudo_nss *nss, int ret, int pwflag)
* password is required, so the order of the entries doesn't matter. * password is required, so the order of the entries doesn't matter.
*/ */
if (pwflag) { if (pwflag) {
DPRINTF((_("perform search for pwflag %d"), pwflag), 1); DPRINTF(("perform search for pwflag %d", pwflag), 1);
int doauth = UNSPEC; int doauth = UNSPEC;
enum def_tuple pwcheck = enum def_tuple pwcheck =
(pwflag == -1) ? never : sudo_defs_table[pwflag].sd_un.tuple; (pwflag == -1) ? never : sudo_defs_table[pwflag].sd_un.tuple;
@@ -2152,7 +2152,7 @@ sudo_ldap_lookup(struct sudo_nss *nss, int ret, int pwflag)
goto done; goto done;
} }
DPRINTF((_("searching LDAP for sudoers entries")), 1); DPRINTF(("searching LDAP for sudoers entries"), 1);
setenv_implied = FALSE; setenv_implied = FALSE;
for (i = 0; i < lres->nentries; i++) { for (i = 0; i < lres->nentries; i++) {
@@ -2162,10 +2162,10 @@ sudo_ldap_lookup(struct sudo_nss *nss, int ret, int pwflag)
rc = sudo_ldap_check_command(ld, entry, &setenv_implied); rc = sudo_ldap_check_command(ld, entry, &setenv_implied);
if (rc != UNSPEC) { if (rc != UNSPEC) {
/* We have a match. */ /* We have a match. */
DPRINTF((rc == TRUE ? _("Command allowed") : _("Command not allowed")), 1); DPRINTF(("Command %sallowed", rc == TRUE ? "" : "NOT "), 1);
matched = TRUE; matched = TRUE;
if (rc == TRUE) { if (rc == TRUE) {
DPRINTF((_("LDAP entry: %p"), entry), 1); DPRINTF(("LDAP entry: %p", entry), 1);
/* Apply entry-specific options. */ /* Apply entry-specific options. */
if (setenv_implied) if (setenv_implied)
def_setenv = TRUE; def_setenv = TRUE;
@@ -2188,7 +2188,7 @@ sudo_ldap_lookup(struct sudo_nss *nss, int ret, int pwflag)
} }
done: done:
DPRINTF((_("done with LDAP searches")), 1); DPRINTF(("done with LDAP searches"), 1);
DPRINTF(("user_matches=%d", lres->user_matches), 1); DPRINTF(("user_matches=%d", lres->user_matches), 1);
DPRINTF(("host_matches=%d", lres->host_matches), 1); DPRINTF(("host_matches=%d", lres->host_matches), 1);
@@ -2253,13 +2253,13 @@ sudo_ldap_result_add_entry(struct ldap_result *lres, LDAPMessage *entry)
if (bv != NULL) { if (bv != NULL) {
if (ldap_count_values_len(bv) > 0) { if (ldap_count_values_len(bv) > 0) {
/* Get the value of this attribute, 0 if not present. */ /* Get the value of this attribute, 0 if not present. */
DPRINTF((_("order attribute raw: %s"), (*bv)->bv_val), 1); DPRINTF(("order attribute raw: %s", (*bv)->bv_val), 1);
order = strtod((*bv)->bv_val, &ep); order = strtod((*bv)->bv_val, &ep);
if (ep == (*bv)->bv_val || *ep != '\0') { if (ep == (*bv)->bv_val || *ep != '\0') {
warningx(_("invalid sudoOrder attribute: %s"), (*bv)->bv_val); warningx(_("invalid sudoOrder attribute: %s"), (*bv)->bv_val);
order = 0.0; order = 0.0;
} }
DPRINTF((_("order attribute: %f"), order), 1); DPRINTF(("order attribute: %f", order), 1);
} }
ldap_value_free_len(bv); ldap_value_free_len(bv);
} }
@@ -2290,7 +2290,7 @@ sudo_ldap_result_free_nss(struct sudo_nss *nss)
struct sudo_ldap_handle *handle = nss->handle; struct sudo_ldap_handle *handle = nss->handle;
if (handle->result != NULL) { if (handle->result != NULL) {
DPRINTF((_("freeing saved search result")), 1); DPRINTF(("removing reusable search result"), 1);
sudo_ldap_result_free(handle->result); sudo_ldap_result_free(handle->result);
if (handle->username) { if (handle->username) {
efree(handle->username); efree(handle->username);
@@ -2324,12 +2324,12 @@ sudo_ldap_result_get(struct sudo_nss *nss, struct passwd *pw)
if (handle->result) { if (handle->result) {
if (handle->groups == user_groups && if (handle->groups == user_groups &&
strcmp(pw->pw_name, handle->username) == 0) { strcmp(pw->pw_name, handle->username) == 0) {
DPRINTF((_("reusing previous result (user %s) with %d entries"), DPRINTF(("reusing previous result (user %s) with %d entries",
handle->username, handle->result->nentries), 1); handle->username, handle->result->nentries), 1);
return handle->result; return handle->result;
} }
/* User mismatch, cached result cannot be used. */ /* User mismatch, cached result cannot be used. */
DPRINTF((_("removing result (user %s), new search (user %s)"), DPRINTF(("removing result (user %s), new search (user %s)",
handle->username, pw->pw_name), 1); handle->username, pw->pw_name), 1);
sudo_ldap_result_free_nss(nss); sudo_ldap_result_free_nss(nss);
} }
@@ -2355,9 +2355,9 @@ sudo_ldap_result_get(struct sudo_nss *nss, struct passwd *pw)
lres = sudo_ldap_result_alloc(); lres = sudo_ldap_result_alloc();
for (do_netgr = 0; do_netgr < 2; do_netgr++) { for (do_netgr = 0; do_netgr < 2; do_netgr++) {
filt = do_netgr ? sudo_ldap_build_pass2() : sudo_ldap_build_pass1(pw); filt = do_netgr ? sudo_ldap_build_pass2() : sudo_ldap_build_pass1(pw);
DPRINTF((_("ldap search '%s'"), filt), 1); DPRINTF(("ldap search '%s'", filt), 1);
for (base = ldap_conf.base; base != NULL; base = base->next) { for (base = ldap_conf.base; base != NULL; base = base->next) {
DPRINTF((_("searching from base '%s'"), base->val), 1); DPRINTF(("searching from base '%s'", base->val), 1);
if (ldap_conf.timeout > 0) { if (ldap_conf.timeout > 0) {
tv.tv_sec = ldap_conf.timeout; tv.tv_sec = ldap_conf.timeout;
tv.tv_usec = 0; tv.tv_usec = 0;
@@ -2367,13 +2367,13 @@ sudo_ldap_result_get(struct sudo_nss *nss, struct passwd *pw)
rc = ldap_search_ext_s(ld, base->val, LDAP_SCOPE_SUBTREE, filt, rc = ldap_search_ext_s(ld, base->val, LDAP_SCOPE_SUBTREE, filt,
NULL, 0, NULL, NULL, NULL, 0, &result); NULL, 0, NULL, NULL, NULL, 0, &result);
if (rc != LDAP_SUCCESS) { if (rc != LDAP_SUCCESS) {
DPRINTF((_("nothing found for '%s'"), filt), 1); DPRINTF(("nothing found for '%s'", filt), 1);
continue; continue;
} }
lres->user_matches = TRUE; lres->user_matches = TRUE;
/* Add the seach result to list of search results. */ /* Add the seach result to list of search results. */
DPRINTF((_("adding search result")), 1); DPRINTF(("adding search result"), 1);
sudo_ldap_result_add_search(lres, ld, result); sudo_ldap_result_add_search(lres, ld, result);
LDAP_FOREACH(entry, ld, result) { LDAP_FOREACH(entry, ld, result) {
if ((!do_netgr || if ((!do_netgr ||
@@ -2383,13 +2383,13 @@ sudo_ldap_result_get(struct sudo_nss *nss, struct passwd *pw)
sudo_ldap_result_add_entry(lres, entry); sudo_ldap_result_add_entry(lres, entry);
} }
} }
DPRINTF((_("result now has %d entries"), lres->nentries), 1); DPRINTF(("result now has %d entries", lres->nentries), 1);
} }
efree(filt); efree(filt);
} }
/* Sort the entries by the sudoOrder attribute. */ /* Sort the entries by the sudoOrder attribute. */
DPRINTF((_("sorting remaining %d entries"), lres->nentries), 1); DPRINTF(("sorting remaining %d entries", lres->nentries), 1);
qsort(lres->entries, lres->nentries, sizeof(lres->entries[0]), qsort(lres->entries, lres->nentries, sizeof(lres->entries[0]),
ldap_entry_compare); ldap_entry_compare);
@@ -2468,7 +2468,7 @@ sudo_ldap_result_from_search(LDAP *ldap, LDAPMessage *searchresult)
LDAP_FOREACH(entry, last->ldap, last->searchresult) { LDAP_FOREACH(entry, last->ldap, last->searchresult) {
sudo_ldap_result_add_entry(result, entry); sudo_ldap_result_add_entry(result, entry);
} }
DPRINTF((_("sudo_ldap_result_from_search: %d entries found"), DPRINTF(("sudo_ldap_result_from_search: %d entries found",
result->nentries), 2); result->nentries), 2);
return result; return result;
} }

View File

@@ -234,7 +234,7 @@ sudo_execve(struct command_details *details, struct command_status *cstat)
if (!ISSET(details->flags, CD_BACKGROUND)) { if (!ISSET(details->flags, CD_BACKGROUND)) {
if (ISSET(details->flags, CD_SET_UTMP)) if (ISSET(details->flags, CD_SET_UTMP))
utmp_user = details->utmp_user ? details->utmp_user : user_details.username; utmp_user = details->utmp_user ? details->utmp_user : user_details.username;
sudo_debug(8, _("allocate pty for I/O logging")); sudo_debug(8, "allocate pty for I/O logging");
pty_setup(details->euid, user_details.tty, utmp_user); pty_setup(details->euid, user_details.tty, utmp_user);
} }
} }
@@ -354,7 +354,7 @@ sudo_execve(struct command_details *details, struct command_status *cstat)
if (cstat->type == CMD_WSTATUS) { if (cstat->type == CMD_WSTATUS) {
if (WIFSTOPPED(cstat->val)) { if (WIFSTOPPED(cstat->val)) {
/* Suspend parent and tell child how to resume on return. */ /* Suspend parent and tell child how to resume on return. */
sudo_debug(8, _("child stopped, suspending parent")); sudo_debug(8, "child stopped, suspending parent");
n = suspend_parent(WSTOPSIG(cstat->val)); n = suspend_parent(WSTOPSIG(cstat->val));
schedule_signal(n); schedule_signal(n);
continue; continue;
@@ -426,12 +426,12 @@ handle_signals(int fd, pid_t child, int log_io, struct command_status *cstat)
/* If pipe is empty, we are done. */ /* If pipe is empty, we are done. */
if (errno == EAGAIN) if (errno == EAGAIN)
break; break;
sudo_debug(9, _("error reading signal pipe %s"), strerror(errno)); sudo_debug(9, "error reading signal pipe %s", strerror(errno));
cstat->type = CMD_ERRNO; cstat->type = CMD_ERRNO;
cstat->val = errno; cstat->val = errno;
return -1; return -1;
} }
sudo_debug(9, _("received signal %d"), signo); sudo_debug(9, "received signal %d", signo);
if (signo == SIGCHLD) { if (signo == SIGCHLD) {
/* /*
* If logging I/O, child is the intermediate process, * If logging I/O, child is the intermediate process,
@@ -496,7 +496,7 @@ forward_signals(int sock)
while (!tq_empty(&sigfwd_list)) { while (!tq_empty(&sigfwd_list)) {
sigfwd = tq_first(&sigfwd_list); sigfwd = tq_first(&sigfwd_list);
sudo_debug(9, _("sending signal %d to child over backchannel"), sudo_debug(9, "sending signal %d to child over backchannel",
sigfwd->signo); sigfwd->signo);
cstat.type = CMD_SIGNO; cstat.type = CMD_SIGNO;
cstat.val = sigfwd->signo; cstat.val = sigfwd->signo;

View File

@@ -321,7 +321,7 @@ suspend_parent(int signo)
/* Suspend self and continue child when we resume. */ /* Suspend self and continue child when we resume. */
sa.sa_handler = SIG_DFL; sa.sa_handler = SIG_DFL;
sigaction(signo, &sa, &osa); sigaction(signo, &sa, &osa);
sudo_debug(8, _("kill parent %d"), signo); sudo_debug(8, "kill parent %d", signo);
if (killpg(ppgrp, signo) != 0) if (killpg(ppgrp, signo) != 0)
warning("killpg(%d, %d)", ppgrp, signo); warning("killpg(%d, %d)", ppgrp, signo);
@@ -332,9 +332,8 @@ suspend_parent(int signo)
* Only modify term if we are foreground process and either * Only modify term if we are foreground process and either
* the old tty mode was not cooked or child got SIGTT{IN,OU} * the old tty mode was not cooked or child got SIGTT{IN,OU}
*/ */
sudo_debug(8, sudo_debug(8, "parent is in %s, ttymode %d -> %d",
foreground ? _("parent is in foreground, ttymode %d -> %d") : foreground ? "foreground" : "background", oldmode, ttymode);
_("parent is in background, ttymode %d -> %d"), oldmode, ttymode);
if (ttymode != TERM_COOKED) { if (ttymode != TERM_COOKED) {
if (foreground) { if (foreground) {
@@ -699,7 +698,7 @@ deliver_signal(pid_t pid, int signo)
int status; int status;
/* Handle signal from parent. */ /* Handle signal from parent. */
sudo_debug(8, _("signal %d from parent"), signo); sudo_debug(8, "signal %d from parent", signo);
switch (signo) { switch (signo) {
case SIGALRM: case SIGALRM:
terminate_child(pid, TRUE); terminate_child(pid, TRUE);
@@ -742,10 +741,10 @@ send_status(int fd, struct command_status *cstat)
n = send(fd, cstat, sizeof(*cstat), 0); n = send(fd, cstat, sizeof(*cstat), 0);
} while (n == -1 && errno == EINTR); } while (n == -1 && errno == EINTR);
if (n != sizeof(*cstat)) { if (n != sizeof(*cstat)) {
sudo_debug(8, _("unable to send status to parent: %s"), sudo_debug(8, "unable to send status to parent: %s",
strerror(errno)); strerror(errno));
} else { } else {
sudo_debug(8, _("sent status to parent")); sudo_debug(8, "sent status to parent");
} }
cstat->type = CMD_INVALID; /* prevent re-sending */ cstat->type = CMD_INVALID; /* prevent re-sending */
} }
@@ -773,19 +772,16 @@ handle_sigchld(int backchannel, struct command_status *cstat)
cstat->type = CMD_WSTATUS; cstat->type = CMD_WSTATUS;
cstat->val = status; cstat->val = status;
if (WIFSTOPPED(status)) { if (WIFSTOPPED(status)) {
sudo_debug(8, _("command stopped, signal %d"), sudo_debug(8, "command stopped, signal %d", WSTOPSIG(status));
WSTOPSIG(status));
do { do {
child_pgrp = tcgetpgrp(io_fds[SFD_SLAVE]); child_pgrp = tcgetpgrp(io_fds[SFD_SLAVE]);
} while (child_pgrp == -1 && errno == EINTR); } while (child_pgrp == -1 && errno == EINTR);
if (send_status(backchannel, cstat) == -1) if (send_status(backchannel, cstat) == -1)
return alive; /* XXX */ return alive; /* XXX */
} else if (WIFSIGNALED(status)) { } else if (WIFSIGNALED(status)) {
sudo_debug(8, _("command killed, signal %d"), sudo_debug(8, "command killed, signal %d", WTERMSIG(status));
WTERMSIG(status));
} else { } else {
sudo_debug(8, _("command exited: %d"), sudo_debug(8, "command exited: %d", WEXITSTATUS(status));
WEXITSTATUS(status));
} }
} }
if (!WIFSTOPPED(status)) if (!WIFSTOPPED(status))

View File

@@ -1203,7 +1203,7 @@ sudo_debug(int level, const char *fmt, ...)
return; return;
/* Backet fmt with program name and a newline to make it a single write */ /* Backet fmt with program name and a newline to make it a single write */
easprintf(&fmt2, _("%s: %s\n"), getprogname(), fmt); easprintf(&fmt2, "%s: %s\n", getprogname(), fmt);
va_start(ap, fmt); va_start(ap, fmt);
vfprintf(stderr, fmt2, ap); vfprintf(stderr, fmt2, ap);
va_end(ap); va_end(ap);