summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-05-05 16:58:24 +0200
committerGünther Deschner <gd@samba.org>2008-05-05 16:59:53 +0200
commit4d8836ab96889bcdc35e86bedffa6117f9c35095 (patch)
tree381e8fe6d2d2efd6da763bdd238f8a5fac8acf44 /source3/utils
parent1a3f50559e06c9dc45556c2c52d68a23c05d7e41 (diff)
downloadsamba-4d8836ab96889bcdc35e86bedffa6117f9c35095.tar.gz
samba-4d8836ab96889bcdc35e86bedffa6117f9c35095.tar.bz2
samba-4d8836ab96889bcdc35e86bedffa6117f9c35095.zip
Fix client authentication with -P switch in client tools (Bug 5435).
Guenther (This used to be commit d077ef64cd1d9bbaeb936566c2c70da508de829f)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/smbcacls.c14
-rw-r--r--source3/utils/smbcquotas.c15
-rw-r--r--source3/utils/smbtree.c6
3 files changed, 33 insertions, 2 deletions
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index af14c622dc..95ef6190e8 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -821,8 +821,20 @@ static struct cli_state *connect_one(const char *server, const char *share)
struct cli_state *c = NULL;
struct sockaddr_storage ss;
NTSTATUS nt_status;
+ uint32_t flags = 0;
+
zero_addr(&ss);
+ if (get_cmdline_auth_info_use_kerberos()) {
+ flags |= CLI_FULL_CONNECTION_USE_KERBEROS |
+ CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS;
+ }
+
+ if (get_cmdline_auth_info_use_machine_account() &&
+ !set_cmdline_auth_info_machine_account_creds()) {
+ return NULL;
+ }
+
if (!get_cmdline_auth_info_got_pass()) {
char *pass = getpass("Password: ");
if (pass) {
@@ -836,7 +848,7 @@ static struct cli_state *connect_one(const char *server, const char *share)
get_cmdline_auth_info_username(),
lp_workgroup(),
get_cmdline_auth_info_password(),
- get_cmdline_auth_info_use_kerberos() ? CLI_FULL_CONNECTION_USE_KERBEROS : 0,
+ flags,
get_cmdline_auth_info_signing_state(),
NULL);
if (!NT_STATUS_IS_OK(nt_status)) {
diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c
index 508a2dc8ca..a73c3b49df 100644
--- a/source3/utils/smbcquotas.c
+++ b/source3/utils/smbcquotas.c
@@ -371,8 +371,21 @@ static struct cli_state *connect_one(const char *share)
struct cli_state *c;
struct sockaddr_storage ss;
NTSTATUS nt_status;
+ uint32_t flags = 0;
+
zero_addr(&ss);
+ if (get_cmdline_auth_info_use_machine_account() &&
+ !set_cmdline_auth_info_machine_account_creds()) {
+ return NULL;
+ }
+
+ if (get_cmdline_auth_info_use_kerberos()) {
+ flags |= CLI_FULL_CONNECTION_USE_KERBEROS |
+ CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS;
+
+ }
+
if (!get_cmdline_auth_info_got_pass()) {
char *pass = getpass("Password: ");
if (pass) {
@@ -386,7 +399,7 @@ static struct cli_state *connect_one(const char *share)
get_cmdline_auth_info_username(),
lp_workgroup(),
get_cmdline_auth_info_password(),
- 0,
+ flags,
get_cmdline_auth_info_signing_state(),
NULL);
if (!NT_STATUS_IS_OK(nt_status)) {
diff --git a/source3/utils/smbtree.c b/source3/utils/smbtree.c
index c2b364d1e9..e975a1c8a2 100644
--- a/source3/utils/smbtree.c
+++ b/source3/utils/smbtree.c
@@ -302,6 +302,12 @@ static bool print_tree(struct user_auth_info *user_info)
/* Parse command line args */
+ if (get_cmdline_auth_info_use_machine_account() &&
+ !set_cmdline_auth_info_machine_account_creds()) {
+ TALLOC_FREE(frame);
+ return 1;
+ }
+
if (!get_cmdline_auth_info_got_pass()) {
char *pass = getpass("Password: ");
if (pass) {