summaryrefslogtreecommitdiff
path: root/source4/ntvfs/common
diff options
context:
space:
mode:
Diffstat (limited to 'source4/ntvfs/common')
-rw-r--r--source4/ntvfs/common/opendb.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/ntvfs/common/opendb.c b/source4/ntvfs/common/opendb.c
index 3def23f190..5c962fbad0 100644
--- a/source4/ntvfs/common/opendb.c
+++ b/source4/ntvfs/common/opendb.c
@@ -335,3 +335,23 @@ NTSTATUS odb_set_create_options(struct odb_lock *lck,
return status;
}
+
+
+/*
+ determine if a file is open
+*/
+BOOL odb_is_open(struct odb_context *odb, DATA_BLOB *key)
+{
+ TDB_DATA dbuf;
+ TDB_DATA kbuf;
+
+ kbuf.dptr = key->data;
+ kbuf.dsize = key->length;
+
+ dbuf = tdb_fetch(odb->w->tdb, kbuf);
+ if (dbuf.dptr == NULL) {
+ return False;
+ }
+ free(dbuf.dptr);
+ return True;
+}