[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Thu Feb 17 19:07:01 UTC 2022


The branch, master has been updated
       via  a7c3213523d source4/torture: Drop unused variable attribute
       via  2b649604aee source4/torture: Drop unused variable mask
       via  1ccb187408b source4/torture: Drop unused variable tdif
       via  7471afaa1ff source4/torture: Avoid unused variable
       via  ad9a414147a vfs_not_implemented: do not mark structs with _PUBLIC_
       via  98594d33284 util: Drop unused variable mask_perms
       via  32d2584c238 util: Drop unused variable num_received
       via  fb55d84ebb2 util: Drop unused variable num_chars
      from  2649d654cfb smbd: Make strnorm() static to filename.c

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit a7c3213523d6eaf2f6945dfe48c83cea2df9ca0c
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Feb 16 09:11:43 2022 +1100

    source4/torture: Drop unused variable attribute
    
    clang complains:
    
    ../../source4/client/client.c:1569:11: error: variable 'attribute' set but not used [-Werror,-Wunused-but-set-variable]
            uint16_t attribute = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
                     ^
    
    That is, the variable is initialised and updated but the value is
    never used.
    
    Commit 2f377d5101783ed4d8c96a46aaec61895cc7b6ad from 2004 dropped the
    use of this variable.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Thu Feb 17 19:06:25 UTC 2022 on sn-devel-184

commit 2b649604aee683a48c520a5c46d6c3032b268d6c
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Feb 16 09:05:31 2022 +1100

    source4/torture: Drop unused variable mask
    
    clang complains:
    
    ../../source4/torture/smb2/notify.c:871:11: error: variable 'mask' set but not used [-Werror,-Wunused-but-set-variable]
            uint32_t mask;
                     ^
    
    That is, the variable is initialised and updated but the value is
    never used.
    
    Looks to have been this way since commit
    15d93a5d8e21893e1cca5c989dbf97010aae1622 from 2009.  Just drop it.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 1ccb187408b3055210c4bb19f1e21eb0438eb2ff
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Feb 16 08:56:10 2022 +1100

    source4/torture: Drop unused variable tdif
    
    clang complains:
    
    ../../source4/torture/basic/denytest.c:1805:11: error: variable 'tdif' set but not used [-Werror,-Wunused-but-set-variable]
                    int64_t tdif;
                            ^
    
    That is, the variable is initialised and updated but the value is
    never used.
    
    Perhaps it is meant to be used in the nearby torture_comment() call,
    but it has been this was since commit
    cb1cff90f165d82cbbf1dd87e475a1b13984d45e from 2004.  Just drop it.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 7471afaa1ffcf8291c7d13cf41eec451dde37a42
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Feb 16 08:50:24 2022 +1100

    source4/torture: Avoid unused variable
    
    clang complains:
    
    ../../source4/torture/basic/delete.c:2342:7: error: variable 'correct' set but not used [-Werror,-Wunused-but-set-variable]
            bool correct = true;
                 ^
    
    That is, the variable is initialised and updated but the value is
    never used.  Similar functions return this variable, so try that.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit ad9a414147aa8699a84d930fb322b2a6b4f32e78
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Feb 16 08:44:40 2022 +1100

    vfs_not_implemented: do not mark structs with _PUBLIC_
    
    Commit 5d295e41af4e9316aee1b4cf1c3087663b7c06a4 accidentally marked
    some structs with _PUBLIC_, which causes clang to complain:
    
    ../../source3/modules/vfs_not_implemented.c:594:1: error: attribute 'visibility' is ignored, place it after "struct" to apply attribute to type declaration [-Werror,-Wignored-attributes]
    _PUBLIC_
    ^
    ../../lib/replace/replace.h:917:33: note: expanded from macro '_PUBLIC_'
                                    ^
    ../../source3/modules/vfs_not_implemented.c:642:1: error: attribute 'visibility' is ignored, place it after "struct" to apply attribute to type declaration [-Werror,-Wignored-attributes]
    _PUBLIC_
    ^
    ../../lib/replace/replace.h:917:33: note: expanded from macro '_PUBLIC_'
                                    ^
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 98594d3328422a17b8d7b8639029910f21573cc5
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Feb 15 20:27:24 2022 +1100

    util: Drop unused variable mask_perms
    
    clang complains:
    
    ../../source3/smbd/posix_acls.c:2783:9: error: variable 'mask_perms' set but not used [-Werror,-Wunused-but-set-variable]
            mode_t mask_perms = 0;
                   ^
    
    That is, the variable is initialised and updated but the value is
    never used.
    
    This potentially points to a bug in commit
    f735551b9edef66b152261cf6eb2f29b7b69d65b from 2002.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 32d2584c23839efc9451a3563e891170dfc59027
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Feb 15 19:37:17 2022 +1100

    util: Drop unused variable num_received
    
    clang complains:
    
    ../../source4/libcli/clilist.c:111:6: error: variable 'num_received' set but not used [-Werror,-Wunused-but-set-variable]
            int num_received = 0;
                ^
    ../../source4/libcli/clilist.c:268:6: error: variable 'num_received' set but not used [-Werror,-Wunused-but-set-variable]
            int num_received = 0;
                ^
    
    That is, the variable is initialised and updated but the value is
    never used.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit fb55d84ebb28865059382e760163e71a54685f50
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Feb 15 19:32:52 2022 +1100

    util: Drop unused variable num_chars
    
    clang complains:
    
    ../../lib/util/genrand_util.c:99:9: error: variable 'num_chars' set but not used [-Werror,-Wunused-but-set-variable]
            size_t num_chars = 0;
                   ^
    
    That is, the variable is initialised and incremented but the value is
    never used.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/util/genrand_util.c               | 2 --
 source3/modules/vfs_not_implemented.c | 2 --
 source3/smbd/posix_acls.c             | 4 ----
 source4/client/client.c               | 4 ----
 source4/libcli/clilist.c              | 6 ------
 source4/torture/basic/delete.c        | 2 +-
 source4/torture/basic/denytest.c      | 3 ---
 source4/torture/smb2/notify.c         | 4 +---
 8 files changed, 2 insertions(+), 25 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/genrand_util.c b/lib/util/genrand_util.c
index 82085184e82..1ef4e446e18 100644
--- a/lib/util/genrand_util.c
+++ b/lib/util/genrand_util.c
@@ -96,7 +96,6 @@ _PUBLIC_ uint64_t generate_unique_u64(uint64_t veto_value)
 _PUBLIC_ bool check_password_quality(const char *pwd)
 {
 	size_t ofs = 0;
-	size_t num_chars = 0;
 	size_t num_digits = 0;
 	size_t num_upper = 0;
 	size_t num_lower = 0;
@@ -120,7 +119,6 @@ _PUBLIC_ bool check_password_quality(const char *pwd)
 			break;
 		}
 		ofs += len;
-		num_chars += 1;
 
 		if (len == 1) {
 			const char *na = "~!@#$%^&*_-+=`|\\(){}[]:;\"'<>,.?/";
diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c
index 95c1757a7cc..fcc1ca1abbe 100644
--- a/source3/modules/vfs_not_implemented.c
+++ b/source3/modules/vfs_not_implemented.c
@@ -591,7 +591,6 @@ uint64_t vfs_not_implemented_fs_file_id(vfs_handle_struct *handle,
 	return 0;
 }
 
-_PUBLIC_
 struct vfs_not_implemented_offload_read_state {
 	bool dummy;
 };
@@ -639,7 +638,6 @@ NTSTATUS vfs_not_implemented_offload_read_recv(struct tevent_req *req,
 	return NT_STATUS_OK;
 }
 
-_PUBLIC_
 struct vfs_not_implemented_offload_write_state {
 	uint64_t unused;
 };
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 245d904f380..4cfb821fc14 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -2780,7 +2780,6 @@ static bool set_canon_ace_list(files_struct *fsp,
 	SMB_ACL_PERMSET_T mask_permset;
 	SMB_ACL_TYPE_T the_acl_type = (default_ace ? SMB_ACL_TYPE_DEFAULT : SMB_ACL_TYPE_ACCESS);
 	bool needs_mask = False;
-	mode_t mask_perms = 0;
 	int sret;
 
 	/* Use the psbuf that was passed in. */
@@ -2818,9 +2817,6 @@ static bool set_canon_ace_list(files_struct *fsp,
 
 		if (p_ace->type == SMB_ACL_USER || p_ace->type == SMB_ACL_GROUP) {
 			needs_mask = True;
-			mask_perms |= p_ace->perms;
-		} else if (p_ace->type == SMB_ACL_GROUP_OBJ) {
-			mask_perms |= p_ace->perms;
 		}
 
 		/*
diff --git a/source4/client/client.c b/source4/client/client.c
index c961965ec4c..71906825d1b 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -1566,10 +1566,6 @@ delete some files
 static int cmd_del(struct smbclient_context *ctx, const char **args)
 {
 	char *mask;
-	uint16_t attribute = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
-
-	if (ctx->recurse)
-		attribute |= FILE_ATTRIBUTE_DIRECTORY;
 	
 	if (!args[1]) {
 		d_printf("del <filename>\n");
diff --git a/source4/libcli/clilist.c b/source4/libcli/clilist.c
index 2fa4112200e..eb9199dc749 100644
--- a/source4/libcli/clilist.c
+++ b/source4/libcli/clilist.c
@@ -108,7 +108,6 @@ int smbcli_list_new(struct smbcli_tree *tree, const char *Mask, uint16_t attribu
 	struct search_private state;  /* for callbacks */
 	int received = 0;
 	bool first = true;
-	int num_received = 0;
 	int max_matches = 512;
 	char *mask;
 	int ff_eos = 0, i;
@@ -185,8 +184,6 @@ int smbcli_list_new(struct smbcli_tree *tree, const char *Mask, uint16_t attribu
 			if (received <= 0) break;
 			if (ff_eos) break;
 		}
-		
-		num_received += received;
 	}
 
 	for (i=0;i<state.total_received;i++) {
@@ -265,7 +262,6 @@ int smbcli_list_old(struct smbcli_tree *tree, const char *Mask, uint16_t attribu
 	const int num_asked = 500;
 	int received = 0;
 	bool first = true;
-	int num_received = 0;
 	char *mask;
 	int i;
 
@@ -327,8 +323,6 @@ int smbcli_list_old(struct smbcli_tree *tree, const char *Mask, uint16_t attribu
 			received = next_parms.search_next.out.count;
 			if (received <= 0) break;
 		}
-		
-		num_received += received;
 	}
 
 	for (i=0;i<state.total_received;i++) {
diff --git a/source4/torture/basic/delete.c b/source4/torture/basic/delete.c
index d14d5a55746..201ebfda60c 100644
--- a/source4/torture/basic/delete.c
+++ b/source4/torture/basic/delete.c
@@ -2387,7 +2387,7 @@ static bool deltest23(struct torture_context *tctx,
 	torture_assert_ntstatus_equal(tctx, smbcli_nt_error(cli1->tree),
 	    NT_STATUS_DELETE_PENDING, "smbcli_open failed");
 
-	return true;
+	return correct;
 }
 
 /* Test 24 ... */
diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c
index 8e7a822df09..9725676f3de 100644
--- a/source4/torture/basic/denytest.c
+++ b/source4/torture/basic/denytest.c
@@ -1802,7 +1802,6 @@ static bool torture_ntdenytest(struct torture_context *tctx,
 
 	for (i=0;i<torture_numops;i++) {
 		NTSTATUS status1, status2, status2_p;
-		int64_t tdif;
 		TALLOC_CTX *mem_ctx = talloc_new(NULL);
 		enum deny_result res, res2;
 		int b_sa1 = random() & ((1<<nbits1)-1);
@@ -1873,8 +1872,6 @@ static bool torture_ntdenytest(struct torture_context *tctx,
 						   &res2);
 		
 		clock_gettime_mono(&tv);
-		tdif = nsec_time_diff(&tv, &tv_start);
-		tdif /= 1000000;
 		if (torture_setting_bool(tctx, "showall", false) || 
 		    !NT_STATUS_EQUAL(status2, status2_p) ||
 		    res != res2) {
diff --git a/source4/torture/smb2/notify.c b/source4/torture/smb2/notify.c
index d82ddab5955..0aadc50c607 100644
--- a/source4/torture/smb2/notify.c
+++ b/source4/torture/smb2/notify.c
@@ -868,7 +868,6 @@ static bool torture_smb2_notify_mask(struct torture_context *torture,
 	union smb_notify notify;
 	union smb_open io, io1;
 	struct smb2_handle h1, h2;
-	uint32_t mask;
 	int i;
 	char c = 1;
 	union smb_setfileinfo sinfo;
@@ -906,7 +905,7 @@ static bool torture_smb2_notify_mask(struct torture_context *torture,
 #define NOTIFY_MASK_TEST(test_name, setup, op, cleanup, Action, \
 			 expected, nchanges) \
 	do { \
-	do { for (mask=i=0;i<32;i++) { \
+	do { for (i=0;i<32;i++) { \
 		struct smb2_request *req; \
 		status = smb2_create(tree1, torture, &(io.smb2)); \
 		CHECK_STATUS(status, NT_STATUS_OK); \
@@ -965,7 +964,6 @@ static bool torture_smb2_notify_mask(struct torture_context *torture,
 			       notify.smb2.out.changes[0].name.s);	\
 			ret = false; \
 		} \
-		mask |= ((uint32_t)1<<i); \
 	} \
 	} while (0); \
 	} while (0);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list