diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-11-06 09:12:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:33 -0500 |
commit | a9158e0d47636e25ce374391cd9b02df3d27b390 (patch) | |
tree | 3724958af5445d10da788f83459b8a3f18b51a81 /source4/ntvfs/posix | |
parent | 439c1524fba3b58abe9e353f9ff2bd7f103f3d12 (diff) | |
download | samba-a9158e0d47636e25ce374391cd9b02df3d27b390.tar.gz samba-a9158e0d47636e25ce374391cd9b02df3d27b390.tar.bz2 samba-a9158e0d47636e25ce374391cd9b02df3d27b390.zip |
r3574: the RAW-OPEN test changes broke a couple of the other tests. This
fixes most of them, although RAW-SEARCH still fails (due to an
interaction with the new xattr code)
(This used to be commit 09b4652b40c4cfca027765178bd5a0adbaa666c2)
Diffstat (limited to 'source4/ntvfs/posix')
-rw-r--r-- | source4/ntvfs/posix/pvfs_open.c | 27 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_rename.c | 2 |
2 files changed, 27 insertions, 2 deletions
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index 6f1fb1c87f..f0c1478e66 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -944,7 +944,32 @@ NTSTATUS pvfs_can_delete(struct pvfs_state *pvfs, struct pvfs_filename *name) NTCREATEX_SHARE_ACCESS_READ | NTCREATEX_SHARE_ACCESS_WRITE | NTCREATEX_SHARE_ACCESS_DELETE, - 0, STD_RIGHT_DELETE_ACCESS); + NTCREATEX_OPTIONS_DELETE_ON_CLOSE, + STD_RIGHT_DELETE_ACCESS); + + return status; +} + +/* + determine if a file can be renamed, or if it is prevented by an + already open file +*/ +NTSTATUS pvfs_can_rename(struct pvfs_state *pvfs, struct pvfs_filename *name) +{ + NTSTATUS status; + DATA_BLOB key; + + status = pvfs_locking_key(name, name, &key); + if (!NT_STATUS_IS_OK(status)) { + return NT_STATUS_NO_MEMORY; + } + + status = odb_can_open(pvfs->odb_context, &key, + NTCREATEX_SHARE_ACCESS_READ | + NTCREATEX_SHARE_ACCESS_WRITE | + NTCREATEX_SHARE_ACCESS_DELETE, + 0, + STD_RIGHT_DELETE_ACCESS); return status; } diff --git a/source4/ntvfs/posix/pvfs_rename.c b/source4/ntvfs/posix/pvfs_rename.c index 552148a891..a621165ce4 100644 --- a/source4/ntvfs/posix/pvfs_rename.c +++ b/source4/ntvfs/posix/pvfs_rename.c @@ -62,7 +62,7 @@ NTSTATUS pvfs_rename(struct ntvfs_module_context *ntvfs, return NT_STATUS_OBJECT_NAME_COLLISION; } - status = pvfs_can_delete(pvfs, name1); + status = pvfs_can_rename(pvfs, name1); if (!NT_STATUS_IS_OK(status)) { return status; } |