[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Thu May 4 01:30:02 UTC 2023


The branch, master has been updated
       via  6752bcaf4de s3:utils: Move error-handling code into more suitable spot (CID 1524680)
       via  11f36804629 s3:utils: Use ‘int’ for popt parameters
       via  d2720a9e788 s3:utils: Use floating-point arithmetic when result is assigned to a double
      from  4dccf5afa44 ctdb-recovery: Use correct struct ban_node_state type for state

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


- Log -----------------------------------------------------------------
commit 6752bcaf4de774dbe0a617d9c8106a38529e59bd
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Thu Apr 6 10:00:00 2023 +1200

    s3:utils: Move error-handling code into more suitable spot (CID 1524680)
    
    The loop above would only exit once ‘c’ was equal to −1, and thus this
    code could never be reached.
    
    Also set ‘ok’ to false to indicate failure.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu May  4 01:29:10 UTC 2023 on atb-devel-224

commit 11f36804629f54bc812331eabb862bd0fd637dae
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Mon May 1 15:36:53 2023 +1200

    s3:utils: Use ‘int’ for popt parameters
    
    Previously we were handing the addresses of bool parameters to popt for
    POPT_ARG_NONE parameters. This is not supported, and popt was returning
    POPT_ERROR_BADOPERATION for these parameters (not bundled popt, though,
    nor on Debian or Ubuntu). Using integers instead ensures that these
    addresses are aligned and sized as popt expects.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit d2720a9e788f6870b7c68a1126820b15a8db811d
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Mon May 1 14:15:26 2023 +1200

    s3:utils: Use floating-point arithmetic when result is assigned to a double
    
    This avoids any loss of precision from performing an integer division.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Volker Lendecke <vl at samba.org>

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

Summary of changes:
 source3/utils/smbget.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index 0272cba6adb..00bf20e8192 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -46,11 +46,11 @@ struct opt {
 	char *outputfile;
 	size_t blocksize;
 
-	bool quiet;
-	bool dots;
-	bool verbose;
-	bool send_stdout;
-	bool update;
+	int quiet;
+	int dots;
+	int verbose;
+	int send_stdout;
+	int update;
 	unsigned limit_rate;
 };
 static struct opt opt = { .blocksize = SMB_DEFAULT_BLOCKSIZE };
@@ -627,7 +627,7 @@ static bool smb_download_file(const char *base, const char *name,
 					/* Pause until `ticks_to_fill_bucket` */
 					double sleep_us
 					 = (ticks_to_fill_bucket - diff_ticks)
-					  * 1000000 / CLOCKS_PER_SEC;
+					  * 1000000.0 / CLOCKS_PER_SEC;
 					usleep(sleep_us);
 				}
 				/* Reset the byte counter and the ticks. */
@@ -720,7 +720,7 @@ int main(int argc, char **argv)
 {
 	int c = 0;
 	const char *file = NULL;
-	bool smb_encrypt = false;
+	int smb_encrypt = false;
 	int resume = 0, recursive = 0;
 	TALLOC_CTX *frame = talloc_stackframe();
 	bool ok = false;
@@ -889,14 +889,14 @@ int main(int argc, char **argv)
 			ok = false;
 			goto done;
 		}
-	}
 
-	if (c < -1) {
-		fprintf(stderr, "%s: %s\n",
-			poptBadOption(pc, POPT_BADOPTION_NOALIAS),
-			poptStrerror(c));
-		ok = true;
-		goto done;
+		if (c < -1) {
+			fprintf(stderr, "%s: %s\n",
+				poptBadOption(pc, POPT_BADOPTION_NOALIAS),
+				poptStrerror(c));
+			ok = false;
+			goto done;
+		}
 	}
 
 	if ((opt.send_stdout || resume || opt.outputfile) && opt.update) {


-- 
Samba Shared Repository



More information about the samba-cvs mailing list