Browse Source

do not try to load sessions if session_file config parameter is empty

master
Tomasz Sowa 2 months ago
parent
commit
ebfa5f7405
  1. 41
      winixd/core/sessionmanager.cpp

41
winixd/core/sessionmanager.cpp

@ -652,26 +652,34 @@ void SessionManager::LoadSessions()
SessionParser sp;
SessionContainer::Iterator i;
sp.set_dependency(this);
if( !config->session_file.empty() )
{
sp.set_dependency(this);
// sessions will be overwritten (pointers are invalidated)
cur->session = &temporary_session;
// sessions will be overwritten (pointers are invalidated)
cur->session = &temporary_session;
sp.SetUsers(&system->users);
sp.Parse(config->session_file, session_tab);
sp.SetUsers(&system->users);
sp.Parse(config->session_file, session_tab);
for(i=session_tab.Begin() ; i != session_tab.End() ; ++i)
{
i->plugin_data.Resize(plugin->Size());
plugin->Call(&(*i), WINIX_SESSION_CREATED);
for(i=session_tab.Begin() ; i != session_tab.End() ; ++i)
{
i->plugin_data.Resize(plugin->Size());
plugin->Call(&(*i), WINIX_SESSION_CREATED);
/*
!! IMPROVE ME
we do not add it to the last_container (we don't have IP address stored yet)
*/
/*
!! IMPROVE ME
we do not add it to the last_container (we don't have IP address stored yet)
*/
if( i->puser )
plugin->Call(&(*i), WINIX_USER_LOGGED);
if( i->puser )
plugin->Call(&(*i), WINIX_USER_LOGGED);
}
}
else
{
// FIXME this log is not printed, why?
main_log << log1 << "SM: session_file config parameter is empty, not loading sessions" << logend;
}
cur->session = &temporary_session;
@ -686,7 +694,10 @@ void SessionManager::SaveSessions()
char file_path[WINIX_OS_PATH_SIZE];
if( config->session_file.empty() )
{
main_log << log1 << "SM: session_file config parameter is empty, not saving sessions - sessions lost" << logend;
return;
}
if( !wide_to_utf8(config->session_file, file_path, WINIX_OS_PATH_SIZE) )
return;

Loading…
Cancel
Save