svn commit: samba r8178 - in trunk/source/smbd: .

vlendec at samba.org vlendec at samba.org
Wed Jul 6 08:20:08 GMT 2005


Author: vlendec
Date: 2005-07-06 08:20:06 +0000 (Wed, 06 Jul 2005)
New Revision: 8178

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

Log:
Make Samba3 pass the new delete-on-close test.

Jeremy, I'm not sure this is the right way to do it, please review.

Thanks,

Volker

Modified:
   trunk/source/smbd/trans2.c


Changeset:
Modified: trunk/source/smbd/trans2.c
===================================================================
--- trunk/source/smbd/trans2.c	2005-07-06 08:13:11 UTC (rev 8177)
+++ trunk/source/smbd/trans2.c	2005-07-06 08:20:06 UTC (rev 8178)
@@ -2828,6 +2828,35 @@
 			return set_bad_path_error(errno, bad_path, outbuf, ERRDOS,ERRbadpath);
 		}
 
+		{
+			int i, num_shares;
+			share_mode_entry *shares;
+			BOOL deleted = False;
+
+			/* We need to return NT_STATUS_DELETE_PENDING if any
+			 * process has that flag set. */
+
+			num_shares = get_share_modes(conn, sbuf.st_dev,
+						     sbuf.st_ino, &shares);
+
+			for (i=0; i<num_shares; i++) {
+				if ((shares[i].create_options &
+				     FILE_DELETE_ON_CLOSE) == 0) {
+					continue;
+				}
+				deleted = True;
+				break;
+			}
+
+			if (num_shares > 0) {
+				SAFE_FREE(shares);
+			}
+
+			if (deleted) {
+				return ERROR_NT(NT_STATUS_DELETE_PENDING);
+			}
+		}
+
 		if (INFO_LEVEL_IS_UNIX(info_level)) {
 			/* Always do lstat for UNIX calls. */
 			if (SMB_VFS_LSTAT(conn,fname,&sbuf)) {



More information about the samba-cvs mailing list