Skip to content

Commit db75969

Browse files
committed
change file permissons for lock, log, report and pcap to 666
1 parent 8702737 commit db75969

5 files changed

Lines changed: 14 additions & 4 deletions

File tree

code/bngblaster/src/bbl_interface.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ bbl_interface_lock(char *interface_name)
8484
}
8585
fprintf(lock_file, "%d", lock_pid);
8686
fclose(lock_file);
87+
chmod(lock_path, 0666);
8788
return true;
8889
}
8990

code/bngblaster/src/bbl_pcap.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,18 @@ pcapng_free()
150150

151151
pcapng_fflush();
152152

153+
if(g_ctx->pcap.write_buf) {
154+
free(g_ctx->pcap.write_buf);
155+
g_ctx->pcap.write_buf = NULL;
156+
}
157+
153158
if(g_ctx->pcap.fd != -1) {
154159
close(g_ctx->pcap.fd);
155160
g_ctx->pcap.fd = -1;
156-
return;
157161
}
158162

159-
if(g_ctx->pcap.write_buf) {
160-
free(g_ctx->pcap.write_buf);
161-
g_ctx->pcap.write_buf = NULL;
163+
if(g_ctx->pcap.filename) {
164+
chmod(g_ctx->pcap.filename, 0666);
162165
}
163166
}
164167

code/bngblaster/src/bbl_stats.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,7 @@ bbl_stats_json(bbl_stats_s * stats)
12191219
if(json_dump_file(root, g_ctx->config.json_report_filename, JSON_REAL_PRECISION(4)) != 0) {
12201220
LOG(ERROR, "Failed to create JSON report file %s\n", g_ctx->config.json_report_filename);
12211221
}
1222+
chmod(g_ctx->config.json_report_filename, 0666);
12221223
json_decref(root);
12231224
}
12241225

code/common/src/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <sys/time.h>
2121
#include <sys/queue.h>
2222
#include <arpa/inet.h>
23+
#include <sys/stat.h>
2324

2425
/* Common Definitions */
2526

code/common/src/logging.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ log_close()
7676
if(g_log_fp) {
7777
fclose(g_log_fp);
7878
g_log_fp = NULL;
79+
80+
}
81+
if(g_log_file) {
82+
chmod(g_log_file, 0666);
7983
}
8084
}
8185

0 commit comments

Comments
 (0)