aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremias Stotter <jeremias@stotter.eu>2021-11-24 21:34:57 +0100
committerJeremias Stotter <jeremias@stotter.eu>2021-11-24 21:34:57 +0100
commit1d3746b94db6864b833dfb9520328b5986385f36 (patch)
treeef25ba6c107076ebace1803e1c81a0afdfbe7b99
parent20129b151918b7c8ed706bf9fa7297bc561f6ca7 (diff)
downloadJBlog-1d3746b94db6864b833dfb9520328b5986385f36.tar.gz
JBlog-1d3746b94db6864b833dfb9520328b5986385f36.tar.bz2
JBlog-1d3746b94db6864b833dfb9520328b5986385f36.zip
Changed default permission for created file to 644
-rw-r--r--admin.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/admin.c b/admin.c
index 0bd50e7..2bd4b6b 100644
--- a/admin.c
+++ b/admin.c
@@ -390,7 +390,7 @@ int post_admin(char* buffer, size_t buffer_size, char* req_content, size_t req_c
}
char save_file_path[PATH_MAX] = "";
snprintf(save_file_path, PATH_MAX, "%s/%s", adm_save_dir, publish_to);
- int save_file = open(save_file_path, O_CREAT | O_RDWR, 0600);
+ int save_file = open(save_file_path, O_CREAT | O_RDWR, 0644);
if(save_file < 0) {
snprintf(buffer, buffer_size, "<p><b>Error saving \"%s\": %s</b></p>", publish_to, strerror(errno));
return 1;
@@ -408,7 +408,7 @@ int post_admin(char* buffer, size_t buffer_size, char* req_content, size_t req_c
// Publish a file
char publish_path[PATH_MAX] = "";
snprintf(publish_path, PATH_MAX, "%s/%s", base_path, publish_to);
- int publish_file = open(publish_path, O_CREAT | O_RDWR, 0600);
+ int publish_file = open(publish_path, O_CREAT | O_RDWR, 0644);
if(publish_file < 0) {
snprintf(buffer, buffer_size, "<p><b>Error publishing \"%s\": %s</b></p>", publish_to, strerror(errno));
return 1;
@@ -507,7 +507,7 @@ int post_admin(char* buffer, size_t buffer_size, char* req_content, size_t req_c
sanitize_path(file_upload_name);
char new_filename[PATH_MAX] = "";
snprintf(new_filename, PATH_MAX, "%s%s", folder_path, file_upload_name);
- int new_file = open(new_filename, O_RDWR | O_CREAT | O_EXCL, 0600);
+ int new_file = open(new_filename, O_RDWR | O_CREAT | O_EXCL, 0644);
if(new_file < 0) {
snprintf(buffer, buffer_size, "<p><b>Error opening new file \"%s\": %s</b></p>", new_filename, strerror(errno));
return 1;
Jeremias Stotters git repositories generated by CGIT