diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-07-13 09:03:41 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-07-13 09:03:41 +0000 |
commit | 224e73803bb42a6547dd5621d4f0dcdb829ffbd7 (patch) | |
tree | 1036696a0dd6288b40895ab7a4a679c97b99c460 /source3 | |
parent | f5b6ef1b65bdf99ac31d23c80ead330da2cd1411 (diff) | |
download | samba-224e73803bb42a6547dd5621d4f0dcdb829ffbd7.tar.gz samba-224e73803bb42a6547dd5621d4f0dcdb829ffbd7.tar.bz2 samba-224e73803bb42a6547dd5621d4f0dcdb829ffbd7.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
(This used to be commit 4687fac69d995e49a0f3701fb170d64af1ba4a47)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/smbcacls.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index aa00eab42c..b6a13180a3 100644 --- a/source3/utils/smbcacls.c +++ b/source3/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++; |