From: Todd C. Miller Date: Wed, 29 May 2019 21:26:57 +0000 (-0600) Subject: Use the runhost for "User foo is not allowed to run sudo on bar." X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12c29e91bd9b6c6ae87c00fffdd0995419348303;p=sudo Use the runhost for "User foo is not allowed to run sudo on bar." Otherwise, if the -h option is specified sudo will print the local host name instead of the host specified via -h. --- diff --git a/plugins/sudoers/parse.c b/plugins/sudoers/parse.c index 5c972d97f..4cea829e9 100644 --- a/plugins/sudoers/parse.c +++ b/plugins/sudoers/parse.c @@ -775,7 +775,7 @@ display_privs(struct sudo_nss_list *snl, struct passwd *pw, bool verbose) priv_buf.len = 0; sudo_lbuf_append(&priv_buf, _("User %s is not allowed to run sudo on %s.\n"), - pw->pw_name, user_shost); + pw->pw_name, user_srunhost); } if (sudo_lbuf_error(&def_buf) || sudo_lbuf_error(&priv_buf)) goto bad;