@@ -47,12 +47,13 @@ const char *ofono_storage_dir(void)
return STORAGEDIR;
}
-int create_dirs(const char *filename, const mode_t mode)
+int create_dirs(const char *filename)
{
struct stat st;
char *dir;
const char *prev, *next;
int err;
+ static const mode_t mode = 0700;
if (filename[0] != '/')
return -1;
@@ -133,7 +134,7 @@ ssize_t write_file(const unsigned char *buffer, size_t len,
tmp_path = l_strdup_printf("%s.XXXXXX.tmp", path);
r = -1;
- if (create_dirs(path, mode | S_IXUSR) != 0)
+ if (create_dirs(path) != 0)
goto error_create_dirs;
fd = L_TFR(g_mkstemp_full(tmp_path, O_WRONLY | O_CREAT | O_TRUNC, mode));
@@ -204,7 +205,7 @@ void storage_sync(const char *imsi, const char *store, GKeyFile *keyfile)
if (path == NULL)
return;
- if (create_dirs(path, S_IRUSR | S_IWUSR | S_IXUSR) != 0) {
+ if (create_dirs(path) != 0) {
l_free(path);
return;
}
@@ -22,7 +22,7 @@
#include <fcntl.h>
#include <sys/types.h>
-int create_dirs(const char *filename, const mode_t mode);
+int create_dirs(const char *filename);
ssize_t read_file(unsigned char *buffer, size_t len,
const char *path_fmt, ...)