summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-25 01:55:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:36 -0500
commit2a5eb0ceba2fd225c8854891899461a61673db41 (patch)
treeaa87b95e7c297f220fb045a1c83a0c3d3d86f8e9
parent1e7e5800203b9d5cf97967c2561320783f6e4434 (diff)
downloadsamba-2a5eb0ceba2fd225c8854891899461a61673db41.tar.gz
samba-2a5eb0ceba2fd225c8854891899461a61673db41.tar.bz2
samba-2a5eb0ceba2fd225c8854891899461a61673db41.zip
r3177: check for open files on rename
(This used to be commit c334182095c53b09fcb65a40053b518acb6ec38b)
-rw-r--r--source4/ntvfs/posix/pvfs_rename.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/ntvfs/posix/pvfs_rename.c b/source4/ntvfs/posix/pvfs_rename.c
index 80b6a510b0..89d6a0da14 100644
--- a/source4/ntvfs/posix/pvfs_rename.c
+++ b/source4/ntvfs/posix/pvfs_rename.c
@@ -48,6 +48,11 @@ NTSTATUS pvfs_rename(struct ntvfs_module_context *ntvfs,
return status;
}
+ if (pvfs_is_open(pvfs, name1) ||
+ pvfs_is_open(pvfs, name2)) {
+ return NT_STATUS_SHARING_VIOLATION;
+ }
+
if (name1->has_wildcard || name2->has_wildcard) {
DEBUG(3,("Rejecting wildcard rename '%s' -> '%s'\n",
ren->rename.in.pattern1, ren->rename.in.pattern2));