svn commit: samba r4406 - in branches/SAMBA_4_0/source/ntvfs/posix: .

tridge at samba.org tridge at samba.org
Thu Dec 30 03:19:28 GMT 2004


Author: tridge
Date: 2004-12-30 03:19:27 +0000 (Thu, 30 Dec 2004)
New Revision: 4406

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4406

Log:
- don't call the xattr unlink hook on unlink unless the link count is 1, otherwise
  the xattrs of the remaining link are removed

- fix the handling of attribute set on directories



Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_setfileinfo.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_unlink.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_setfileinfo.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_setfileinfo.c	2004-12-30 02:38:44 UTC (rev 4405)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_setfileinfo.c	2004-12-30 03:19:27 UTC (rev 4406)
@@ -365,13 +365,11 @@
 	/* possibly change the attribute */
 	if (newstats.dos.attrib != h->name->dos.attrib) {
 		mode_t mode = pvfs_fileperms(pvfs, newstats.dos.attrib);
-		if (h->name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY) {
-			/* ignore on directories for now */
-			return NT_STATUS_OK;
+		if (!(h->name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY)) {
+			if (fchmod(h->fd, mode) == -1) {
+				return pvfs_map_errno(pvfs, errno);
+			}
 		}
-		if (fchmod(h->fd, mode) == -1) {
-			return pvfs_map_errno(pvfs, errno);
-		}
 	}
 
 	*h->name = newstats;

Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_unlink.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_unlink.c	2004-12-30 02:38:44 UTC (rev 4405)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_unlink.c	2004-12-30 03:19:27 UTC (rev 4406)
@@ -89,9 +89,11 @@
 		return NT_STATUS_FILE_IS_A_DIRECTORY;
 	}
 
-	status = pvfs_xattr_unlink_hook(pvfs, name->full_name);
-	if (!NT_STATUS_IS_OK(status)) {
-		return status;
+	if (name->st.st_nlink == 1) {
+		status = pvfs_xattr_unlink_hook(pvfs, name->full_name);
+		if (!NT_STATUS_IS_OK(status)) {
+			return status;
+		}
 	}
 
 	/* finally try the actual unlink */



More information about the samba-cvs mailing list