]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:utils: Use ‘int’ for popt parameters
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 1 May 2023 03:36:53 +0000 (15:36 +1200)
committerJeremy Allison <jra@samba.org>
Thu, 4 May 2023 00:34:32 +0000 (00:34 +0000)
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@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/utils/smbget.c

index 1753a5383fa50c2876f419bbfdf40131376ef586..400d965b2a2e4fb8744d295e589658d9bdd19e2f 100644 (file)
@@ -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 };
@@ -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;