s3-smbd: smbclient shows no error if deleting a directory with del failed
authorJeremy Allison <jra@samba.org>
Tue, 12 Nov 2013 23:17:26 +0000 (15:17 -0800)
committerAndreas Schneider <asn@samba.org>
Thu, 14 Nov 2013 18:29:00 +0000 (19:29 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10260

Remove unneeded conn argument to dir_check_ftype().
Move to correct uint32_t types.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/smbd/dir.c
source3/smbd/proto.h
source3/smbd/reply.c

index d99eec21540e95a68720dd7ed7de315b977cf640..6b7cce266be34604cb0ab1c9064be280684f1d5c 100644 (file)
@@ -966,9 +966,9 @@ struct dptr_struct *dptr_fetch_lanman2(struct smbd_server_connection *sconn,
  Check that a file matches a particular file type.
 ****************************************************************************/
 
-bool dir_check_ftype(connection_struct *conn, uint32 mode, uint32 dirtype)
+bool dir_check_ftype(uint32_t mode, uint32_t dirtype)
 {
-       uint32 mask;
+       uint32_t mask;
 
        /* Check the "may have" search bits. */
        if (((mode & ~dirtype) & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY)) != 0)
@@ -1106,7 +1106,7 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
                        continue;
                }
 
-               if (!dir_check_ftype(conn, mode, dirtype)) {
+               if (!dir_check_ftype(mode, dirtype)) {
                        DEBUG(5,("[%s] attribs 0x%x didn't match 0x%x\n",
                                fname, (unsigned int)mode, (unsigned int)dirtype));
                        TALLOC_FREE(dname);
index a15d5206d0c09723333e231057d23f93a621a8a7..a373cd6e66517aa470dbdba7a7865a2136000980 100644 (file)
@@ -218,7 +218,7 @@ struct dptr_struct *dptr_fetch(struct smbd_server_connection *sconn,
                               char *buf,int *num);
 struct dptr_struct *dptr_fetch_lanman2(struct smbd_server_connection *sconn,
                                       int dptr_num);
-bool dir_check_ftype(connection_struct *conn, uint32 mode, uint32 dirtype);
+bool dir_check_ftype(uint32_t mode, uint32_t dirtype);
 bool get_dir_entry(TALLOC_CTX *ctx,
                struct dptr_struct *dirptr,
                const char *mask,
index 3f59df8a261bea4d1f9ab6db2930194d22ee6ef9..b160290345c85a33c3f3fc6b06a46849661dfd1e 100644 (file)
@@ -2655,7 +2655,7 @@ static NTSTATUS do_unlink(connection_struct *conn,
                return NT_STATUS_NO_SUCH_FILE;
        }
 
-       if (!dir_check_ftype(conn, fattr, dirtype)) {
+       if (!dir_check_ftype(fattr, dirtype)) {
                if (fattr & FILE_ATTRIBUTE_DIRECTORY) {
                        return NT_STATUS_FILE_IS_A_DIRECTORY;
                }