]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:utils: Migrate profiles to new cmdline option parser
authorAndreas Schneider <asn@samba.org>
Tue, 12 Jan 2021 14:45:21 +0000 (15:45 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 25 May 2021 00:23:37 +0000 (00:23 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/utils/profiles.c
source3/utils/wscript_build

index 8c7bd2cb0a4eb2106cb99e85fddac725a9894495..96b8c9dd82e041f9bad7861e4d94b4b16d795b07 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-#include "popt_common.h"
+#include "lib/cmdline/cmdline.h"
 #include "registry/reg_objects.h"
 #include "registry/regfio.h"
 #include "../libcli/security/security.h"
@@ -248,15 +248,29 @@ int main( int argc, const char *argv[] )
                POPT_TABLEEND
        };
        poptContext pc;
+       bool ok;
 
        smb_init_locale();
 
-       /* setup logging options */
-
-       setup_logging( "profiles", DEBUG_STDERR);
+       ok = samba_cmdline_init(frame,
+                               SAMBA_CMDLINE_CONFIG_CLIENT,
+                               false /* require_smbconf */);
+       if (!ok) {
+               DBG_ERR("Failed to init cmdline parser!\n");
+               TALLOC_FREE(frame);
+               exit(1);
+       }
 
-       pc = poptGetContext("profiles", argc, argv, long_options,
-               POPT_CONTEXT_KEEP_FIRST);
+       pc = samba_popt_get_context(getprogname(),
+                                   argc,
+                                   argv,
+                                   long_options,
+                                   POPT_CONTEXT_KEEP_FIRST);
+       if (pc == NULL) {
+               DBG_ERR("Failed to setup popt context!\n");
+               TALLOC_FREE(frame);
+               exit(1);
+       }
 
        poptSetOtherOptionHelp(pc, "<profilefile>");
 
index bcc2261d82c726172350127db95f7762e8d4233f..c28fd862b3a5bd48e7098d0e7bea2d0b65d5b694 100644 (file)
@@ -11,7 +11,7 @@ bld.SAMBA3_BINARY('profiles',
                  source='profiles.c',
                  deps='''
                  talloc
-                 popt_samba3
+                 CMDLINE_S3
                  smbconf
                  REGFIO''')