summaryrefslogtreecommitdiff
path: root/source3/locking/posix.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-06-13 15:46:46 +0000
committerAndrew Tridgell <tridge@samba.org>2000-06-13 15:46:46 +0000
commitb50ca095af232be3a88231965449a836e5321db5 (patch)
treeed2bec23526c43c5fffffdda266b138844f38aa3 /source3/locking/posix.c
parent33179a95d82a27a077acbad57d3cd9c403afb7eb (diff)
downloadsamba-b50ca095af232be3a88231965449a836e5321db5.tar.gz
samba-b50ca095af232be3a88231965449a836e5321db5.tar.bz2
samba-b50ca095af232be3a88231965449a836e5321db5.zip
allow posix locking database to be opened read-only (for smbstatus)
(This used to be commit b9d78738bb30da3d989dfacc95cfde529f2afca5)
Diffstat (limited to 'source3/locking/posix.c')
-rw-r--r--source3/locking/posix.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index 6ab4bef4cc..69df55ba3c 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -1346,25 +1346,25 @@ void posix_locking_close_file(files_struct *fsp)
Create the in-memory POSIX lock databases.
********************************************************************/
-BOOL posix_locking_init(void)
+BOOL posix_locking_init(int read_only)
{
if (posix_lock_tdb && posix_pending_close_tdb)
return True;
-
+
if (!posix_lock_tdb)
posix_lock_tdb = tdb_open(NULL, 0, TDB_INTERNAL,
- O_RDWR|O_CREAT, 0644);
- if (!posix_lock_tdb) {
- DEBUG(0,("Failed to open POSIX byte range locking database.\n"));
+ read_only?O_RDONLY:(O_RDWR|O_CREAT), 0644);
+ if (!posix_lock_tdb) {
+ DEBUG(0,("Failed to open POSIX byte range locking database.\n"));
return False;
- }
+ }
if (!posix_pending_close_tdb)
posix_pending_close_tdb = tdb_open(NULL, 0, TDB_INTERNAL,
- O_RDWR|O_CREAT, 0644);
- if (!posix_pending_close_tdb) {
- DEBUG(0,("Failed to open POSIX pending close database.\n"));
+ read_only?O_RDONLY:(O_RDWR|O_CREAT), 0644);
+ if (!posix_pending_close_tdb) {
+ DEBUG(0,("Failed to open POSIX pending close database.\n"));
return False;
- }
+ }
return True;
}