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

vlendec at samba.org vlendec at samba.org
Mon Jul 4 12:40:29 GMT 2005


Author: vlendec
Date: 2005-07-04 12:40:28 +0000 (Mon, 04 Jul 2005)
New Revision: 8139

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

Log:
Introduce "BOOL file_existed" to open_file()
Modified:
   trunk/source/smbd/open.c


Changeset:
Modified: trunk/source/smbd/open.c
===================================================================
--- trunk/source/smbd/open.c	2005-07-04 12:15:18 UTC (rev 8138)
+++ trunk/source/smbd/open.c	2005-07-04 12:40:28 UTC (rev 8139)
@@ -204,6 +204,7 @@
 {
 	int accmode = (flags & O_ACCMODE);
 	int local_flags = flags;
+	BOOL file_existed = VALID_STAT(*psbuf);
 
 	fsp->fh->fd = -1;
 	fsp->oplock_type = NO_OPLOCK;
@@ -273,14 +274,13 @@
 		 * open flags. JRA.
 		 */
 
-		if (VALID_STAT(*psbuf) && S_ISFIFO(psbuf->st_mode)) {
+		if (file_existed && S_ISFIFO(psbuf->st_mode)) {
 			local_flags |= O_NONBLOCK;
 		}
 #endif
 
 		/* Don't create files with Microsoft wildcard characters. */
-		if ((local_flags & O_CREAT) &&
-		    !VALID_STAT(*psbuf) &&
+		if ((local_flags & O_CREAT) && !file_existed &&
 		    ms_has_wild(fname))  {
 			set_saved_error_triple(ERRDOS, ERRinvalidname,
 					       NT_STATUS_OBJECT_NAME_INVALID);
@@ -298,7 +298,7 @@
 		}
 
 		/* Inherit the ACL if the file was created. */
-		if ((local_flags & O_CREAT) && !VALID_STAT(*psbuf)) {
+		if ((local_flags & O_CREAT) && !file_existed) {
 			inherit_access_acl(conn, fname, unx_mode);
 		}
 
@@ -306,7 +306,7 @@
 		fsp->fh->fd = -1; /* What we used to call a stat open. */
 	}
 
-	if (!VALID_STAT(*psbuf)) {
+	if (!file_existed) {
 		int ret;
 
 		if (fsp->fh->fd == -1) {



More information about the samba-cvs mailing list