Skip to content
Snippets Groups Projects
Commit a1336a43 authored by pierre-luc's avatar pierre-luc
Browse files

[#1792] Creates .sflphone directory with permission 600. Also, "chmod 600" after

every file saving. Last modification might be too much and could be
removed later.
parent 73edc972
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
#include "../global.h" #include "../global.h"
#include <fstream> #include <fstream>
#include <cstdlib> #include <cstdlib>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
namespace Conf namespace Conf
{ {
...@@ -256,6 +259,10 @@ ConfigTree::saveConfigTree (const std::string& fileName) ...@@ -256,6 +259,10 @@ ConfigTree::saveConfigTree (const std::string& fileName)
file.close(); file.close();
if(chmod(fileName.c_str(), S_IRUSR | S_IWUSR)) {
_debug("Failed to set permission on configuration file because: %s\n",strerror(errno));
}
return true; return true;
} }
...@@ -333,6 +340,10 @@ ConfigTree::populateFromFile (const std::string& fileName) ...@@ -333,6 +340,10 @@ ConfigTree::populateFromFile (const std::string& fileName)
file.close(); file.close();
if(chmod(fileName.c_str(), S_IRUSR | S_IWUSR)) {
_debug("Failed to set permission on configuration file because: %s\n",strerror(errno));
}
return 1; return 1;
} }
......
...@@ -1293,7 +1293,7 @@ ManagerImpl::createSettingsPath (void) ...@@ -1293,7 +1293,7 @@ ManagerImpl::createSettingsPath (void)
{ {
_path = std::string (HOMEDIR) + DIR_SEPARATOR_STR + "." + PROGDIR; _path = std::string (HOMEDIR) + DIR_SEPARATOR_STR + "." + PROGDIR;
if (mkdir (_path.data(), 0755) != 0) { if (mkdir (_path.data(), 0600) != 0) {
// If directory creation failed // If directory creation failed
if (errno != EEXIST) { if (errno != EEXIST) {
_debug ("Cannot create directory: %s\n", strerror (errno)); _debug ("Cannot create directory: %s\n", strerror (errno));
...@@ -1953,30 +1953,6 @@ void ManagerImpl::setAudioManager (const int32_t& api) ...@@ -1953,30 +1953,6 @@ void ManagerImpl::setAudioManager (const int32_t& api)
switchAudioManager(); switchAudioManager();
return; return;
/*
int manager;
_debug(" ManagerImpl::setAudioManager :: %i \n",api);
manager = api;
if( manager == PULSEAUDIO )
{
if(app_is_running("pulseaudio") != 0)
{
// The pulseaudio daemon is not running
manager = ALSA;
notifyErrClient(PULSEAUDIO_NOT_RUNNING);
}
}
if(manager == api)
{
// it means that we can change the audio manager
setConfig( PREFERENCES , CONFIG_AUDIO , api) ;
switchAudioManager();
}
*/
} }
int32_t int32_t
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment