Skip to content

Commit

Permalink
change to 0666
Browse files Browse the repository at this point in the history
Signed-off-by: kronwerk <[email protected]>
  • Loading branch information
kronwerk committed Feb 14, 2025
1 parent 6e8b486 commit 4a34537
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/aof.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ int writeAofManifestFile(sds buf) {
sds tmp_am_name = getTempAofManifestFileName();
sds tmp_am_filepath = makePath(server.aof_dirname, tmp_am_name);

int fd = open(tmp_am_filepath, O_WRONLY | O_TRUNC | O_CREAT, getDataFileMode());
int fd = open(tmp_am_filepath, O_WRONLY | O_TRUNC | O_CREAT, 0666);
if (fd == -1) {
serverLog(LL_WARNING, "Can't open the AOF manifest file %s: %s", tmp_am_name, strerror(errno));

Expand Down Expand Up @@ -728,7 +728,7 @@ void aofOpenIfNeededOnServerStart(void) {

/* Here we should use 'O_APPEND' flag. */
sds aof_filepath = makePath(server.aof_dirname, aof_name);
server.aof_fd = open(aof_filepath, O_WRONLY | O_APPEND | O_CREAT, getDataFileMode());
server.aof_fd = open(aof_filepath, O_WRONLY | O_APPEND | O_CREAT, 0666);
sdsfree(aof_filepath);
if (server.aof_fd == -1) {
serverLog(LL_WARNING, "Can't open the append-only file %s: %s", aof_name, strerror(errno));
Expand Down Expand Up @@ -790,7 +790,7 @@ int openNewIncrAofForAppend(void) {
new_aof_name = sdsdup(getNewIncrAofName(temp_am));
}
sds new_aof_filepath = makePath(server.aof_dirname, new_aof_name);
newfd = open(new_aof_filepath, O_WRONLY | O_TRUNC | O_CREAT, getDataFileMode());
newfd = open(new_aof_filepath, O_WRONLY | O_TRUNC | O_CREAT, 0666);
sdsfree(new_aof_filepath);
if (newfd == -1) {
serverLog(LL_WARNING, "Can't open the append-only file %s: %s", new_aof_name, strerror(errno));
Expand Down
2 changes: 1 addition & 1 deletion src/replication.c
Original file line number Diff line number Diff line change
Expand Up @@ -3792,7 +3792,7 @@ void syncWithPrimary(connection *conn) {
int dfd = -1, maxtries = 5;
while (maxtries--) {
snprintf(tmpfile, 256, "temp-%d.%ld.rdb", (int)server.unixtime, (long int)getpid());
dfd = open(tmpfile, O_CREAT | O_WRONLY | O_EXCL, getDataFileMode());
dfd = open(tmpfile, O_CREAT | O_WRONLY | O_EXCL, 0666);
if (dfd != -1) break;
/* We save the errno of open to prevent some systems from modifying it after
* the sleep call. For example, sleep in Mac will change errno to ETIMEDOUT. */
Expand Down
5 changes: 0 additions & 5 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -6827,11 +6827,6 @@ void serverSetCpuAffinity(const char *cpulist) {
#endif
}

/* Get data file mode from server. */
mode_t getDataFileMode(void) {
return ~server.umask & 0666;
}

/* Send a notify message to systemd. Returns sd_notify return code which is
* a positive number on success. */
int serverCommunicateSystemd(const char *sd_notify_msg) {
Expand Down
1 change: 0 additions & 1 deletion src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -2594,7 +2594,6 @@ int validateProcTitleTemplate(const char *template);
int serverCommunicateSystemd(const char *sd_notify_msg);
void serverSetCpuAffinity(const char *cpulist);
void dictVanillaFree(void *val);
mode_t getDataFileMode(void);

/* ERROR STATS constants */

Expand Down

0 comments on commit 4a34537

Please sign in to comment.