]> granicus.if.org Git - sudo/commitdiff
Use the runhost for "User foo is not allowed to run sudo on bar."
authorTodd C. Miller <Todd.Miller@sudo.ws>
Wed, 29 May 2019 21:26:57 +0000 (15:26 -0600)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Wed, 29 May 2019 21:26:57 +0000 (15:26 -0600)
Otherwise, if the -h option is specified sudo will print the local
host name instead of the host specified via -h.

plugins/sudoers/parse.c

index 5c972d97f652a356693029a40f4bf6c673f4ffc5..4cea829e92c7fa1f4fe501e27324afe827b9b211 100644 (file)
@@ -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;