summaryrefslogtreecommitdiff
path: root/source4/client/client.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-10-30 08:32:26 +0000
committerAndrew Tridgell <tridge@samba.org>2003-10-30 08:32:26 +0000
commit7fd381376f88ae99a4bf022d89f21ae497b48c1a (patch)
tree82faf5b1e26e2676c85d17d3f34336f58f21db64 /source4/client/client.c
parent4e3ca10b13b03b01fda2233b88c827019a69bfee (diff)
downloadsamba-7fd381376f88ae99a4bf022d89f21ae497b48c1a.tar.gz
samba-7fd381376f88ae99a4bf022d89f21ae497b48c1a.tar.bz2
samba-7fd381376f88ae99a4bf022d89f21ae497b48c1a.zip
- a few portability fixes from Jim Myers
- added SMBD_LISTEN_BACKLOG in local.h - added the beginnings of a ndr/rpc parsing framework for Samba4. It currently correctly parses security descriptors for the nttrans QUERY_SECDESC call, but I hope it will become a reasonable framework that an idl based generator can work to (This used to be commit 9bf904fc34f88e0581f93656e73d3c01ca96f761)
Diffstat (limited to 'source4/client/client.c')
-rw-r--r--source4/client/client.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/source4/client/client.c b/source4/client/client.c
index 2cc3746376..e0d332ca13 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -1739,6 +1739,52 @@ done:
/****************************************************************************
+show any ACL on a file
+****************************************************************************/
+static int cmd_acl(void)
+{
+ pstring fname;
+ fstring buf;
+ int ret = 0;
+ TALLOC_CTX *mem_ctx;
+ struct smb_query_secdesc query;
+ NTSTATUS status;
+ int fnum;
+
+ pstrcpy(fname,cur_dir);
+
+ if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) {
+ d_printf("acl <filename>\n");
+ return 1;
+ }
+ pstrcat(fname,buf);
+
+ fnum = cli_open(cli, fname, O_RDONLY, DENY_NONE);
+ if (fnum == -1) {
+ d_printf("%s - %s\n", fname, cli_errstr(cli));
+ return -1;
+ }
+
+ mem_ctx = talloc_init(fname);
+
+ query.in.fnum = fnum;
+ query.in.secinfo_flags = 0x7;
+
+ status = smb_raw_query_secdesc(cli->tree, mem_ctx, &query);
+ if (!NT_STATUS_IS_OK(status)) {
+ d_printf("%s - %s\n", fname, nt_errstr(status));
+ ret = 1;
+ goto done;
+ }
+
+ talloc_destroy(mem_ctx);
+
+done:
+ return ret;
+}
+
+
+/****************************************************************************
****************************************************************************/
static int cmd_open(void)
{
@@ -2198,6 +2244,7 @@ static struct
{
{"?",cmd_help,"[command] give help on a command",{COMPL_NONE,COMPL_NONE}},
{"altname",cmd_altname,"<file> show alt name",{COMPL_NONE,COMPL_NONE}},
+ {"acl",cmd_acl,"<file> show file ACL",{COMPL_NONE,COMPL_NONE}},
{"allinfo",cmd_allinfo,"<file> show all possible info about a file",{COMPL_NONE,COMPL_NONE}},
{"archive",cmd_archive,"<level>\n0=ignore archive bit\n1=only get archive files\n2=only get archive files and reset archive bit\n3=get all files and reset archive bit",{COMPL_NONE,COMPL_NONE}},
{"blocksize",cmd_block,"blocksize <number> (default 20)",{COMPL_NONE,COMPL_NONE}},
@@ -2985,7 +3032,7 @@ static void remember_query_host(const char *arg,
pstrcpy(cmdline_auth_info.password,poptGetArg(pc));
}
- //init_names();
+ /*init_names(); */
if (!tar_type && !*query_host && !*service && !message) {
poptPrintUsage(pc, stderr, 0);