Module: kamailio
Branch: master
Commit: bb42ee28fc115e1e3373962c02162c9a8e6d41fc
URL:
https://github.com/kamailio/kamailio/commit/bb42ee28fc115e1e3373962c02162c9…
Author: Kristian F. Høgh <kfh(a)uni-tel.dk>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2020-10-21T15:05:09+02:00
utils/pdbt: Relax permissions when creating files
---
Modified: utils/pdbt/pdbt.c
---
Diff:
https://github.com/kamailio/kamailio/commit/bb42ee28fc115e1e3373962c02162c9…
Patch:
https://github.com/kamailio/kamailio/commit/bb42ee28fc115e1e3373962c02162c9…
---
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;