Skip to content
Snippets Groups Projects
Commit 34a65a1f authored by rswindell's avatar rswindell
Browse files

Use DEFFILEMODE (which is user/group/other read/writeable by default on *nix)

in smb_open*() when creating msgbase files.
smblib wasn't using the same default file creation mode (permissions) as
the rest of the Synchronet executables. smblib was creating msgbase files
as user read/writeable *only* (no group or other permissions) - so the umask
value for the group/other permissions flags had no effect on msgbase files
created via smblib.
This could lead to permissions issues for other users/groups on *nix systems
trying to access (read or write) msgbases. No change for non-*nix systems.
parent a53d83ee
No related branches found
No related tags found
No related merge requests found
......@@ -156,7 +156,7 @@ int SMBCALL smb_open_fp(smb_t* smb, FILE** fp, int share)
SAFEPRINTF2(path,"%s.%s",smb->file,ext);
while(1) {
if((file=sopen(path,O_RDWR|O_CREAT|O_BINARY,share,S_IREAD|S_IWRITE))!=-1)
if((file=sopen(path,O_RDWR|O_CREAT|O_BINARY,share,DEFFILEMODE))!=-1)
break;
if(get_errno()!=EACCES && get_errno()!=EAGAIN) {
safe_snprintf(smb->last_error,sizeof(smb->last_error)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment