Module: kamailio
Branch: 5.3
Commit: 52789f4a0c2cbebd9c09d35e54267f8fc26c4848
URL:
https://github.com/kamailio/kamailio/commit/52789f4a0c2cbebd9c09d35e54267f8…
Author: Kristian F. Høgh <kfh(a)uni-tel.dk>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-10-30T14:45:31+01:00
utils/pdbt: Relax permissions when creating files
(cherry picked from commit bb42ee28fc115e1e3373962c02162c9a8e6d41fc)
(cherry picked from commit 071fe9366b3cc14f0cce1aa0373d20a0242182cb)
---
Modified: utils/pdbt/pdbt.c
---
Diff:
https://github.com/kamailio/kamailio/commit/52789f4a0c2cbebd9c09d35e54267f8…
Patch:
https://github.com/kamailio/kamailio/commit/52789f4a0c2cbebd9c09d35e54267f8…
---
diff --git a/utils/pdbt/pdbt.c b/utils/pdbt/pdbt.c
index 6521985b2b..5a52cf8c7a 100644
--- a/utils/pdbt/pdbt.c
+++ b/utils/pdbt/pdbt.c
@@ -297,7 +297,7 @@ int dt_write_tree(const struct dt_node_t *root, const char* filename)
char number[25];
number[0] = '\0';
- fd = creat(filename, S_IRWXU);
+ fd = creat(filename, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
if (fd < 0) {
LERR("cannot create file '%s'\n", filename);
return -1;
@@ -370,7 +370,7 @@ int save_mmap(struct dt_node_t *root, char *filename) {
int fd;
int n;
- fd = open(filename, O_RDWR|O_CREAT|O_TRUNC, S_IRWXU);
+ fd = open(filename, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
if (fd < 0) {
LERR("cannot create file '%s'\n", filename);
return -1;