diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-25 01:29:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:04:36 -0500 |
commit | c1c696460b74fa3dd381f3903ec0281f6f1865a9 (patch) | |
tree | bdd730f1c2641cdd67376b988e0038569a143442 /source4/ntvfs/common | |
parent | def9a12bccd7113658220086fb32d388b47faaf7 (diff) | |
download | samba-c1c696460b74fa3dd381f3903ec0281f6f1865a9.tar.gz samba-c1c696460b74fa3dd381f3903ec0281f6f1865a9.tar.bz2 samba-c1c696460b74fa3dd381f3903ec0281f6f1865a9.zip |
r3174: added pvfs_is_open() to allow us to check for open files on unlink. We
now pass BASE-UNLINK.
(This used to be commit f23a2f8538bda8f6790e86c93ee22436388b2975)
Diffstat (limited to 'source4/ntvfs/common')
-rw-r--r-- | source4/ntvfs/common/opendb.c | 20 |
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; +} |