Fix umask and password memory wipe
- Set umask(0077) in daemonize() to prevent world-readable files - Wipe password from memory after psync_set_user_pass() Fixes #203, #204
This commit is contained in:
parent
b5a6847968
commit
8d57e404d1
|
|
@ -485,7 +485,7 @@ int daemonize(bool do_commands) {
|
|||
}
|
||||
|
||||
/* Open any logs here */
|
||||
umask(0);
|
||||
umask(0077);
|
||||
sid = setsid();
|
||||
if (sid < 0) {
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
|
|||
|
|
@ -442,6 +442,7 @@ static void status_change(pstatus_t *status) {
|
|||
psync_set_user_pass(clib::pclsync_lib::get_lib().get_username().c_str(),
|
||||
clib::pclsync_lib::get_lib().get_password().c_str(),
|
||||
(int)clib::pclsync_lib::get_lib().save_pass_);
|
||||
clib::pclsync_lib::get_lib().wipe_password();
|
||||
std::cout << "logging in" << std::endl;
|
||||
} else if (status->status == PSTATUS_TFA_REQUIRED) {
|
||||
if (clib::pclsync_lib::get_lib().get_tfa_code().empty()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue