summaryrefslogtreecommitdiff
path: root/source3/utils/smbcquotas.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/smbcquotas.c')
-rw-r--r--source3/utils/smbcquotas.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c
index 8938cc5e65..a95394b125 100644
--- a/source3/utils/smbcquotas.c
+++ b/source3/utils/smbcquotas.c
@@ -37,6 +37,7 @@ static struct cli_state *cli_ipc;
static struct rpc_pipe_client *global_pipe_hnd;
static POLICY_HND pol;
static bool got_policy_hnd;
+static struct user_auth_info *smbcquotas_auth_info;
static struct cli_state *connect_one(const char *share);
@@ -373,42 +374,42 @@ static struct cli_state *connect_one(const char *share)
zero_sockaddr(&ss);
- if (get_cmdline_auth_info_use_machine_account() &&
- !set_cmdline_auth_info_machine_account_creds()) {
+ if (get_cmdline_auth_info_use_machine_account(smbcquotas_auth_info) &&
+ !set_cmdline_auth_info_machine_account_creds(smbcquotas_auth_info)) {
return NULL;
}
- if (get_cmdline_auth_info_use_kerberos()) {
+ if (get_cmdline_auth_info_use_kerberos(smbcquotas_auth_info)) {
flags |= CLI_FULL_CONNECTION_USE_KERBEROS |
CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS;
}
- if (!get_cmdline_auth_info_got_pass()) {
+ if (!get_cmdline_auth_info_got_pass(smbcquotas_auth_info)) {
char *pass = getpass("Password: ");
if (pass) {
- set_cmdline_auth_info_password(pass);
+ set_cmdline_auth_info_password(smbcquotas_auth_info, pass);
}
}
nt_status = cli_full_connection(&c, global_myname(), server,
&ss, 0,
share, "?????",
- get_cmdline_auth_info_username(),
+ get_cmdline_auth_info_username(smbcquotas_auth_info),
lp_workgroup(),
- get_cmdline_auth_info_password(),
+ get_cmdline_auth_info_password(smbcquotas_auth_info),
flags,
- get_cmdline_auth_info_signing_state(),
+ get_cmdline_auth_info_signing_state(smbcquotas_auth_info),
NULL);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0,("cli_full_connection failed! (%s)\n", nt_errstr(nt_status)));
return NULL;
}
- if (get_cmdline_auth_info_smb_encrypt()) {
+ if (get_cmdline_auth_info_smb_encrypt(smbcquotas_auth_info)) {
nt_status = cli_cm_force_encryption(c,
- get_cmdline_auth_info_username(),
- get_cmdline_auth_info_password(),
+ get_cmdline_auth_info_username(smbcquotas_auth_info),
+ get_cmdline_auth_info_password(smbcquotas_auth_info),
lp_workgroup(),
share);
if (!NT_STATUS_IS_OK(nt_status)) {
@@ -475,6 +476,12 @@ FSQFLAGS:QUOTA_ENABLED/DENY_DISK/LOG_SOFTLIMIT/LOG_HARD_LIMIT", "SETSTRING" },
lp_load(get_dyn_CONFIGFILE(),True,False,False,True);
load_interfaces();
+ smbcquotas_auth_info = user_auth_info_init(frame);
+ if (smbcquotas_auth_info == NULL) {
+ exit(1);
+ }
+ popt_common_set_auth_info(smbcquotas_auth_info);
+
pc = poptGetContext("smbcquotas", argc, argv, long_options, 0);
poptSetOtherOptionHelp(pc, "//server1/share1");
@@ -537,7 +544,8 @@ FSQFLAGS:QUOTA_ENABLED/DENY_DISK/LOG_SOFTLIMIT/LOG_HARD_LIMIT", "SETSTRING" },
todo = USER_QUOTA;
if (!fix_user) {
- username_str = talloc_strdup(frame, get_cmdline_auth_info_username());
+ username_str = talloc_strdup(
+ frame, get_cmdline_auth_info_username(smbcquotas_auth_info));
if (!username_str) {
exit(EXIT_PARSE_ERROR);
}