r3177: check for open files on rename
authorAndrew Tridgell <tridge@samba.org>
Mon, 25 Oct 2004 01:55:38 +0000 (01:55 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:04:36 +0000 (13:04 -0500)
(This used to be commit c334182095c53b09fcb65a40053b518acb6ec38b)

source4/ntvfs/posix/pvfs_rename.c

index 80b6a510b01e00c47342482c23fb3da13d28de08..89d6a0da14cecf3843d720128d1d7fc6e8426b25 100644 (file)
@@ -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));