diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-01-13 19:49:50 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-01-13 19:49:50 +0100 |
commit | fba55c8ac3d0068c694c98c2b641c622b8a6f189 (patch) | |
tree | c2d665d03d0b6fc5346a5fd4a7885c8ca786a3cb /vtysh/vtysh_user.c | |
parent | debian: Remove unnecessary dependency on cl-utilties (diff) | |
download | frr-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.c | 12 |
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); |