smbd: exit early in the error case in fd_open()
authorRalph Boehme <slow@samba.org>
Wed, 4 Mar 2020 09:32:43 +0000 (10:32 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 21 May 2020 05:23:29 +0000 (05:23 +0000)
No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index d95164a93dc232b9fb0d3bde835fc5275c830258..c28016da37098700d6d383095639d5fd32af9715 100644 (file)
@@ -820,11 +820,14 @@ NTSTATUS fd_open(struct connection_struct *conn,
                        }
                }
 
+               DBG_DEBUG("name %s, flags = 0%o mode = 0%o, fd = %d. %s\n",
+                         smb_fname_str_dbg(smb_fname), flags, (int)mode,
+                         fsp->fh->fd, strerror(errno));
+               return status;
        }
 
-       DEBUG(10,("fd_open: name %s, flags = 0%o mode = 0%o, fd = %d. %s\n",
-                 smb_fname_str_dbg(smb_fname), flags, (int)mode, fsp->fh->fd,
-               (fsp->fh->fd == -1) ? strerror(errno) : "" ));
+       DBG_DEBUG("name %s, flags = 0%o mode = 0%o, fd = %d\n",
+                 smb_fname_str_dbg(smb_fname), flags, (int)mode, fsp->fh->fd);
 
        return status;
 }