[SCM] Samba Shared Repository - branch master updated

2023-05-03 Thread Jeremy Allison
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 
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 
Reviewed-by: Volker Lendecke 

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Thu May  4 01:29:10 UTC 2023 on atb-devel-224

commit 11f36804629f54bc812331eabb862bd0fd637dae
Author: Joseph Sutton 
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 
Reviewed-by: Volker Lendecke 

commit d2720a9e788f6870b7c68a1126820b15a8db811d
Author: Joseph Sutton 
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 
Reviewed-by: Volker Lendecke 

---

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)
- * 100 / CLOCKS_PER_SEC;
+ * 100.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



[SCM] Samba Shared Repository - branch master updated

2023-05-03 Thread Volker Lendecke
The branch, master has been updated
   via  4dccf5afa44 ctdb-recovery: Use correct struct ban_node_state type 
for state
  from  de1fdf1e020 s4:lib:policy: cleanup and handle errors in 
push_recursive()

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


- Log -
commit 4dccf5afa444edecd2893dac7558bac9212526bf
Author: Christof Schmitt 
Date:   Tue May 2 12:17:56 2023 -0700

ctdb-recovery: Use correct struct ban_node_state type for state

If this codepath is hit, ctdb aborts with:

ctdb/server/ctdb_recovery_helper.c:2687: Type mismatch: name[struct 
ban_node_state] expected[struct node_ban_state]")
at ../../lib/talloc/talloc.c:505

Fix this by using the correct type.

Signed-off-by: Christof Schmitt 
Reviewed-by: Volker Lendecke 

Autobuild-User(master): Volker Lendecke 
Autobuild-Date(master): Wed May  3 08:04:09 UTC 2023 on atb-devel-224

---

Summary of changes:
 ctdb/server/ctdb_recovery_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/server/ctdb_recovery_helper.c 
b/ctdb/server/ctdb_recovery_helper.c
index f3576474144..4df48417c7a 100644
--- a/ctdb/server/ctdb_recovery_helper.c
+++ b/ctdb/server/ctdb_recovery_helper.c
@@ -2327,8 +2327,8 @@ static void ban_node_done(struct tevent_req *subreq)
 {
struct tevent_req *req = tevent_req_callback_data(
subreq, struct tevent_req);
-   struct node_ban_state *state = tevent_req_data(
-   req, struct node_ban_state);
+   struct ban_node_state *state = tevent_req_data(
+   req, struct ban_node_state);
struct ctdb_reply_control *reply;
int ret;
bool status;


-- 
Samba Shared Repository