summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-07-13 09:03:41 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-07-13 09:03:41 +0000
commit4687fac69d995e49a0f3701fb170d64af1ba4a47 (patch)
tree51b8fe2ca81abb2805358b45e3dc9cdcae51aced
parent01ebe5fff2b3cb29f083afb224b1257364ac5d80 (diff)
downloadsamba-4687fac69d995e49a0f3701fb170d64af1ba4a47.tar.gz
samba-4687fac69d995e49a0f3701fb170d64af1ba4a47.tar.xz
samba-4687fac69d995e49a0f3701fb170d64af1ba4a47.zip
This makes smbcacls a bit easier to use and debug.
Allow connection in the form of //server/share instead of just \\server\share and show the reason for failure from cli_full_connection(). Andrew Bartlett
-rw-r--r--source/utils/smbcacls.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/source/utils/smbcacls.c b/source/utils/smbcacls.c
index aa00eab42c9..b6a13180a37 100644
--- a/source/utils/smbcacls.c
+++ b/source/utils/smbcacls.c
@@ -155,7 +155,6 @@ static BOOL StringToSid(DOM_SID *sid, const char *str)
}
sid_copy(sid, &sids[0]);
-
done:
return result;
@@ -708,6 +707,7 @@ static struct cli_state *connect_one(char *share)
{
struct cli_state *c;
struct in_addr ip;
+ NTSTATUS nt_status;
zero_ip(&ip);
if (!got_pass) {
@@ -718,13 +718,14 @@ static struct cli_state *connect_one(char *share)
}
}
- if (NT_STATUS_IS_OK(cli_full_connection(&c, global_myname, server,
- &ip, 0,
- share, "?????",
- username, global_myworkgroup,
- password, 0))) {
+ if (NT_STATUS_IS_OK(nt_status = cli_full_connection(&c, global_myname, server,
+ &ip, 0,
+ share, "?????",
+ username, global_myworkgroup,
+ password, 0))) {
return c;
} else {
+ DEBUG(0,("cli_full_connection failed! (%s)\n", nt_errstr(nt_status)));
return NULL;
}
}
@@ -875,7 +876,7 @@ You can string acls together with spaces, commas or newlines\n\
argc -= optind;
argv += optind;
-
+
if (argc > 0) {
usage();
talloc_destroy(ctx);
@@ -886,7 +887,13 @@ You can string acls together with spaces, commas or newlines\n\
fstrcpy(server,share+2);
share = strchr_m(server,'\\');
- if (!share) return -1;
+ if (!share) {
+ share = strchr_m(server,'/');
+ if (!share) {
+ return -1;
+ }
+ }
+
*share = 0;
share++;