svn commit: samba r20542 - in branches/SAMBA_3_0/source/smbd: .

vlendec at samba.org vlendec at samba.org
Fri Jan 5 11:31:28 GMT 2007


Author: vlendec
Date: 2007-01-05 11:31:28 +0000 (Fri, 05 Jan 2007)
New Revision: 20542

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

Log:
Make close_remove_share_mode retun NTSTATUS. Not that anybody cares yet...
Modified:
   branches/SAMBA_3_0/source/smbd/close.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/close.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/close.c	2007-01-05 11:18:59 UTC (rev 20541)
+++ branches/SAMBA_3_0/source/smbd/close.c	2007-01-05 11:31:28 UTC (rev 20542)
@@ -144,12 +144,14 @@
  Deal with removing a share mode on last close.
 ****************************************************************************/
 
-static int close_remove_share_mode(files_struct *fsp, enum file_close_type close_type)
+static NTSTATUS close_remove_share_mode(files_struct *fsp,
+					enum file_close_type close_type)
 {
 	connection_struct *conn = fsp->conn;
 	BOOL delete_file = False;
 	struct share_mode_lock *lck;
 	SMB_STRUCT_STAT sbuf;
+	NTSTATUS status = NT_STATUS_OK;
 
 	/*
 	 * Lock the share entries, and determine if we should delete
@@ -162,7 +164,7 @@
 	if (lck == NULL) {
 		DEBUG(0, ("close_remove_share_mode: Could not get share mode "
 			  "lock for file %s\n", fsp->fsp_name));
-		return EINVAL;
+		return NT_STATUS_INVALID_PARAMETER;
 	}
 
 	if (!del_share_mode(lck, fsp)) {
@@ -197,7 +199,7 @@
 	    || !delete_file
 	    || (lck->delete_token == NULL)) {
 		TALLOC_FREE(lck);
-		return 0;
+		return NT_STATUS_OK;
 	}
 
 	/*
@@ -227,6 +229,9 @@
 		DEBUG(5,("close_remove_share_mode: file %s. Delete on close "
 			 "was set and stat failed with error %s\n",
 			 fsp->fsp_name, strerror(errno) ));
+		/*
+		 * Don't save the errno here, we ignore this error
+		 */
 		goto done;
 	}
 
@@ -239,6 +244,9 @@
 			 fsp->fsp_name,
 			 (unsigned int)fsp->dev, (double)fsp->inode,
 			 (unsigned int)sbuf.st_dev, (double)sbuf.st_ino ));
+		/*
+		 * Don't save the errno here, we ignore this error
+		 */
 		goto done;
 	}
 
@@ -254,9 +262,13 @@
 		DEBUG(5,("close_remove_share_mode: file %s. Delete on close "
 			 "was set and unlink failed with error %s\n",
 			 fsp->fsp_name, strerror(errno) ));
+
+		status = map_nt_error_from_unix(errno);
 		goto done;
 	}
 
+	status = NT_STATUS_FILE_DELETED;
+
  done:
 	/* unbecome user. */
 	pop_sec_ctx();
@@ -264,7 +276,7 @@
 	process_pending_change_notify_queue((time_t)0);
 
 	TALLOC_FREE(lck);
-	return 0;
+	return status;
 }
 
 /****************************************************************************



More information about the samba-cvs mailing list