summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-08-08 11:00:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:34 -0500
commit11673dc07a137e911de3920f0ee6717b365f2ab4 (patch)
tree6c43be8f1ada29b2268246486d0623a0b3bbbadc
parent70660495b349cde6245731870d6337eb2800a8ed (diff)
downloadsamba-11673dc07a137e911de3920f0ee6717b365f2ab4.tar.gz
samba-11673dc07a137e911de3920f0ee6717b365f2ab4.tar.bz2
samba-11673dc07a137e911de3920f0ee6717b365f2ab4.zip
r17453: Fix msdfs RPC management (this broke with the autogenerated dfs rpcs).
* Remove "unknown" from dfs_Enum (samba4 dfs IDL updates to follow). * When encountering an unsupported infolevel the rpc server must reply with a dfs_info_0 structure and WERR_OK (observed from w2k3 when talking to nt4). Guenther (This used to be commit f9bef1f08f7d2a4c95c28329ac73e8646f033998)
-rw-r--r--source3/include/msdfs.h1
-rw-r--r--source3/include/rpc_dfs.h2
-rw-r--r--source3/rpc_client/cli_dfs.c4
-rw-r--r--source3/rpc_parse/parse_dfs.c20
-rw-r--r--source3/rpc_server/srv_dfs_nt.c21
-rw-r--r--source3/rpcclient/cmd_dfs.c4
-rw-r--r--source3/smbd/msdfs.c1
7 files changed, 24 insertions, 29 deletions
diff --git a/source3/include/msdfs.h b/source3/include/msdfs.h
index f7aa494cd2..e9fef5430e 100644
--- a/source3/include/msdfs.h
+++ b/source3/include/msdfs.h
@@ -53,6 +53,7 @@ struct referral {
struct junction_map {
pstring service_name;
pstring volume_name;
+ pstring comment;
int referral_count;
struct referral* referral_list;
};
diff --git a/source3/include/rpc_dfs.h b/source3/include/rpc_dfs.h
index adf25c9938..9aba123dee 100644
--- a/source3/include/rpc_dfs.h
+++ b/source3/include/rpc_dfs.h
@@ -243,8 +243,6 @@ typedef struct netdfs_q_dfs_Enum {
uint32 bufsize;
uint32 ptr0_info;
NETDFS_DFS_ENUMSTRUCT info;
- uint32 ptr0_unknown;
- uint32 unknown;
uint32 ptr0_total;
uint32 total;
} NETDFS_Q_DFS_ENUM;
diff --git a/source3/rpc_client/cli_dfs.c b/source3/rpc_client/cli_dfs.c
index 8b94d6ed9d..f93ce29dbf 100644
--- a/source3/rpc_client/cli_dfs.c
+++ b/source3/rpc_client/cli_dfs.c
@@ -142,7 +142,7 @@ NTSTATUS rpccli_dfs_GetInfo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, co
return werror_to_ntstatus(r.status);
}
-NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32 level, uint32 bufsize, NETDFS_DFS_ENUMSTRUCT *info, uint32 *unknown, uint32 *total)
+NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32 level, uint32 bufsize, NETDFS_DFS_ENUMSTRUCT *info, uint32 *total)
{
prs_struct qbuf, rbuf;
NETDFS_Q_DFS_ENUM q;
@@ -153,7 +153,7 @@ NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint3
/* Marshall data and send request */
- if (!init_netdfs_q_dfs_Enum(&q, level, bufsize, info, unknown, total))
+ if (!init_netdfs_q_dfs_Enum(&q, level, bufsize, info, total))
return NT_STATUS_INVALID_PARAMETER;
CLI_DO_RPC(cli, mem_ctx, PI_NETDFS, DFS_ENUM,
diff --git a/source3/rpc_parse/parse_dfs.c b/source3/rpc_parse/parse_dfs.c
index fb0d2fe5a7..acf80c6dbd 100644
--- a/source3/rpc_parse/parse_dfs.c
+++ b/source3/rpc_parse/parse_dfs.c
@@ -1862,7 +1862,7 @@ BOOL netdfs_io_r_dfs_GetInfo(const char *desc, NETDFS_R_DFS_GETINFO *v, prs_stru
return True;
}
-BOOL init_netdfs_q_dfs_Enum(NETDFS_Q_DFS_ENUM *v, uint32 level, uint32 bufsize, NETDFS_DFS_ENUMSTRUCT *info, uint32 *unknown, uint32 *total)
+BOOL init_netdfs_q_dfs_Enum(NETDFS_Q_DFS_ENUM *v, uint32 level, uint32 bufsize, NETDFS_DFS_ENUMSTRUCT *info, uint32 *total)
{
DEBUG(5,("init_netdfs_q_dfs_Enum\n"));
@@ -1877,13 +1877,6 @@ BOOL init_netdfs_q_dfs_Enum(NETDFS_Q_DFS_ENUM *v, uint32 level, uint32 bufsize,
v->ptr0_info = 0;
}
- if (unknown) {
- v->ptr0_unknown = 1;
- v->unknown = *unknown;
- } else {
- v->ptr0_unknown = 0;
- }
-
if (total) {
v->ptr0_total = 1;
v->total = *total;
@@ -1920,17 +1913,6 @@ BOOL netdfs_io_q_dfs_Enum(const char *desc, NETDFS_Q_DFS_ENUM *v, prs_struct *ps
if (!prs_align_custom(ps, 4))
return False;
- if (!prs_uint32("ptr0_unknown", ps, depth, &v->ptr0_unknown))
- return False;
-
- if (v->ptr0_unknown) {
- if (!prs_uint32("unknown", ps, depth, &v->unknown))
- return False;
- }
-
- if (!prs_align_custom(ps, 4))
- return False;
-
if (!prs_uint32("ptr0_total", ps, depth, &v->ptr0_total))
return False;
diff --git a/source3/rpc_server/srv_dfs_nt.c b/source3/rpc_server/srv_dfs_nt.c
index c7f8e05d91..abdd9e8f23 100644
--- a/source3/rpc_server/srv_dfs_nt.c
+++ b/source3/rpc_server/srv_dfs_nt.c
@@ -200,6 +200,7 @@ static BOOL init_reply_dfs_info_2(struct junction_map* j, NETDFS_DFS_INFO2* dfs2
j->service_name, j->volume_name);
init_unistr2(&dfs2->path, str, UNI_STR_TERMINATE);
dfs2->ptr0_comment = 0;
+ init_unistr2(&dfs2->comment, j->comment, UNI_STR_TERMINATE);
dfs2->state = 1; /* set up state of dfs junction as OK */
dfs2->num_stores = j->referral_count;
return True;
@@ -219,7 +220,7 @@ static BOOL init_reply_dfs_info_3(TALLOC_CTX *ctx, struct junction_map* j, NETDF
init_unistr2(&dfs3->path, str, UNI_STR_TERMINATE);
dfs3->ptr0_comment = 1;
- init_unistr2(&dfs3->comment, "", UNI_STR_TERMINATE);
+ init_unistr2(&dfs3->comment, j->comment, UNI_STR_TERMINATE);
dfs3->state = 1;
dfs3->num_stores = dfs3->size_stores = j->referral_count;
dfs3->ptr0_stores = 1;
@@ -254,6 +255,14 @@ static BOOL init_reply_dfs_info_3(TALLOC_CTX *ctx, struct junction_map* j, NETDF
return True;
}
+static BOOL init_reply_dfs_info_100(struct junction_map* j, NETDFS_DFS_INFO100* dfs100)
+{
+ dfs100->ptr0_comment = 1;
+ init_unistr2(&dfs100->comment, j->comment, UNI_STR_TERMINATE);
+ return True;
+}
+
+
WERROR _dfs_Enum(pipes_struct *p, NETDFS_Q_DFS_ENUM *q_u, NETDFS_R_DFS_ENUM *r_u)
{
uint32 level = q_u->level;
@@ -264,7 +273,7 @@ WERROR _dfs_Enum(pipes_struct *p, NETDFS_Q_DFS_ENUM *q_u, NETDFS_R_DFS_ENUM *r_u
num_jn = enum_msdfs_links(p->mem_ctx, jn, ARRAY_SIZE(jn));
vfs_ChDir(p->conn,p->conn->connectpath);
- DEBUG(5,("make_reply_dfs_enum: %d junctions found in Dfs, doing level %d\n", num_jn, level));
+ DEBUG(5,("_dfs_Enum: %d junctions found in Dfs, doing level %d\n", num_jn, level));
r_u->ptr0_info = q_u->ptr0_info;
r_u->ptr0_total = q_u->ptr0_total;
@@ -330,7 +339,7 @@ WERROR _dfs_GetInfo(pipes_struct *p, NETDFS_Q_DFS_GETINFO *q_u,
uint32 level = q_u->level;
int consumedcnt = sizeof(pstring);
pstring path;
- BOOL ret;
+ BOOL ret = False;
struct junction_map jn;
unistr2_to_ascii(path, uni_path, sizeof(path)-1);
@@ -352,8 +361,12 @@ WERROR _dfs_GetInfo(pipes_struct *p, NETDFS_Q_DFS_GETINFO *q_u,
case 1: ret = init_reply_dfs_info_1(&jn, &r_u->info.u.info1); break;
case 2: ret = init_reply_dfs_info_2(&jn, &r_u->info.u.info2); break;
case 3: ret = init_reply_dfs_info_3(p->mem_ctx, &jn, &r_u->info.u.info3); break;
+ case 100: ret = init_reply_dfs_info_100(&jn, &r_u->info.u.info100); break;
default:
- ret = False;
+ r_u->info.ptr0 = 1;
+ r_u->info.switch_value = 0;
+ r_u->status = WERR_OK;
+ ret = True;
break;
}
diff --git a/source3/rpcclient/cmd_dfs.c b/source3/rpcclient/cmd_dfs.c
index b4d43bda5e..75543df267 100644
--- a/source3/rpcclient/cmd_dfs.c
+++ b/source3/rpcclient/cmd_dfs.c
@@ -190,7 +190,7 @@ static NTSTATUS cmd_dfs_enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
NETDFS_DFS_ENUMINFO_CTR ctr;
NTSTATUS result;
uint32 info_level = 1;
- uint32 unknown = 0, total = 0;
+ uint32 total = 0;
if (argc > 2) {
printf("Usage: %s [info_level]\n", argv[0]);
@@ -204,7 +204,7 @@ static NTSTATUS cmd_dfs_enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
init_netdfs_dfs_EnumStruct(&str, info_level, ctr);
str.e.ptr0 = 1;
- result = rpccli_dfs_Enum(cli, mem_ctx, info_level, 0xFFFFFFFF, &str, &unknown, &total);
+ result = rpccli_dfs_Enum(cli, mem_ctx, info_level, 0xFFFFFFFF, &str, &total);
if (NT_STATUS_IS_OK(result))
display_dfs_enumstruct(&str);
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 2edad311ea..44415ddd16 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -901,6 +901,7 @@ BOOL create_junction(char *pathname, struct junction_map *jucn)
pstrcpy(jucn->service_name,dp.servicename);
pstrcpy(jucn->volume_name,dp.reqpath);
+ pstrcpy(jucn->comment, lp_comment(lp_servicenumber(dp.servicename)));
return True;
}