summaryrefslogtreecommitdiffstats
path: root/vtysh/vtysh_user.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-01-13 19:49:50 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-01-13 19:49:50 +0100
commitfba55c8ac3d0068c694c98c2b641c622b8a6f189 (patch)
treec2d665d03d0b6fc5346a5fd4a7885c8ca786a3cb /vtysh/vtysh_user.c
parentdebian: Remove unnecessary dependency on cl-utilties (diff)
downloadfrr-fba55c8ac3d0068c694c98c2b641c622b8a6f189.tar.xz
frr-fba55c8ac3d0068c694c98c2b641c622b8a6f189.zip
doc, vtysh: Fixup of history handling
This fix does two things: 1) If the ${HOME}/.history_quagga file does not exist, create it for history storing. 2) Allow vtysh -c "..." commands to be stored in history file as well Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'vtysh/vtysh_user.c')
-rw-r--r--vtysh/vtysh_user.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/vtysh/vtysh_user.c b/vtysh/vtysh_user.c
index 0e314bcbb..214279fac 100644
--- a/vtysh/vtysh_user.c
+++ b/vtysh/vtysh_user.c
@@ -207,8 +207,18 @@ vtysh_auth ()
return 0;
}
+char *
+vtysh_get_home (void)
+{
+ struct passwd *passwd;
+
+ passwd = getpwuid (getuid ());
+
+ return passwd ? passwd->pw_dir : NULL;
+}
+
void
-vtysh_user_init ()
+vtysh_user_init (void)
{
userlist = list_new ();
install_element (CONFIG_NODE, &username_nopassword_cmd);