*/
#include "includes.h"
-#include "popt_common_cmdline.h"
+#include "lib/cmdline/cmdline.h"
#include "rpc_client/cli_pipe.h"
#include "../librpc/gen_ndr/ndr_lsa.h"
#include "rpc_client/cli_lsarpc.h"
struct cli_credentials *creds = NULL;
char *targetfile = NULL;
NTSTATUS status;
+ bool ok;
struct poptOption long_options[] = {
POPT_AUTOHELP
.val = 0,
.descrip = "Domain SID for sddl",
.argDescrip = "SID"},
- {
- .longName = "max-protocol",
- .shortName = 'm',
- .argInfo = POPT_ARG_STRING,
- .arg = NULL,
- .val = 'm',
- .descrip = "Set the max protocol level",
- .argDescrip = "LEVEL",
- },
{
.longName = "maximum-access",
.shortName = 'x',
POPT_COMMON_SAMBA
POPT_COMMON_CONNECTION
POPT_COMMON_CREDENTIALS
+ POPT_LEGACY_S3
+ POPT_COMMON_VERSION
POPT_TABLEEND
};
smb_init_locale();
+ 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);
+ }
/* set default debug level to 1 regardless of what smb.conf sets */
- setup_logging( "smbcacls", DEBUG_STDERR);
lp_set_cmdline("log level", "1");
setlinebuf(stdout);
- popt_common_credentials_set_ignore_missing_conf();
-
- pc = poptGetContext("smbcacls", argc, argv_const, long_options, 0);
+ pc = samba_popt_get_context(getprogname(),
+ argc,
+ argv_const,
+ long_options,
+ 0);
+ if (pc == NULL) {
+ DBG_ERR("Failed to setup popt context!\n");
+ TALLOC_FREE(frame);
+ exit(1);
+ }
poptSetOtherOptionHelp(pc, "//server1/share1 filename\nACLs look like: "
"'ACL:user:[ALLOWED|DENIED]/flags/permissions'");
}
poptFreeContext(pc);
- popt_burn_cmdline_password(argc, argv);
- popt_common_credentials_post();
+ samba_cmdline_burn(argc, argv);
string_replace(path,'/','\\');
*share = 0;
share++;
- creds = get_cmdline_auth_info_creds(popt_get_cmdline_auth_info());
+ creds = samba_cmdline_get_creds();
/* Make connection to server */
if (!test_args) {
exit(EXIT_FAILED);
}
} else {
- popt_free_cmdline_auth_info();
exit(0);
}
result = cacl_dump(targetcli, targetfile, numeric);
}
- popt_free_cmdline_auth_info();
TALLOC_FREE(frame);
return result;