diff options
author | Andrew Tridgell <tridge@samba.org> | 1997-10-27 14:27:17 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1997-10-27 14:27:17 +0000 |
commit | 71d648cdb431ecf984196a7e480208a94fcdf390 (patch) | |
tree | ca2ebf89d320d18000b145647afbbf0b11273bda /source3/locking/locking_shm.c | |
parent | 464dc5433641566abeeabd07f46ab569c986a3b0 (diff) | |
download | samba-71d648cdb431ecf984196a7e480208a94fcdf390.tar.gz samba-71d648cdb431ecf984196a7e480208a94fcdf390.tar.bz2 samba-71d648cdb431ecf984196a7e480208a94fcdf390.zip |
change the default file permissions on the SHARE_MEM_FILE* to
0644. smbstatus now gets only read permission on the share files and
does no locking.
also get rid of some unnecessary umask(0) calls. smbd always runs with
umask(0)
(This used to be commit c6ac10170dbba57dfebc54c50d79cb29d13bb442)
Diffstat (limited to 'source3/locking/locking_shm.c')
-rw-r--r-- | source3/locking/locking_shm.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/locking/locking_shm.c b/source3/locking/locking_shm.c index 8383b687e4..410fcb9760 100644 --- a/source3/locking/locking_shm.c +++ b/source3/locking/locking_shm.c @@ -58,6 +58,7 @@ typedef struct share_mode_entry e; } shm_share_mode_entry; +static int read_only; /******************************************************************* deinitialize the shared memory for share_mode management @@ -715,17 +716,21 @@ static struct share_ops share_ops = { /******************************************************************* initialize the shared memory for share_mode management ******************************************************************/ -struct share_ops *locking_shm_init(void) +struct share_ops *locking_shm_init(int ronly) { pstring shmem_file_name; + + read_only = ronly; pstrcpy(shmem_file_name,lp_lockdir()); - if (!directory_exist(shmem_file_name,NULL)) + if (!directory_exist(shmem_file_name,NULL)) { + if (read_only) return NULL; mkdir(shmem_file_name,0755); + } trim_string(shmem_file_name,"","/"); if (!*shmem_file_name) return(False); strcat(shmem_file_name, "/SHARE_MEM_FILE"); - if (smb_shm_open(shmem_file_name, lp_shmem_size())) + if (smb_shm_open(shmem_file_name, lp_shmem_size(), read_only)) return &share_ops; return NULL; } |