]> git.puffer.fish Git - mirror/frr.git/commitdiff
vtysh: be helpful and kind to unprivileged users 5296/head
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 7 Nov 2019 22:59:13 +0000 (22:59 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 7 Nov 2019 23:14:07 +0000 (23:14 +0000)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
vtysh/vtysh_main.c

index d536263db0d84baef8b259f140c5a7b074dc9ea9..c7e1d252c7271a2345888c2024303dc4cfedd21d 100644 (file)
@@ -535,6 +535,9 @@ int main(int argc, char **argv, char **env)
        /* Do not connect until we have passed authentication. */
        if (vtysh_connect_all(daemon_name) <= 0) {
                fprintf(stderr, "Exiting: failed to connect to any daemons.\n");
+               if (geteuid() != 0)
+                       fprintf(stderr,
+                               "Hint: if this seems wrong, try running me as a privileged user!\n");
                if (no_error)
                        exit(0);
                else