mirror of https://github.com/asterisk/asterisk
The CLI .asterisk_history file is read from/written to the directory specified by the HOME environment variable. If the root user starts asterisk with the -U/-G options, or with runuser/rungroup set in asterisk.conf, the asterisk process is started as root but then it calls setuid/setgid to set the new user/group. This does NOT reset the HOME environment variable to the new user's home directory though so it's still left as "/root". In this case, the new user will almost certainly NOT have access to read from or write to the history file. * Added function process_histfile() which calls getpwuid(geteuid()) and uses pw->dir as the home directory instead of the HOME environment variable. * ast_el_read_default_histfile() and ast_el_write_default_histfile() have been modified to use the new process_histfile() function. Resolves: #337pull/347/head
parent
671eeeca24
commit
95313d4727
Loading…
Reference in new issue