fix permissions of created recordings (issue #6067)
[asterisk/asterisk.git] / apps / app_chanspy.c
index 3a27edf..6069066 100644 (file)
@@ -440,7 +440,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
        if (recbase) {
                char filename[512];
                snprintf(filename,sizeof(filename),"%s/%s.%d.raw",ast_config_AST_MONITOR_DIR, recbase, (int)time(NULL));
-               if ((fd = open(filename, O_CREAT | O_WRONLY, O_TRUNC)) <= 0) {
+               if ((fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0644)) <= 0) {
                        ast_log(LOG_WARNING, "Cannot open %s for recording\n", filename);
                        fd = 0;
                }