diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/srv_dfs_nt.c | 25 | ||||
-rw-r--r-- | source3/rpcclient/cmd_dfs.c | 26 |
2 files changed, 29 insertions, 22 deletions
diff --git a/source3/rpc_server/srv_dfs_nt.c b/source3/rpc_server/srv_dfs_nt.c index d114a07994..eb159bdc64 100644 --- a/source3/rpc_server/srv_dfs_nt.c +++ b/source3/rpc_server/srv_dfs_nt.c @@ -32,10 +32,11 @@ void _dfs_GetManagerVersion(pipes_struct *p, struct dfs_GetManagerVersion *r) { - if(lp_host_msdfs()) - *r->out.exist_flag = 1; - else - *r->out.exist_flag = 0; + if (lp_host_msdfs()) { + *r->out.version = DFS_MANAGER_VERSION_NT4; + } else { + *r->out.version = 0; + } } WERROR _dfs_Add(pipes_struct *p, struct dfs_Add *r) @@ -109,22 +110,22 @@ WERROR _dfs_Remove(pipes_struct *p, struct dfs_Remove *r) return WERR_ACCESS_DENIED; } - if (r->in.server && r->in.share) { - pstrcpy(altpath, r->in.server); + if (r->in.servername && r->in.sharename) { + pstrcpy(altpath, r->in.servername); pstrcat(altpath, "\\"); - pstrcat(altpath, r->in.share); + pstrcat(altpath, r->in.sharename); strlower_m(altpath); } DEBUG(5,("init_reply_dfs_remove: Request to remove %s -> %s\\%s.\n", - r->in.path, r->in.server, r->in.share)); + r->in.dfs_entry_path, r->in.servername, r->in.sharename)); - if(!NT_STATUS_IS_OK(get_referred_path(p->mem_ctx, r->in.path, &jn, &consumedcnt, &self_ref))) { + if(!NT_STATUS_IS_OK(get_referred_path(p->mem_ctx, r->in.dfs_entry_path, &jn, &consumedcnt, &self_ref))) { return WERR_DFS_NO_SUCH_VOL; } /* if no server-share pair given, remove the msdfs link completely */ - if(!r->in.server && !r->in.share) { + if(!r->in.servername && !r->in.sharename) { if(!remove_msdfs_link(&jn)) { vfs_ChDir(p->conn,p->conn->connectpath); return WERR_DFS_NO_SUCH_VOL; @@ -324,11 +325,11 @@ WERROR _dfs_GetInfo(pipes_struct *p, struct dfs_GetInfo *r) BOOL self_ref = False; BOOL ret; - if(!create_junction(r->in.path, &jn)) + if(!create_junction(r->in.dfs_entry_path, &jn)) return WERR_DFS_NO_SUCH_SERVER; /* The following call can change the cwd. */ - if(!NT_STATUS_IS_OK(get_referred_path(p->mem_ctx, r->in.path, &jn, &consumedcnt, &self_ref)) || consumedcnt < strlen(r->in.path)) { + if(!NT_STATUS_IS_OK(get_referred_path(p->mem_ctx, r->in.dfs_entry_path, &jn, &consumedcnt, &self_ref)) || consumedcnt < strlen(r->in.dfs_entry_path)) { vfs_ChDir(p->conn,p->conn->connectpath); return WERR_DFS_NO_SUCH_VOL; } diff --git a/source3/rpcclient/cmd_dfs.c b/source3/rpcclient/cmd_dfs.c index 7e898ddc52..8564e93bd3 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", "" }, |