]> git.proxmox.com Git - mirror_frr.git/blobdiff - vtysh/vtysh_user.c
bgpd: totalPrefixCounter incorectly shows sent prefix count
[mirror_frr.git] / vtysh / vtysh_user.c
index 17e5a7331c26c71fe4a85db1d645790d13f5154d..1ed284809ed845c3097fab3bc53f4cf3ad500f34 100644 (file)
@@ -71,6 +71,10 @@ static int vtysh_pam(const char *user)
                fprintf(stderr, "vtysh_pam: Failure to initialize pam: %s(%d)",
                        pam_strerror(pamh, ret), ret);
 
+       if (pam_acct_mgmt(pamh, 0) != PAM_SUCCESS)
+               fprintf(stderr, "%s: Failed in account validation: %s(%d)",
+                       __func__, pam_strerror(pamh, ret), ret);
+
        /* close Linux-PAM */
        if (pam_end(pamh, ret) != PAM_SUCCESS) {
                pamh = NULL;
@@ -115,7 +119,8 @@ void user_config_write(void)
 
        for (ALL_LIST_ELEMENTS(userlist, node, nnode, user)) {
                if (user->nopassword) {
-                       sprintf(line, "username %s nopassword", user->name);
+                       snprintf(line, sizeof(line), "username %s nopassword",
+                                user->name);
                        config_add_line(config_top, line);
                }
        }
@@ -147,6 +152,26 @@ DEFUN (vtysh_banner_motd_file,
        return cmd_banner_motd_file(argv[idx_file]->arg);
 }
 
+DEFUN (vtysh_banner_motd_line,
+       vtysh_banner_motd_line_cmd,
+       "banner motd line LINE...",
+       "Set banner\n"
+       "Banner for motd\n"
+       "Banner from an input\n"
+       "Text\n")
+{
+       int idx = 0;
+       char *motd;
+
+       argv_find(argv, argc, "LINE", &idx);
+       motd = argv_concat(argv, argc, idx);
+
+       cmd_banner_motd_line(motd);
+       XFREE(MTYPE_TMP, motd);
+
+       return CMD_SUCCESS;
+}
+
 DEFUN (username_nopassword,
        username_nopassword_cmd,
        "username WORD nopassword",
@@ -203,4 +228,5 @@ void vtysh_user_init(void)
        userlist = list_new();
        install_element(CONFIG_NODE, &username_nopassword_cmd);
        install_element(CONFIG_NODE, &vtysh_banner_motd_file_cmd);
+       install_element(CONFIG_NODE, &vtysh_banner_motd_line_cmd);
 }