diff options
author | Günther Deschner <gd@samba.org> | 2007-06-27 09:23:50 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:23:37 -0500 |
commit | 6eb18630f789d4188e299a5d60e796161e2996ad (patch) | |
tree | 9de113228a27c137d625ea9a41d79622b0ce539b /source3/rpcclient/cmd_dfs.c | |
parent | a458211702da5f573f09dde196ca302f2f7cb976 (diff) | |
download | samba-6eb18630f789d4188e299a5d60e796161e2996ad.tar.gz |
r23623: Fix rpcclient and rpc_server with new DFS idl.
Guenther
(This used to be commit bffe33dd261fdcf9ef8f9f232c15559661843c7c)
Diffstat (limited to 'source3/rpcclient/cmd_dfs.c')
-rw-r--r-- | source3/rpcclient/cmd_dfs.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/source3/rpcclient/cmd_dfs.c b/source3/rpcclient/cmd_dfs.c index 7e898ddc52a..8564e93bd3b 100644 --- a/source3/rpcclient/cmd_dfs.c +++ b/source3/rpcclient/cmd_dfs.c @@ -25,10 +25,10 @@ /* Check DFS is supported by the remote server */ -static NTSTATUS cmd_dfs_exist(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - int argc, const char **argv) +static NTSTATUS cmd_dfs_version(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + int argc, const char **argv) { - uint32 dfs_exists; + enum dfs_ManagerVersion version; NTSTATUS result; if (argc != 1) { @@ -36,12 +36,19 @@ static NTSTATUS cmd_dfs_exist(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } - result = rpccli_dfs_GetManagerVersion(cli, mem_ctx, &dfs_exists); + result = rpccli_dfs_GetManagerVersion(cli, mem_ctx, &version); - if (NT_STATUS_IS_OK(result)) - printf("dfs is %spresent\n", dfs_exists ? "" : "not "); + if (!NT_STATUS_IS_OK(result)) { + return result; + } - return result; + if (version > 0) { + printf("dfs is present (%d)\n", version); + } else { + printf("dfs is not present\n"); + } + + return NT_STATUS_OK; } static NTSTATUS cmd_dfs_add(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -183,7 +190,6 @@ static NTSTATUS cmd_dfs_enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, NTSTATUS result; uint32 total = 0; - uint32 unknown = 0; if (argc > 2) { printf("Usage: %s [info_level]\n", argv[0]); @@ -207,7 +213,7 @@ static NTSTATUS cmd_dfs_enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, } result = rpccli_dfs_Enum(cli, mem_ctx, str.level, 0xFFFFFFFF, &str, - &unknown, &total); + &total); if (NT_STATUS_IS_OK(result)) display_dfs_enumstruct(&str); @@ -297,7 +303,7 @@ struct cmd_set dfs_commands[] = { { "DFS" }, - { "dfsexist", RPC_RTYPE_NTSTATUS, cmd_dfs_exist, NULL, PI_NETDFS, NULL, "Query DFS support", "" }, + { "dfsversion", RPC_RTYPE_NTSTATUS, cmd_dfs_version, NULL, PI_NETDFS, NULL, "Query DFS support", "" }, { "dfsadd", RPC_RTYPE_NTSTATUS, cmd_dfs_add, NULL, PI_NETDFS, NULL, "Add a DFS share", "" }, { "dfsremove", RPC_RTYPE_NTSTATUS, cmd_dfs_remove, NULL, PI_NETDFS, NULL, "Remove a DFS share", "" }, { "dfsgetinfo",RPC_RTYPE_NTSTATUS, cmd_dfs_getinfo, NULL, PI_NETDFS, NULL, "Query DFS share info", "" }, |