From 3d507a2fcab9da3d9ba928fbe1d30f2642ab4e93 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 30 Jan 2008 12:53:09 +0100 Subject: Let _samr_Close() use pidl generated server code. Guenther (This used to be commit 2df3408079fc382d00d01a0b82b0b8e1ffeba6e4) --- source3/rpc_server/srv_samr.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index a1deac083d..e2ffdefcd6 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -36,33 +36,33 @@ #define DBGC_CLASS DBGC_RPC_SRV /******************************************************************* - api_samr_close_hnd ********************************************************************/ -static bool api_samr_close_hnd(pipes_struct *p) +static bool proxy_samr_call(pipes_struct *p, uint8 opnum) { - SAMR_Q_CLOSE_HND q_u; - SAMR_R_CLOSE_HND r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; + struct api_struct *fns; + int n_fns; - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); + samr_get_pipe_fns(&fns, &n_fns); - if(!samr_io_q_close_hnd("", &q_u, data, 0)) { - DEBUG(0,("api_samr_close_hnd: unable to unmarshall SAMR_Q_CLOSE_HND.\n")); - return False; + if (opnum >= n_fns) { + return false; } - r_u.status = _samr_close_hnd(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_close_hnd("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_close_hnd: unable to marshall SAMR_R_CLOSE_HND.\n")); - return False; + if (fns[opnum].opnum != opnum) { + smb_panic("SAMR function table not sorted"); } - return True; + return fns[opnum].fn(p); +} + +/******************************************************************* + api_samr_close_hnd + ********************************************************************/ + +static bool api_samr_close_hnd(pipes_struct *p) +{ + return proxy_samr_call(p, NDR_SAMR_CLOSE); } /******************************************************************* @@ -1557,14 +1557,14 @@ static struct api_struct api_samr_cmds [] = {"SAMR_CONNECT5" , SAMR_CONNECT5 , api_samr_connect5 } }; -void samr_get_pipe_fns( struct api_struct **fns, int *n_fns ) +void samr2_get_pipe_fns( struct api_struct **fns, int *n_fns ) { *fns = api_samr_cmds; *n_fns = sizeof(api_samr_cmds) / sizeof(struct api_struct); } -NTSTATUS rpc_samr_init(void) +NTSTATUS rpc_samr2_init(void) { return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "samr", "lsass", api_samr_cmds, sizeof(api_samr_cmds) / sizeof(struct api_struct)); -- cgit From 2e2fa2c66ed8cd1ada68bc22ff257490495a29f0 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 30 Jan 2008 21:55:03 +0100 Subject: Use pidl for samr_GetDomPwInfo() server-side. Guenther (This used to be commit 60fe8ade74d24d49f0fed0aae360a3b00edcd2b4) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index e2ffdefcd6..c05d126c4c 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -1350,28 +1350,7 @@ static bool api_samr_set_aliasinfo(pipes_struct *p) static bool api_samr_get_dom_pwinfo(pipes_struct *p) { - SAMR_Q_GET_DOM_PWINFO q_u; - SAMR_R_GET_DOM_PWINFO r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_get_dom_pwinfo("", &q_u, data, 0)) { - DEBUG(0,("api_samr_get_dom_pwinfo: unable to unmarshall SAMR_Q_GET_DOM_PWINFO.\n")); - return False; - } - - r_u.status = _samr_get_dom_pwinfo(p, &q_u, &r_u); - - if (!samr_io_r_get_dom_pwinfo("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_get_dom_pwinfo: unable to marshall SAMR_R_GET_DOM_PWINFO.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_GETDOMPWINFO); } /******************************************************************* -- cgit From fd15e9dd1c784220f8666083e2fa0bb9c75e7755 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Feb 2008 00:23:50 +0100 Subject: Use pidl for _samr_OpenDomain(). Guenther (This used to be commit 15801832ecd59bdb35ed33696944fe5beb08bf3f) --- source3/rpc_server/srv_samr.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index c05d126c4c..9319d422da 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -71,29 +71,7 @@ static bool api_samr_close_hnd(pipes_struct *p) static bool api_samr_open_domain(pipes_struct *p) { - SAMR_Q_OPEN_DOMAIN q_u; - SAMR_R_OPEN_DOMAIN r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if(!samr_io_q_open_domain("", &q_u, data, 0)) { - DEBUG(0,("api_samr_open_domain: unable to unmarshall SAMR_Q_OPEN_DOMAIN.\n")); - return False; - } - - r_u.status = _samr_open_domain(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_open_domain("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_open_domain: unable to marshall SAMR_R_OPEN_DOMAIN.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_OPENDOMAIN); } /******************************************************************* -- cgit From 645559990f03c4ca702c472f9344343e78b4385f Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Feb 2008 00:39:06 +0100 Subject: Use pidl for _samr_OpenUser(). Guenther (This used to be commit ea3a096bcdc42fd4a86be5df3e8f9745e99970ff) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 9319d422da..0627a07397 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -417,28 +417,7 @@ static bool api_samr_lookup_rids(pipes_struct *p) static bool api_samr_open_user(pipes_struct *p) { - SAMR_Q_OPEN_USER q_u; - SAMR_R_OPEN_USER r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if(!samr_io_q_open_user("", &q_u, data, 0)) { - DEBUG(0,("api_samr_open_user: unable to unmarshall SAMR_Q_OPEN_USER.\n")); - return False; - } - - r_u.status = _samr_open_user(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_open_user("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_open_user: unable to marshall SAMR_R_OPEN_USER.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_OPENUSER); } /******************************************************************* -- cgit From ecaa48925f166f9b3295dc95edba23faf4df50f6 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Feb 2008 00:48:40 +0100 Subject: Use pidl for _samr_OpenAlias(). Guenther (This used to be commit 1a98282d2c61e45645c68941631eb0499baa4cbb) --- source3/rpc_server/srv_samr.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 0627a07397..b1c7349c31 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -761,29 +761,7 @@ static bool api_samr_enum_domains(pipes_struct *p) static bool api_samr_open_alias(pipes_struct *p) { - SAMR_Q_OPEN_ALIAS q_u; - SAMR_R_OPEN_ALIAS r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* grab the samr open policy */ - if(!samr_io_q_open_alias("", &q_u, data, 0)) { - DEBUG(0,("api_samr_open_alias: Unable to unmarshall SAMR_Q_OPEN_ALIAS.\n")); - return False; - } - - r_u.status=_samr_open_alias(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_open_alias("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_open_alias: Unable to marshall SAMR_R_OPEN_ALIAS.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_OPENALIAS); } /******************************************************************* -- cgit From 846c3a30016444850a1fb24d5fccd6345e8a60a0 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Feb 2008 00:49:32 +0100 Subject: Use pidl for _samr_OpenGroup(). Guenther (This used to be commit e74ad425ff3a139fa12c0320e4a292dcb0991888) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index b1c7349c31..447865eb15 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -1294,28 +1294,7 @@ static bool api_samr_get_dom_pwinfo(pipes_struct *p) static bool api_samr_open_group(pipes_struct *p) { - SAMR_Q_OPEN_GROUP q_u; - SAMR_R_OPEN_GROUP r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_open_group("", &q_u, data, 0)) { - DEBUG(0,("api_samr_open_group: unable to unmarshall SAMR_Q_OPEN_GROUP.\n")); - return False; - } - - r_u.status = _samr_open_group(p, &q_u, &r_u); - - if (!samr_io_r_open_group("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_open_group: unable to marshall SAMR_R_OPEN_GROUP.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_OPENGROUP); } /******************************************************************* -- cgit From 145ff9a4b4a8240b4214b866d7412d4a125a8ab6 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Feb 2008 01:30:50 +0100 Subject: Use pidl for _samr_DeleteUser(). Guenther (This used to be commit 86827e374469421e2204598712225fb19d4af64b) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 447865eb15..b3a54700a4 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -1045,28 +1045,7 @@ static bool api_samr_del_groupmem(pipes_struct *p) static bool api_samr_delete_dom_user(pipes_struct *p) { - SAMR_Q_DELETE_DOM_USER q_u; - SAMR_R_DELETE_DOM_USER r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_delete_dom_user("", &q_u, data, 0)) { - DEBUG(0,("api_samr_delete_dom_user: unable to unmarshall SAMR_Q_DELETE_DOM_USER.\n")); - return False; - } - - r_u.status = _samr_delete_dom_user(p, &q_u, &r_u); - - if (!samr_io_r_delete_dom_user("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_delete_dom_user: unable to marshall SAMR_R_DELETE_DOM_USER.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_DELETEUSER); } /******************************************************************* -- cgit From b36ad1d59b07456b300775f51914af3183aac428 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Feb 2008 01:31:45 +0100 Subject: Use pidl for _samr_DeleteDomainGroup(). Guenther (This used to be commit b8bf051bdda221dda15598e16bb8dbec68bc7df7) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index b3a54700a4..5d69886445 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -1054,28 +1054,7 @@ static bool api_samr_delete_dom_user(pipes_struct *p) static bool api_samr_delete_dom_group(pipes_struct *p) { - SAMR_Q_DELETE_DOM_GROUP q_u; - SAMR_R_DELETE_DOM_GROUP r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_delete_dom_group("", &q_u, data, 0)) { - DEBUG(0,("api_samr_delete_dom_group: unable to unmarshall SAMR_Q_DELETE_DOM_GROUP.\n")); - return False; - } - - r_u.status = _samr_delete_dom_group(p, &q_u, &r_u); - - if (!samr_io_r_delete_dom_group("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_delete_dom_group: unable to marshall SAMR_R_DELETE_DOM_GROUP.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_DELETEDOMAINGROUP); } /******************************************************************* -- cgit From 1921a6d67e704ac009695885e6954596e278a681 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Feb 2008 01:32:18 +0100 Subject: Use pidl for _samr_DeleteDomAlias(). Guenther (This used to be commit 31d5a3aaa42c18319fd751aba65f435348b1e83e) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 5d69886445..4d5f841aa2 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -1063,28 +1063,7 @@ static bool api_samr_delete_dom_group(pipes_struct *p) static bool api_samr_delete_dom_alias(pipes_struct *p) { - SAMR_Q_DELETE_DOM_ALIAS q_u; - SAMR_R_DELETE_DOM_ALIAS r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_delete_dom_alias("", &q_u, data, 0)) { - DEBUG(0,("api_samr_delete_dom_alias: unable to unmarshall SAMR_Q_DELETE_DOM_ALIAS.\n")); - return False; - } - - r_u.status = _samr_delete_dom_alias(p, &q_u, &r_u); - - if (!samr_io_r_delete_dom_alias("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_delete_dom_alias: unable to marshall SAMR_R_DELETE_DOM_ALIAS.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_DELETEDOMALIAS); } /******************************************************************* -- cgit From 3e67d648a1d164b67cf390ae33e83fc9362e3179 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Feb 2008 14:48:42 +0100 Subject: Use pidl for _samr_CreateDomAlias(). Guenther (This used to be commit 622d529c45aaa6d8ddd3a38a2fa4fc5e1ad53fe9) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 4d5f841aa2..1ab8a318b2 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -1102,28 +1102,7 @@ static bool api_samr_create_dom_group(pipes_struct *p) static bool api_samr_create_dom_alias(pipes_struct *p) { - SAMR_Q_CREATE_DOM_ALIAS q_u; - SAMR_R_CREATE_DOM_ALIAS r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_create_dom_alias("", &q_u, data, 0)) { - DEBUG(0,("api_samr_create_dom_alias: unable to unmarshall SAMR_Q_CREATE_DOM_ALIAS.\n")); - return False; - } - - r_u.status = _samr_create_dom_alias(p, &q_u, &r_u); - - if (!samr_io_r_create_dom_alias("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_create_dom_alias: unable to marshall SAMR_R_CREATE_DOM_ALIAS.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_CREATEDOMALIAS); } /******************************************************************* -- cgit From 6e74a5dba33f8be671fddce367ef341c9c2fe6bc Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Feb 2008 14:49:23 +0100 Subject: Use pidl for _samr_CreateDomainGroup(). Guenther (This used to be commit c53bfd74251398924a1fae0fd8d9020dba958ba1) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 1ab8a318b2..b7d322884a 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -1072,28 +1072,7 @@ static bool api_samr_delete_dom_alias(pipes_struct *p) static bool api_samr_create_dom_group(pipes_struct *p) { - SAMR_Q_CREATE_DOM_GROUP q_u; - SAMR_R_CREATE_DOM_GROUP r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_create_dom_group("", &q_u, data, 0)) { - DEBUG(0,("api_samr_create_dom_group: unable to unmarshall SAMR_Q_CREATE_DOM_GROUP.\n")); - return False; - } - - r_u.status = _samr_create_dom_group(p, &q_u, &r_u); - - if (!samr_io_r_create_dom_group("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_create_dom_group: unable to marshall SAMR_R_CREATE_DOM_GROUP.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_CREATEDOMAINGROUP); } /******************************************************************* -- cgit From f0438acfda7ae28a68d20be3cd05cdaeff9ac82b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Feb 2008 14:50:33 +0100 Subject: Use pidl for _samr_CreateUser2(). Guenther (This used to be commit 36f52b631c013f885ed25ea741a52f763d27198b) --- source3/rpc_server/srv_samr.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index b7d322884a..f2e6f79d8c 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -516,30 +516,7 @@ static bool api_samr_query_domain_info(pipes_struct *p) static bool api_samr_create_user(pipes_struct *p) { - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - SAMR_Q_CREATE_USER q_u; - SAMR_R_CREATE_USER r_u; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* grab the samr create user */ - if (!samr_io_q_create_user("", &q_u, data, 0)) { - DEBUG(0,("api_samr_create_user: Unable to unmarshall SAMR_Q_CREATE_USER.\n")); - return False; - } - - r_u.status=_samr_create_user(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_create_user("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_create_user: Unable to marshall SAMR_R_CREATE_USER.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_CREATEUSER2); } /******************************************************************* -- cgit From e7a82edd3557ce0da11c56231bf3f51b3e686061 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Feb 2008 23:06:43 +0100 Subject: Use pidl for _samr_ChangePasswordUser2(). Guenther (This used to be commit a142fe21e386233af658024b5a194eee0bc5c4ba) --- source3/rpc_server/srv_samr.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index f2e6f79d8c..38bbda3f3a 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -355,29 +355,7 @@ static bool api_samr_lookup_names(pipes_struct *p) static bool api_samr_chgpasswd_user(pipes_struct *p) { - SAMR_Q_CHGPASSWD_USER q_u; - SAMR_R_CHGPASSWD_USER r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* change password request */ - if (!samr_io_q_chgpasswd_user("", &q_u, data, 0)) { - DEBUG(0,("api_samr_chgpasswd_user: Failed to unmarshall SAMR_Q_CHGPASSWD_USER.\n")); - return False; - } - - r_u.status = _samr_chgpasswd_user(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_chgpasswd_user("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_chgpasswd_user: Failed to marshall SAMR_R_CHGPASSWD_USER.\n" )); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_CHANGEPASSWORDUSER2); } /******************************************************************* -- cgit From f965f324f599e50e701c91f1c45c70499ee5f037 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Feb 2008 17:28:01 +0100 Subject: Use pidl for _samr_QuerySecurity(). Guenther (This used to be commit c61cba97268f198ad7e25acc3cb0b166e897299d) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 38bbda3f3a..463181e16c 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -140,28 +140,7 @@ static bool api_samr_set_sec_obj(pipes_struct *p) static bool api_samr_query_sec_obj(pipes_struct *p) { - SAMR_Q_QUERY_SEC_OBJ q_u; - SAMR_R_QUERY_SEC_OBJ r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if(!samr_io_q_query_sec_obj("", &q_u, data, 0)) { - DEBUG(0,("api_samr_query_sec_obj: unable to unmarshall SAMR_Q_QUERY_SEC_OBJ.\n")); - return False; - } - - r_u.status = _samr_query_sec_obj(p, &q_u, &r_u); - - if(!samr_io_r_query_sec_obj("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_query_sec_obj: unable to marshall SAMR_R_QUERY_SEC_OBJ.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_QUERYSECURITY); } /******************************************************************* -- cgit From 65172ba6b8efd6757c392d0957876d5d81f04348 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Feb 2008 17:29:03 +0100 Subject: Use pidl for _samr_SetSecurity(). Guenther (This used to be commit 6bfd76002f083f07b3d9d5c1f16e67614e7eb972) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 463181e16c..94f7c6f153 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -110,28 +110,7 @@ static bool api_samr_get_usrdom_pwinfo(pipes_struct *p) static bool api_samr_set_sec_obj(pipes_struct *p) { - SAMR_Q_SET_SEC_OBJ q_u; - SAMR_R_SET_SEC_OBJ r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if(!samr_io_q_set_sec_obj("", &q_u, data, 0)) { - DEBUG(0,("api_samr_set_sec_obj: unable to unmarshall SAMR_Q_SET_SEC_OBJ.\n")); - return False; - } - - r_u.status = _samr_set_sec_obj(p, &q_u, &r_u); - - if(!samr_io_r_set_sec_obj("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_set_sec_obj: unable to marshall SAMR_R_SET_SEC_OBJ.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_SETSECURITY); } /******************************************************************* -- cgit From 2730ce999707be0e2308c07568fe38e3a07df41f Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Feb 2008 16:17:20 +0100 Subject: Use pidl for _samr_Connect(). Guenther (This used to be commit 79c3aa6588c6d79a2127153dc0bcc75ecc468de8) --- source3/rpc_server/srv_samr.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 94f7c6f153..5fb16fe14a 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -461,29 +461,7 @@ static bool api_samr_create_user(pipes_struct *p) static bool api_samr_connect_anon(pipes_struct *p) { - SAMR_Q_CONNECT_ANON q_u; - SAMR_R_CONNECT_ANON r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* grab the samr open policy */ - if(!samr_io_q_connect_anon("", &q_u, data, 0)) { - DEBUG(0,("api_samr_connect_anon: unable to unmarshall SAMR_Q_CONNECT_ANON.\n")); - return False; - } - - r_u.status = _samr_connect_anon(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_connect_anon("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_connect_anon: unable to marshall SAMR_R_CONNECT_ANON.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_CONNECT); } /******************************************************************* -- cgit From 390746afeac135e29801ed16cad80553fcdd5c78 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Feb 2008 16:23:46 +0100 Subject: Use pidl for _samr_Connect2(). Guenther (This used to be commit 35a691c2595883a7f15d039839de11798b9a7ceb) --- source3/rpc_server/srv_samr.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 5fb16fe14a..5e83687ad3 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -470,29 +470,7 @@ static bool api_samr_connect_anon(pipes_struct *p) static bool api_samr_connect(pipes_struct *p) { - SAMR_Q_CONNECT q_u; - SAMR_R_CONNECT r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* grab the samr open policy */ - if(!samr_io_q_connect("", &q_u, data, 0)) { - DEBUG(0,("api_samr_connect: unable to unmarshall SAMR_Q_CONNECT.\n")); - return False; - } - - r_u.status = _samr_connect(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_connect("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_connect: unable to marshall SAMR_R_CONNECT.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_CONNECT2); } /******************************************************************* -- cgit From 867edaa33f7fb152447712bc405380ad6669781b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Feb 2008 16:35:32 +0100 Subject: Use pidl for _samr_Connect4(). Guenther (This used to be commit ceb3b6a0a3ed15c04bdb518a28167531403cc928) --- source3/rpc_server/srv_samr.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 5e83687ad3..73a1228b68 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -479,29 +479,7 @@ static bool api_samr_connect(pipes_struct *p) static bool api_samr_connect4(pipes_struct *p) { - SAMR_Q_CONNECT4 q_u; - SAMR_R_CONNECT4 r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* grab the samr open policy */ - if(!samr_io_q_connect4("", &q_u, data, 0)) { - DEBUG(0,("api_samr_connect4: unable to unmarshall SAMR_Q_CONNECT4.\n")); - return False; - } - - r_u.status = _samr_connect4(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_connect4("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_connect4: unable to marshall SAMR_R_CONNECT4.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_CONNECT4); } /******************************************************************* -- cgit From e1e8ab30f712d389a353cf32cbf8cf1083360b2a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Feb 2008 17:10:16 +0100 Subject: Use pidl for _samr_Connect5(). Guenther (This used to be commit ca233bfe0e5350cb699312e4937c6bd1cb43f7c1) --- source3/rpc_server/srv_samr.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 73a1228b68..dd162c7479 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -519,29 +519,7 @@ static bool api_samr_chgpasswd_user3(pipes_struct *p) static bool api_samr_connect5(pipes_struct *p) { - SAMR_Q_CONNECT5 q_u; - SAMR_R_CONNECT5 r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* grab the samr open policy */ - if(!samr_io_q_connect5("", &q_u, data, 0)) { - DEBUG(0,("api_samr_connect5: unable to unmarshall SAMR_Q_CONNECT5.\n")); - return False; - } - - r_u.status = _samr_connect5(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_connect5("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_connect5: unable to marshall SAMR_R_CONNECT5.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_CONNECT5); } /********************************************************************** -- cgit From 4906b5037d09beceee67a455177269215c140206 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Feb 2008 18:09:35 +0100 Subject: Use pidl for _samr_DeleteGroupMember(). Guenther (This used to be commit 94d6536809266ea3a12cd255fb7f2f7a70c42da3) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index dd162c7479..ddefa569cf 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -840,28 +840,7 @@ static bool api_samr_add_groupmem(pipes_struct *p) static bool api_samr_del_groupmem(pipes_struct *p) { - SAMR_Q_DEL_GROUPMEM q_u; - SAMR_R_DEL_GROUPMEM r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_del_groupmem("", &q_u, data, 0)) { - DEBUG(0,("api_samr_del_groupmem: unable to unmarshall SAMR_Q_DEL_GROUPMEM.\n")); - return False; - } - - r_u.status = _samr_del_groupmem(p, &q_u, &r_u); - - if (!samr_io_r_del_groupmem("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_del_groupmem: unable to marshall SAMR_R_DEL_GROUPMEM.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_DELETEGROUPMEMBER); } /******************************************************************* -- cgit From 062820eaee624ac1c02e695d26b5ad4a0b0f66d9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Feb 2008 18:36:44 +0100 Subject: Use pidl for _samr_AddGroupMember(). Guenther (This used to be commit 4f923d970eac5841d1f67dbb8fc0c1dd1fda95a3) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index ddefa569cf..15cbf4cb61 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -810,28 +810,7 @@ static bool api_samr_del_aliasmem(pipes_struct *p) static bool api_samr_add_groupmem(pipes_struct *p) { - SAMR_Q_ADD_GROUPMEM q_u; - SAMR_R_ADD_GROUPMEM r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_add_groupmem("", &q_u, data, 0)) { - DEBUG(0,("api_samr_add_groupmem: unable to unmarshall SAMR_Q_ADD_GROUPMEM.\n")); - return False; - } - - r_u.status = _samr_add_groupmem(p, &q_u, &r_u); - - if (!samr_io_r_add_groupmem("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_add_groupmem: unable to marshall SAMR_R_ADD_GROUPMEM.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_ADDGROUPMEMBER); } /******************************************************************* -- cgit From b04a5e09f7b50e5b9c589e43c5df91f4913e3ab0 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Feb 2008 22:53:03 +0100 Subject: Use pidl for _samr_GetUserPwInfo(). Guenther (This used to be commit 4e7236c10e5a1cbea2e961e196729603c66f37d6) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 15cbf4cb61..211b9cd661 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -80,28 +80,7 @@ static bool api_samr_open_domain(pipes_struct *p) static bool api_samr_get_usrdom_pwinfo(pipes_struct *p) { - SAMR_Q_GET_USRDOM_PWINFO q_u; - SAMR_R_GET_USRDOM_PWINFO r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if(!samr_io_q_get_usrdom_pwinfo("", &q_u, data, 0)) { - DEBUG(0,("api_samr_get_usrdom_pwinfo: unable to unmarshall SAMR_Q_GET_USRDOM_PWINFO.\n")); - return False; - } - - r_u.status = _samr_get_usrdom_pwinfo(p, &q_u, &r_u); - - if(!samr_io_r_get_usrdom_pwinfo("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_get_usrdom_pwinfo: unable to marshall SAMR_R_GET_USRDOM_PWINFO.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_GETUSERPWINFO); } /******************************************************************* -- cgit From 0bdb2d42bba0c7b88a71bf9f049bed21c050eab7 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Feb 2008 23:27:22 +0100 Subject: Use pidl for _samr_DeleteAliasMember(). Guenther (This used to be commit 51f5bcfd39b169866a13bb5b7878f99dc2b89462) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 211b9cd661..84bcff687f 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -759,28 +759,7 @@ static bool api_samr_add_aliasmem(pipes_struct *p) static bool api_samr_del_aliasmem(pipes_struct *p) { - SAMR_Q_DEL_ALIASMEM q_u; - SAMR_R_DEL_ALIASMEM r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_del_aliasmem("", &q_u, data, 0)) { - DEBUG(0,("api_samr_del_aliasmem: unable to unmarshall SAMR_Q_DEL_ALIASMEM.\n")); - return False; - } - - r_u.status = _samr_del_aliasmem(p, &q_u, &r_u); - - if (!samr_io_r_del_aliasmem("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_del_aliasmem: unable to marshall SAMR_R_DEL_ALIASMEM.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_DELETEALIASMEMBER); } /******************************************************************* -- cgit From 5bae7a4bec9f4e2f71edb881847ed98597b4637a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Feb 2008 23:40:19 +0100 Subject: Use pidl for _samr_AddAliasMember(). Guenther (This used to be commit 98d8482bae0c9500ab4a1f6c07acd327b894af66) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 84bcff687f..fc5edcc7f6 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -729,28 +729,7 @@ static bool api_samr_query_groupmem(pipes_struct *p) static bool api_samr_add_aliasmem(pipes_struct *p) { - SAMR_Q_ADD_ALIASMEM q_u; - SAMR_R_ADD_ALIASMEM r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_add_aliasmem("", &q_u, data, 0)) { - DEBUG(0,("api_samr_add_aliasmem: unable to unmarshall SAMR_Q_ADD_ALIASMEM.\n")); - return False; - } - - r_u.status = _samr_add_aliasmem(p, &q_u, &r_u); - - if (!samr_io_r_add_aliasmem("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_add_aliasmem: unable to marshall SAMR_R_ADD_ALIASMEM.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_ADDALIASMEMBER); } /******************************************************************* -- cgit From 5bec586b424d2325bd76683a821629b5635c69f1 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 5 Feb 2008 00:29:11 +0100 Subject: Use pidl for _samr_GetMembersInAlias(). Guenther (This used to be commit f6db8a51c8858e48567a819f18a7215e7ad8f6b4) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index fc5edcc7f6..012503b3e7 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -669,28 +669,7 @@ static bool api_samr_query_useraliases(pipes_struct *p) static bool api_samr_query_aliasmem(pipes_struct *p) { - SAMR_Q_QUERY_ALIASMEM q_u; - SAMR_R_QUERY_ALIASMEM r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_query_aliasmem("", &q_u, data, 0)) { - DEBUG(0,("api_samr_query_aliasmem: unable to unmarshall SAMR_Q_QUERY_ALIASMEM.\n")); - return False; - } - - r_u.status = _samr_query_aliasmem(p, &q_u, &r_u); - - if (!samr_io_r_query_aliasmem("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_query_aliasmem: unable to marshall SAMR_R_QUERY_ALIASMEM.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_GETMEMBERSINALIAS); } /******************************************************************* -- cgit From 1dbfc38b28d44fe8f6e66b6c95db813bd577be29 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 5 Feb 2008 01:29:49 +0100 Subject: Use pidl for _samr_LookupDomain(). Guenther (This used to be commit 9bc106ba56d3a965a5fcd76ce18ccd30baa06eb4) --- source3/rpc_server/srv_samr.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 012503b3e7..8c71e5ea1e 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -507,27 +507,7 @@ static bool api_samr_connect5(pipes_struct *p) static bool api_samr_lookup_domain(pipes_struct *p) { - SAMR_Q_LOOKUP_DOMAIN q_u; - SAMR_R_LOOKUP_DOMAIN r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if(!samr_io_q_lookup_domain("", &q_u, data, 0)) { - DEBUG(0,("api_samr_lookup_domain: Unable to unmarshall SAMR_Q_LOOKUP_DOMAIN.\n")); - return False; - } - - r_u.status = _samr_lookup_domain(p, &q_u, &r_u); - - if(!samr_io_r_lookup_domain("", &r_u, rdata, 0)){ - DEBUG(0,("api_samr_lookup_domain: Unable to marshall SAMR_R_LOOKUP_DOMAIN.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_LOOKUPDOMAIN); } /********************************************************************** -- cgit From f3d5f695646ef498889405c3b49c6b220df9d004 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 5 Feb 2008 02:04:56 +0100 Subject: Use pidl for _samr_GetAliasMembership(). Guenther (This used to be commit b573f677239fbf176468796bb05c4b43dce47262) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 8c71e5ea1e..6375d6dbd3 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -619,28 +619,7 @@ static bool api_samr_set_userinfo2(pipes_struct *p) static bool api_samr_query_useraliases(pipes_struct *p) { - SAMR_Q_QUERY_USERALIASES q_u; - SAMR_R_QUERY_USERALIASES r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_query_useraliases("", &q_u, data, 0)) { - DEBUG(0,("api_samr_query_useraliases: Unable to unmarshall SAMR_Q_QUERY_USERALIASES.\n")); - return False; - } - - r_u.status = _samr_query_useraliases(p, &q_u, &r_u); - - if (! samr_io_r_query_useraliases("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_query_useraliases: Unable to nmarshall SAMR_R_QUERY_USERALIASES.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_GETALIASMEMBERSHIP); } /******************************************************************* -- cgit From 01a9964e8220edbc5be618408e83b4fad27792e4 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 5 Feb 2008 03:17:12 +0100 Subject: Use idl for _samr_QueryGroupMember(). Guenther (This used to be commit 4b068954671143a7c94884e169f1d0ba420dccb7) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 6375d6dbd3..d41d828e41 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -637,28 +637,7 @@ static bool api_samr_query_aliasmem(pipes_struct *p) static bool api_samr_query_groupmem(pipes_struct *p) { - SAMR_Q_QUERY_GROUPMEM q_u; - SAMR_R_QUERY_GROUPMEM r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_query_groupmem("", &q_u, data, 0)) { - DEBUG(0,("api_samr_query_groupmem: unable to unmarshall SAMR_Q_QUERY_GROUPMEM.\n")); - return False; - } - - r_u.status = _samr_query_groupmem(p, &q_u, &r_u); - - if (!samr_io_r_query_groupmem("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_query_groupmem: unable to marshall SAMR_R_QUERY_GROUPMEM.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_QUERYGROUPMEMBER); } /******************************************************************* -- cgit From f9447d248faec8d80df13c0d8ea6caf7dc40b2dd Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 5 Feb 2008 12:54:19 +0100 Subject: Remove trailing while space, just couldn't resist. No code change. Guenther (This used to be commit efb6d24e97e489e44991091b10196b6ac582485b) --- source3/rpc_server/srv_samr.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index d41d828e41..bc7fd0e175 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -1,4 +1,4 @@ -/* +/* * Unix SMB/CIFS implementation. * RPC Pipe client / server routines * Copyright (C) Andrew Tridgell 1992-1997, @@ -7,21 +7,21 @@ * Copyright (C) Marc Jacobsen 1999, * Copyright (C) Jean François Micouleau 1998-2001, * Copyright (C) Jim McDonough 2002-2003. - * - * Split into interface and implementation modules by, + * + * Split into interface and implementation modules by, * * Copyright (C) Jeremy Allison 2001. - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ @@ -173,7 +173,7 @@ static bool api_samr_enum_dom_aliases(pipes_struct *p) SAMR_R_ENUM_DOM_ALIASES r_u; prs_struct *data = &p->in_data.data; prs_struct *rdata = &p->out_data.rdata; - + ZERO_STRUCT(q_u); ZERO_STRUCT(r_u); @@ -251,7 +251,7 @@ static bool api_samr_query_aliasinfo(pipes_struct *p) DEBUG(0,("api_samr_query_aliasinfo: unable to marshall SAMR_R_QUERY_ALIASINFO.\n")); return False; } - + return True; } @@ -520,7 +520,7 @@ static bool api_samr_enum_domains(pipes_struct *p) SAMR_R_ENUM_DOMAINS r_u; prs_struct *data = &p->in_data.data; prs_struct *rdata = &p->out_data.rdata; - + ZERO_STRUCT(q_u); ZERO_STRUCT(r_u); @@ -535,7 +535,7 @@ static bool api_samr_enum_domains(pipes_struct *p) DEBUG(0,("api_samr_enum_domains: Unable to marshall SAMR_R_ENUM_DOMAINS.\n")); return False; } - + return True; } @@ -930,7 +930,7 @@ static struct api_struct api_samr_cmds [] = {"SAMR_CONNECT_ANON" , SAMR_CONNECT_ANON , api_samr_connect_anon }, {"SAMR_ENUM_DOMAINS" , SAMR_ENUM_DOMAINS , api_samr_enum_domains }, {"SAMR_ENUM_DOM_USERS" , SAMR_ENUM_DOM_USERS , api_samr_enum_dom_users }, - + {"SAMR_ENUM_DOM_GROUPS" , SAMR_ENUM_DOM_GROUPS , api_samr_enum_dom_groups }, {"SAMR_ENUM_DOM_ALIASES" , SAMR_ENUM_DOM_ALIASES , api_samr_enum_dom_aliases }, {"SAMR_QUERY_USERALIASES" , SAMR_QUERY_USERALIASES, api_samr_query_useraliases}, @@ -940,7 +940,7 @@ static struct api_struct api_samr_cmds [] = {"SAMR_DEL_ALIASMEM" , SAMR_DEL_ALIASMEM , api_samr_del_aliasmem }, {"SAMR_ADD_GROUPMEM" , SAMR_ADD_GROUPMEM , api_samr_add_groupmem }, {"SAMR_DEL_GROUPMEM" , SAMR_DEL_GROUPMEM , api_samr_del_groupmem }, - + {"SAMR_DELETE_DOM_USER" , SAMR_DELETE_DOM_USER , api_samr_delete_dom_user }, {"SAMR_DELETE_DOM_GROUP" , SAMR_DELETE_DOM_GROUP , api_samr_delete_dom_group }, {"SAMR_DELETE_DOM_ALIAS" , SAMR_DELETE_DOM_ALIAS , api_samr_delete_dom_alias }, @@ -951,13 +951,13 @@ static struct api_struct api_samr_cmds [] = {"SAMR_QUERY_USERINFO" , SAMR_QUERY_USERINFO , api_samr_query_userinfo }, {"SAMR_SET_USERINFO" , SAMR_SET_USERINFO , api_samr_set_userinfo }, {"SAMR_SET_USERINFO2" , SAMR_SET_USERINFO2 , api_samr_set_userinfo2 }, - + {"SAMR_QUERY_DOMAIN_INFO" , SAMR_QUERY_DOMAIN_INFO, api_samr_query_domain_info}, {"SAMR_QUERY_USERGROUPS" , SAMR_QUERY_USERGROUPS , api_samr_query_usergroups }, {"SAMR_QUERY_DISPINFO" , SAMR_QUERY_DISPINFO , api_samr_query_dispinfo }, {"SAMR_QUERY_DISPINFO3" , SAMR_QUERY_DISPINFO3 , api_samr_query_dispinfo }, {"SAMR_QUERY_DISPINFO4" , SAMR_QUERY_DISPINFO4 , api_samr_query_dispinfo }, - + {"SAMR_QUERY_ALIASINFO" , SAMR_QUERY_ALIASINFO , api_samr_query_aliasinfo }, {"SAMR_QUERY_GROUPINFO" , SAMR_QUERY_GROUPINFO , api_samr_query_groupinfo }, {"SAMR_SET_GROUPINFO" , SAMR_SET_GROUPINFO , api_samr_set_groupinfo }, @@ -971,7 +971,7 @@ static struct api_struct api_samr_cmds [] = {"SAMR_OPEN_DOMAIN" , SAMR_OPEN_DOMAIN , api_samr_open_domain }, {"SAMR_REMOVE_SID_FOREIGN_DOMAIN" , SAMR_REMOVE_SID_FOREIGN_DOMAIN , api_samr_remove_sid_foreign_domain }, {"SAMR_LOOKUP_DOMAIN" , SAMR_LOOKUP_DOMAIN , api_samr_lookup_domain }, - + {"SAMR_QUERY_SEC_OBJECT" , SAMR_QUERY_SEC_OBJECT , api_samr_query_sec_obj }, {"SAMR_SET_SEC_OBJECT" , SAMR_SET_SEC_OBJECT , api_samr_set_sec_obj }, {"SAMR_GET_USRDOM_PWINFO" , SAMR_GET_USRDOM_PWINFO, api_samr_get_usrdom_pwinfo}, -- cgit From ca772c8b18db3bbe0ef6ff9be0c29d3ac732fbe7 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 5 Feb 2008 11:16:58 +0100 Subject: Use pidl for _samr_RemoveMemberFromForeignDomain(). Guenther (This used to be commit ab344dea9689ffc191110de0eca0d43b7221f7ee) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index bc7fd0e175..e6207c812a 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -835,28 +835,7 @@ static bool api_samr_open_group(pipes_struct *p) static bool api_samr_remove_sid_foreign_domain(pipes_struct *p) { - SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN q_u; - SAMR_R_REMOVE_SID_FOREIGN_DOMAIN r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_remove_sid_foreign_domain("", &q_u, data, 0)) { - DEBUG(0,("api_samr_remove_sid_foreign_domain: unable to unmarshall SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN.\n")); - return False; - } - - r_u.status = _samr_remove_sid_foreign_domain(p, &q_u, &r_u); - - if (!samr_io_r_remove_sid_foreign_domain("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_remove_sid_foreign_domain: unable to marshall SAMR_R_REMOVE_SID_FOREIGN_DOMAIN.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN); } /******************************************************************* -- cgit From 3028c76fb57352148b7bd8f1f9dd3c34cf1f7c06 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 5 Feb 2008 15:03:54 +0100 Subject: Use pidl for _samr_QueryDomainInfo() and _samr_QueryDomainInfo2(). Guenther (This used to be commit 1ac767b0d8b42d2f804b0a7e93e5e859f9c25aae) --- source3/rpc_server/srv_samr.c | 46 ++----------------------------------------- 1 file changed, 2 insertions(+), 44 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index e6207c812a..2508ed40cc 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -401,28 +401,7 @@ static bool api_samr_query_usergroups(pipes_struct *p) static bool api_samr_query_domain_info(pipes_struct *p) { - SAMR_Q_QUERY_DOMAIN_INFO q_u; - SAMR_R_QUERY_DOMAIN_INFO r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if(!samr_io_q_query_domain_info("", &q_u, data, 0)) { - DEBUG(0,("api_samr_query_domain_info: unable to unmarshall SAMR_Q_QUERY_DOMAIN_INFO.\n")); - return False; - } - - r_u.status = _samr_query_domain_info(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_query_domain_info("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_query_domain_info: unable to marshall SAMR_R_QUERY_DOMAIN_INFO.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_QUERYDOMAININFO); } /******************************************************************* @@ -844,28 +823,7 @@ static bool api_samr_remove_sid_foreign_domain(pipes_struct *p) static bool api_samr_query_domain_info2(pipes_struct *p) { - SAMR_Q_QUERY_DOMAIN_INFO2 q_u; - SAMR_R_QUERY_DOMAIN_INFO2 r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if(!samr_io_q_query_domain_info2("", &q_u, data, 0)) { - DEBUG(0,("api_samr_query_domain_info2: unable to unmarshall SAMR_Q_QUERY_DOMAIN_INFO2.\n")); - return False; - } - - r_u.status = _samr_query_domain_info2(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_query_domain_info2("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_query_domain_info2: unable to marshall SAMR_R_QUERY_DOMAIN_INFO2.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_QUERYDOMAININFO2); } /******************************************************************* -- cgit From 3dbbb4a6a04652a1d1dd4d76af58f6c7852d7c44 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 5 Feb 2008 15:08:31 +0100 Subject: Use pidl for _samr_SetDomainInfo(). Guenther (This used to be commit 370973c101a59546bb50dcc82ae4419da2119279) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 2508ed40cc..1d6c1a354a 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -832,28 +832,7 @@ static bool api_samr_query_domain_info2(pipes_struct *p) static bool api_samr_set_dom_info(pipes_struct *p) { - SAMR_Q_SET_DOMAIN_INFO q_u; - SAMR_R_SET_DOMAIN_INFO r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if(!samr_io_q_set_domain_info("", &q_u, data, 0)) { - DEBUG(0,("api_samr_set_dom_info: unable to unmarshall SAMR_Q_SET_DOMAIN_INFO.\n")); - return False; - } - - r_u.status = _samr_set_dom_info(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_set_domain_info("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_set_dom_info: unable to marshall SAMR_R_SET_DOMAIN_INFO.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_SETDOMAININFO); } /******************************************************************* -- cgit From 1b35cc2e08e3e4fc4e29dc333387db9945cabba8 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 5 Feb 2008 18:44:30 +0100 Subject: Use pidl for _samr_ChangePasswordUser3(). Guenther (This used to be commit 07c28f308624207c0c8a75d2f1783aa1d1aae05a) --- source3/rpc_server/srv_samr.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 1d6c1a354a..a547f0acd1 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -446,29 +446,7 @@ static bool api_samr_connect4(pipes_struct *p) static bool api_samr_chgpasswd_user3(pipes_struct *p) { - SAMR_Q_CHGPASSWD_USER3 q_u; - SAMR_R_CHGPASSWD_USER3 r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* change password request */ - if (!samr_io_q_chgpasswd_user3("", &q_u, data, 0)) { - DEBUG(0,("api_samr_chgpasswd_user3: Failed to unmarshall SAMR_Q_CHGPASSWD_USER3.\n")); - return False; - } - - r_u.status = _samr_chgpasswd_user3(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_chgpasswd_user3("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_chgpasswd_user3: Failed to marshall SAMR_R_CHGPASSWD_USER3.\n" )); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_CHANGEPASSWORDUSER3); } /******************************************************************* -- cgit From c56cb9d0dc84264e0d887d01afb0c28320d70454 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 6 Feb 2008 12:53:43 +0100 Subject: Use pidl for _samr_SetAliasInfo(). Guenther (This used to be commit f483797c688ee1a5c5f7e183cdf7c1b700b7db31) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index a547f0acd1..a38e9461c4 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -744,28 +744,7 @@ static bool api_samr_set_groupinfo(pipes_struct *p) static bool api_samr_set_aliasinfo(pipes_struct *p) { - SAMR_Q_SET_ALIASINFO q_u; - SAMR_R_SET_ALIASINFO r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_set_aliasinfo("", &q_u, data, 0)) { - DEBUG(0,("api_samr_set_aliasinfo: unable to unmarshall SAMR_Q_SET_ALIASINFO.\n")); - return False; - } - - r_u.status = _samr_set_aliasinfo(p, &q_u, &r_u); - - if (!samr_io_r_set_aliasinfo("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_set_aliasinfo: unable to marshall SAMR_R_SET_ALIASINFO.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_SETALIASINFO); } /******************************************************************* -- cgit From cdb5f49849270b2e1f687fd5cfcbc1461dfd2672 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 6 Feb 2008 12:57:59 +0100 Subject: Use pidl for _samr_SetGroupInfo(). Guenther (This used to be commit a576d9e80dffb15e29c3bf4da225bbe34f77053c) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index a38e9461c4..2fea3c17b0 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -714,28 +714,7 @@ static bool api_samr_query_groupinfo(pipes_struct *p) static bool api_samr_set_groupinfo(pipes_struct *p) { - SAMR_Q_SET_GROUPINFO q_u; - SAMR_R_SET_GROUPINFO r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_set_groupinfo("", &q_u, data, 0)) { - DEBUG(0,("api_samr_set_groupinfo: unable to unmarshall SAMR_Q_SET_GROUPINFO.\n")); - return False; - } - - r_u.status = _samr_set_groupinfo(p, &q_u, &r_u); - - if (!samr_io_r_set_groupinfo("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_set_groupinfo: unable to marshall SAMR_R_SET_GROUPINFO.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_SETGROUPINFO); } /******************************************************************* -- cgit From f7ad51084c87e5063e231c9bf024a354349d6a21 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 7 Feb 2008 13:14:40 +0100 Subject: Use pidl for _samr_QueryAliasInfo(). Guenther (This used to be commit 62dacea87ad2323870e5356a348d1d192b3fa888) --- source3/rpc_server/srv_samr.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 2fea3c17b0..70fe85d6c7 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -230,29 +230,7 @@ static bool api_samr_query_dispinfo(pipes_struct *p) static bool api_samr_query_aliasinfo(pipes_struct *p) { - SAMR_Q_QUERY_ALIASINFO q_u; - SAMR_R_QUERY_ALIASINFO r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* grab the samr open */ - if(!samr_io_q_query_aliasinfo("", &q_u, data, 0)) { - DEBUG(0,("api_samr_query_aliasinfo: unable to unmarshall SAMR_Q_QUERY_ALIASINFO.\n")); - return False; - } - - r_u.status = _samr_query_aliasinfo(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_query_aliasinfo("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_query_aliasinfo: unable to marshall SAMR_R_QUERY_ALIASINFO.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_QUERYALIASINFO); } /******************************************************************* -- cgit From 28124ad6670df42b5312d99838250191295f40d2 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 7 Feb 2008 13:58:53 +0100 Subject: Use pidl for _samr_QueryGroupInfo(). Guenther (This used to be commit e80852426972fbf9996561aabdde7ed7b2c78b39) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 70fe85d6c7..d5666e741d 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -662,28 +662,7 @@ static bool api_samr_create_dom_alias(pipes_struct *p) static bool api_samr_query_groupinfo(pipes_struct *p) { - SAMR_Q_QUERY_GROUPINFO q_u; - SAMR_R_QUERY_GROUPINFO r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_query_groupinfo("", &q_u, data, 0)) { - DEBUG(0,("api_samr_query_groupinfo: unable to unmarshall SAMR_Q_QUERY_GROUPINFO.\n")); - return False; - } - - r_u.status = _samr_query_groupinfo(p, &q_u, &r_u); - - if (!samr_io_r_query_groupinfo("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_query_groupinfo: unable to marshall SAMR_R_QUERY_GROUPINFO.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_QUERYGROUPINFO); } /******************************************************************* -- cgit From cce7e93d842833e7f44254d80de59cc35e8f2af7 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 6 Feb 2008 16:06:04 +0100 Subject: Use pidl for _samr_GetGroupsForUser(). Guenther (This used to be commit 3a3feb376116b4ebc5be7b149c187b49bc6b390d) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index d5666e741d..e3ac2e42d5 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -349,28 +349,7 @@ static bool api_samr_query_userinfo(pipes_struct *p) static bool api_samr_query_usergroups(pipes_struct *p) { - SAMR_Q_QUERY_USERGROUPS q_u; - SAMR_R_QUERY_USERGROUPS r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if(!samr_io_q_query_usergroups("", &q_u, data, 0)) { - DEBUG(0,("api_samr_query_usergroups: unable to unmarshall SAMR_Q_QUERY_USERGROUPS.\n")); - return False; - } - - r_u.status = _samr_query_usergroups(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_query_usergroups("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_query_usergroups: unable to marshall SAMR_R_QUERY_USERGROUPS.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_GETGROUPSFORUSER); } /******************************************************************* -- cgit From f27a5561aa95051ef4ccffd661601c242281e450 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 7 Feb 2008 17:57:20 +0100 Subject: Use pidl for _samr_QueryDisplayInfo(). Guenther (This used to be commit b6d1283121359091683ea4d5e834a7139d891930) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index e3ac2e42d5..76cbb22f9f 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -200,28 +200,7 @@ static bool api_samr_enum_dom_aliases(pipes_struct *p) static bool api_samr_query_dispinfo(pipes_struct *p) { - SAMR_Q_QUERY_DISPINFO q_u; - SAMR_R_QUERY_DISPINFO r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if(!samr_io_q_query_dispinfo("", &q_u, data, 0)) { - DEBUG(0,("api_samr_query_dispinfo: unable to unmarshall SAMR_Q_QUERY_DISPINFO.\n")); - return False; - } - - r_u.status = _samr_query_dispinfo(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_query_dispinfo("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_query_dispinfo: unable to marshall SAMR_R_QUERY_DISPINFO.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_QUERYDISPLAYINFO); } /******************************************************************* -- cgit From d69a0b9f14b02c42d08c60dd50ba2da611a31d02 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 6 Feb 2008 21:29:17 +0100 Subject: Use pidl for _samr_LookupRids(). Guenther (This used to be commit fe3a02d44c4051ef84a182bdeb4130548d98db38) --- source3/rpc_server/srv_samr.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 76cbb22f9f..d88033056a 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -258,29 +258,7 @@ static bool api_samr_chgpasswd_user(pipes_struct *p) static bool api_samr_lookup_rids(pipes_struct *p) { - SAMR_Q_LOOKUP_RIDS q_u; - SAMR_R_LOOKUP_RIDS r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* grab the samr lookup names */ - if(!samr_io_q_lookup_rids("", &q_u, data, 0)) { - DEBUG(0,("api_samr_lookup_rids: unable to unmarshall SAMR_Q_LOOKUP_RIDS.\n")); - return False; - } - - r_u.status = _samr_lookup_rids(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_lookup_rids("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_lookup_rids: unable to marshall SAMR_R_LOOKUP_RIDS.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_LOOKUPRIDS); } /******************************************************************* -- cgit From fddbd6ec1cfda5d77c5c11d6f165b8ac5bff039e Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 8 Feb 2008 13:29:01 +0100 Subject: Use pidl for _samr_LookupNames(). Guenther (This used to be commit 325bf05592c4d2e7c760de64f8869a44f7315ce9) --- source3/rpc_server/srv_samr.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index d88033056a..2321d56b77 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -218,29 +218,7 @@ static bool api_samr_query_aliasinfo(pipes_struct *p) static bool api_samr_lookup_names(pipes_struct *p) { - SAMR_Q_LOOKUP_NAMES q_u; - SAMR_R_LOOKUP_NAMES r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* grab the samr lookup names */ - if(!samr_io_q_lookup_names("", &q_u, data, 0)) { - DEBUG(0,("api_samr_lookup_names: unable to unmarshall SAMR_Q_LOOKUP_NAMES.\n")); - return False; - } - - r_u.status = _samr_lookup_names(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_lookup_names("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_lookup_names: unable to marshall SAMR_R_LOOKUP_NAMES.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_LOOKUPNAMES); } /******************************************************************* -- cgit From 67536ed68fa184496c1a27dc3bd7ff6a2720f0ef Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Sat, 9 Feb 2008 01:55:49 +0100 Subject: Use pidl for _samr_EnumDomains(). Guenther (This used to be commit 2d5e2abc2715acaddd2d05c9d0b634a3595143f1) --- source3/rpc_server/srv_samr.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 2321d56b77..771c1e3341 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -365,27 +365,7 @@ static bool api_samr_lookup_domain(pipes_struct *p) static bool api_samr_enum_domains(pipes_struct *p) { - SAMR_Q_ENUM_DOMAINS q_u; - SAMR_R_ENUM_DOMAINS r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if(!samr_io_q_enum_domains("", &q_u, data, 0)) { - DEBUG(0,("api_samr_enum_domains: Unable to unmarshall SAMR_Q_ENUM_DOMAINS.\n")); - return False; - } - - r_u.status = _samr_enum_domains(p, &q_u, &r_u); - - if(!samr_io_r_enum_domains("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_enum_domains: Unable to marshall SAMR_R_ENUM_DOMAINS.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_ENUMDOMAINS); } /******************************************************************* -- cgit From 6bb6af65abfced64576d990b5f734d61130b3d77 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 11 Feb 2008 21:09:21 +0100 Subject: Use pidl for _samr_SetUserInfo and _samr_SetUserInfo2. Guenther (This used to be commit d148ffbc955aa62e42ab480e41d3a9b8c63117cd) --- source3/rpc_server/srv_samr.c | 51 ++----------------------------------------- 1 file changed, 2 insertions(+), 49 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 771c1e3341..8d626fced9 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -383,33 +383,7 @@ static bool api_samr_open_alias(pipes_struct *p) static bool api_samr_set_userinfo(pipes_struct *p) { - SAMR_Q_SET_USERINFO q_u; - SAMR_R_SET_USERINFO r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_set_userinfo("", &q_u, data, 0)) { - DEBUG(0,("api_samr_set_userinfo: Unable to unmarshall SAMR_Q_SET_USERINFO.\n")); - /* Fix for W2K SP2 */ - /* what is that status-code ? - gd */ - if (q_u.switch_value == 0x1a) { - setup_fault_pdu(p, NT_STATUS(DCERPC_FAULT_INVALID_TAG)); - return True; - } - return False; - } - - r_u.status = _samr_set_userinfo(p, &q_u, &r_u); - - if(!samr_io_r_set_userinfo("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_set_userinfo: Unable to marshall SAMR_R_SET_USERINFO.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_SETUSERINFO); } /******************************************************************* @@ -418,28 +392,7 @@ static bool api_samr_set_userinfo(pipes_struct *p) static bool api_samr_set_userinfo2(pipes_struct *p) { - SAMR_Q_SET_USERINFO2 q_u; - SAMR_R_SET_USERINFO2 r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_set_userinfo2("", &q_u, data, 0)) { - DEBUG(0,("api_samr_set_userinfo2: Unable to unmarshall SAMR_Q_SET_USERINFO2.\n")); - return False; - } - - r_u.status = _samr_set_userinfo2(p, &q_u, &r_u); - - if(!samr_io_r_set_userinfo2("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_set_userinfo2: Unable to marshall SAMR_R_SET_USERINFO2.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_SETUSERINFO2); } /******************************************************************* -- cgit From fff3f99b5ab53d489b0cccf1b14a2e0725272b5b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 12 Feb 2008 03:15:03 +0100 Subject: Use pidl for _samr_EnumDomainGroups() and _samr_EnumDomainAliases(). Guenther (This used to be commit 327cdb05af80a884517e7baf97300da0a635a451) --- source3/rpc_server/srv_samr.c | 48 ++----------------------------------------- 1 file changed, 2 insertions(+), 46 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 8d626fced9..af46469e06 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -138,29 +138,7 @@ static bool api_samr_enum_dom_users(pipes_struct *p) static bool api_samr_enum_dom_groups(pipes_struct *p) { - SAMR_Q_ENUM_DOM_GROUPS q_u; - SAMR_R_ENUM_DOM_GROUPS r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* grab the samr open */ - if(!samr_io_q_enum_dom_groups("", &q_u, data, 0)) { - DEBUG(0,("api_samr_enum_dom_groups: unable to unmarshall SAMR_Q_ENUM_DOM_GROUPS.\n")); - return False; - } - - r_u.status = _samr_enum_dom_groups(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_enum_dom_groups("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_enum_dom_groups: unable to marshall SAMR_R_ENUM_DOM_GROUPS.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_ENUMDOMAINGROUPS); } /******************************************************************* @@ -169,29 +147,7 @@ static bool api_samr_enum_dom_groups(pipes_struct *p) static bool api_samr_enum_dom_aliases(pipes_struct *p) { - SAMR_Q_ENUM_DOM_ALIASES q_u; - SAMR_R_ENUM_DOM_ALIASES r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* grab the samr open */ - if(!samr_io_q_enum_dom_aliases("", &q_u, data, 0)) { - DEBUG(0,("api_samr_enum_dom_aliases: unable to unmarshall SAMR_Q_ENUM_DOM_ALIASES.\n")); - return False; - } - - r_u.status = _samr_enum_dom_aliases(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_enum_dom_aliases("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_enum_dom_aliases: unable to marshall SAMR_R_ENUM_DOM_ALIASES.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_ENUMDOMAINALIASES); } /******************************************************************* -- cgit From 8b02303c904b9a5e342094325448d28cbe9ed5b4 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 12 Feb 2008 03:33:41 +0100 Subject: Use pidl for _samr_EnumDomainUsers(). Guenther (This used to be commit 54e884add2c5c836e78dfdd247dd93d754b70178) --- source3/rpc_server/srv_samr.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index af46469e06..d25ca3a178 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -107,29 +107,7 @@ static bool api_samr_query_sec_obj(pipes_struct *p) static bool api_samr_enum_dom_users(pipes_struct *p) { - SAMR_Q_ENUM_DOM_USERS q_u; - SAMR_R_ENUM_DOM_USERS r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* grab the samr open */ - if(!samr_io_q_enum_dom_users("", &q_u, data, 0)) { - DEBUG(0,("api_samr_enum_dom_users: unable to unmarshall SAMR_Q_ENUM_DOM_USERS.\n")); - return False; - } - - r_u.status = _samr_enum_dom_users(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_enum_dom_users("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_enum_dom_users: unable to marshall SAMR_R_ENUM_DOM_USERS.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_ENUMDOMAINUSERS); } /******************************************************************* -- cgit From 4974200f308229f8d7d1637ef9a33bcd921e138f Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 12 Feb 2008 12:58:47 +0100 Subject: Use pidl for _samr_QueryUserInfo. Guenther (This used to be commit 53dc913b2d01aeea2a7490c5ef1292e6c6eff5e7) --- source3/rpc_server/srv_samr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index d25ca3a178..f7cc7eec10 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -188,28 +188,7 @@ static bool api_samr_open_user(pipes_struct *p) static bool api_samr_query_userinfo(pipes_struct *p) { - SAMR_Q_QUERY_USERINFO q_u; - SAMR_R_QUERY_USERINFO r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if(!samr_io_q_query_userinfo("", &q_u, data, 0)){ - DEBUG(0,("api_samr_query_userinfo: unable to unmarshall SAMR_Q_QUERY_USERINFO.\n")); - return False; - } - - r_u.status = _samr_query_userinfo(p, &q_u, &r_u); - - /* store the response in the SMB stream */ - if(!samr_io_r_query_userinfo("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_query_userinfo: unable to marshall SAMR_R_QUERY_USERINFO.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_QUERYUSERINFO); } /******************************************************************* -- cgit From 80d20d8e54cd3bddf9011d0281a8d6bcdffc369c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 12 Feb 2008 14:26:10 +0100 Subject: w00t! SAMR server-side conversion to pidl is finished. Guenther (This used to be commit c6d9650930510982ef4e4759272dba573fc81067) --- source3/rpc_server/srv_samr.c | 565 ------------------------------------------ 1 file changed, 565 deletions(-) delete mode 100644 source3/rpc_server/srv_samr.c (limited to 'source3/rpc_server/srv_samr.c') diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c deleted file mode 100644 index f7cc7eec10..0000000000 --- a/source3/rpc_server/srv_samr.c +++ /dev/null @@ -1,565 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * RPC Pipe client / server routines - * Copyright (C) Andrew Tridgell 1992-1997, - * Copyright (C) Luke Kenneth Casson Leighton 1996-1997, - * Copyright (C) Paul Ashton 1997, - * Copyright (C) Marc Jacobsen 1999, - * Copyright (C) Jean François Micouleau 1998-2001, - * Copyright (C) Jim McDonough 2002-2003. - * - * Split into interface and implementation modules by, - * - * Copyright (C) Jeremy Allison 2001. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -/* - * This is the interface to the SAMR code. - */ - -#include "includes.h" - -#undef DBGC_CLASS -#define DBGC_CLASS DBGC_RPC_SRV - -/******************************************************************* - ********************************************************************/ - -static bool proxy_samr_call(pipes_struct *p, uint8 opnum) -{ - struct api_struct *fns; - int n_fns; - - samr_get_pipe_fns(&fns, &n_fns); - - if (opnum >= n_fns) { - return false; - } - - if (fns[opnum].opnum != opnum) { - smb_panic("SAMR function table not sorted"); - } - - return fns[opnum].fn(p); -} - -/******************************************************************* - api_samr_close_hnd - ********************************************************************/ - -static bool api_samr_close_hnd(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_CLOSE); -} - -/******************************************************************* - api_samr_open_domain - ********************************************************************/ - -static bool api_samr_open_domain(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_OPENDOMAIN); -} - -/******************************************************************* - api_samr_get_usrdom_pwinfo - ********************************************************************/ - -static bool api_samr_get_usrdom_pwinfo(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_GETUSERPWINFO); -} - -/******************************************************************* - api_samr_set_sec_obj - ********************************************************************/ - -static bool api_samr_set_sec_obj(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_SETSECURITY); -} - -/******************************************************************* - api_samr_query_sec_obj - ********************************************************************/ - -static bool api_samr_query_sec_obj(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_QUERYSECURITY); -} - -/******************************************************************* - api_samr_enum_dom_users - ********************************************************************/ - -static bool api_samr_enum_dom_users(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_ENUMDOMAINUSERS); -} - -/******************************************************************* - api_samr_enum_dom_groups - ********************************************************************/ - -static bool api_samr_enum_dom_groups(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_ENUMDOMAINGROUPS); -} - -/******************************************************************* - api_samr_enum_dom_aliases - ********************************************************************/ - -static bool api_samr_enum_dom_aliases(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_ENUMDOMAINALIASES); -} - -/******************************************************************* - api_samr_query_dispinfo - ********************************************************************/ - -static bool api_samr_query_dispinfo(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_QUERYDISPLAYINFO); -} - -/******************************************************************* - api_samr_query_aliasinfo - ********************************************************************/ - -static bool api_samr_query_aliasinfo(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_QUERYALIASINFO); -} - -/******************************************************************* - api_samr_lookup_names - ********************************************************************/ - -static bool api_samr_lookup_names(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_LOOKUPNAMES); -} - -/******************************************************************* - api_samr_chgpasswd_user - ********************************************************************/ - -static bool api_samr_chgpasswd_user(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_CHANGEPASSWORDUSER2); -} - -/******************************************************************* - api_samr_lookup_rids - ********************************************************************/ - -static bool api_samr_lookup_rids(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_LOOKUPRIDS); -} - -/******************************************************************* - api_samr_open_user - ********************************************************************/ - -static bool api_samr_open_user(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_OPENUSER); -} - -/******************************************************************* - api_samr_query_userinfo - ********************************************************************/ - -static bool api_samr_query_userinfo(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_QUERYUSERINFO); -} - -/******************************************************************* - api_samr_query_usergroups - ********************************************************************/ - -static bool api_samr_query_usergroups(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_GETGROUPSFORUSER); -} - -/******************************************************************* - api_samr_query_domain_info - ********************************************************************/ - -static bool api_samr_query_domain_info(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_QUERYDOMAININFO); -} - -/******************************************************************* - api_samr_create_user - ********************************************************************/ - -static bool api_samr_create_user(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_CREATEUSER2); -} - -/******************************************************************* - api_samr_connect_anon - ********************************************************************/ - -static bool api_samr_connect_anon(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_CONNECT); -} - -/******************************************************************* - api_samr_connect - ********************************************************************/ - -static bool api_samr_connect(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_CONNECT2); -} - -/******************************************************************* - api_samr_connect4 - ********************************************************************/ - -static bool api_samr_connect4(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_CONNECT4); -} - -/******************************************************************* - api_samr_chgpasswd_user3 - ********************************************************************/ - -static bool api_samr_chgpasswd_user3(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_CHANGEPASSWORDUSER3); -} - -/******************************************************************* - api_samr_connect5 - ********************************************************************/ - -static bool api_samr_connect5(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_CONNECT5); -} - -/********************************************************************** - api_samr_lookup_domain - **********************************************************************/ - -static bool api_samr_lookup_domain(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_LOOKUPDOMAIN); -} - -/********************************************************************** - api_samr_enum_domains - **********************************************************************/ - -static bool api_samr_enum_domains(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_ENUMDOMAINS); -} - -/******************************************************************* - api_samr_open_alias - ********************************************************************/ - -static bool api_samr_open_alias(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_OPENALIAS); -} - -/******************************************************************* - api_samr_set_userinfo - ********************************************************************/ - -static bool api_samr_set_userinfo(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_SETUSERINFO); -} - -/******************************************************************* - api_samr_set_userinfo2 - ********************************************************************/ - -static bool api_samr_set_userinfo2(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_SETUSERINFO2); -} - -/******************************************************************* - api_samr_query_useraliases - ********************************************************************/ - -static bool api_samr_query_useraliases(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_GETALIASMEMBERSHIP); -} - -/******************************************************************* - api_samr_query_aliasmem - ********************************************************************/ - -static bool api_samr_query_aliasmem(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_GETMEMBERSINALIAS); -} - -/******************************************************************* - api_samr_query_groupmem - ********************************************************************/ - -static bool api_samr_query_groupmem(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_QUERYGROUPMEMBER); -} - -/******************************************************************* - api_samr_add_aliasmem - ********************************************************************/ - -static bool api_samr_add_aliasmem(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_ADDALIASMEMBER); -} - -/******************************************************************* - api_samr_del_aliasmem - ********************************************************************/ - -static bool api_samr_del_aliasmem(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_DELETEALIASMEMBER); -} - -/******************************************************************* - api_samr_add_groupmem - ********************************************************************/ - -static bool api_samr_add_groupmem(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_ADDGROUPMEMBER); -} - -/******************************************************************* - api_samr_del_groupmem - ********************************************************************/ - -static bool api_samr_del_groupmem(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_DELETEGROUPMEMBER); -} - -/******************************************************************* - api_samr_delete_dom_user - ********************************************************************/ - -static bool api_samr_delete_dom_user(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_DELETEUSER); -} - -/******************************************************************* - api_samr_delete_dom_group - ********************************************************************/ - -static bool api_samr_delete_dom_group(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_DELETEDOMAINGROUP); -} - -/******************************************************************* - api_samr_delete_dom_alias - ********************************************************************/ - -static bool api_samr_delete_dom_alias(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_DELETEDOMALIAS); -} - -/******************************************************************* - api_samr_create_dom_group - ********************************************************************/ - -static bool api_samr_create_dom_group(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_CREATEDOMAINGROUP); -} - -/******************************************************************* - api_samr_create_dom_alias - ********************************************************************/ - -static bool api_samr_create_dom_alias(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_CREATEDOMALIAS); -} - -/******************************************************************* - api_samr_query_groupinfo - ********************************************************************/ - -static bool api_samr_query_groupinfo(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_QUERYGROUPINFO); -} - -/******************************************************************* - api_samr_set_groupinfo - ********************************************************************/ - -static bool api_samr_set_groupinfo(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_SETGROUPINFO); -} - -/******************************************************************* - api_samr_set_aliasinfo - ********************************************************************/ - -static bool api_samr_set_aliasinfo(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_SETALIASINFO); -} - -/******************************************************************* - api_samr_get_dom_pwinfo - ********************************************************************/ - -static bool api_samr_get_dom_pwinfo(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_GETDOMPWINFO); -} - -/******************************************************************* - api_samr_open_group - ********************************************************************/ - -static bool api_samr_open_group(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_OPENGROUP); -} - -/******************************************************************* - api_samr_remove_sid_foreign_domain - ********************************************************************/ - -static bool api_samr_remove_sid_foreign_domain(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN); -} - -/******************************************************************* - api_samr_query_dom_info2 - ********************************************************************/ - -static bool api_samr_query_domain_info2(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_QUERYDOMAININFO2); -} - -/******************************************************************* - api_samr_set_dom_info - ********************************************************************/ - -static bool api_samr_set_dom_info(pipes_struct *p) -{ - return proxy_samr_call(p, NDR_SAMR_SETDOMAININFO); -} - -/******************************************************************* - array of \PIPE\samr operations - ********************************************************************/ - -static struct api_struct api_samr_cmds [] = -{ - {"SAMR_CLOSE_HND" , SAMR_CLOSE_HND , api_samr_close_hnd }, - {"SAMR_CONNECT" , SAMR_CONNECT , api_samr_connect }, - {"SAMR_CONNECT_ANON" , SAMR_CONNECT_ANON , api_samr_connect_anon }, - {"SAMR_ENUM_DOMAINS" , SAMR_ENUM_DOMAINS , api_samr_enum_domains }, - {"SAMR_ENUM_DOM_USERS" , SAMR_ENUM_DOM_USERS , api_samr_enum_dom_users }, - - {"SAMR_ENUM_DOM_GROUPS" , SAMR_ENUM_DOM_GROUPS , api_samr_enum_dom_groups }, - {"SAMR_ENUM_DOM_ALIASES" , SAMR_ENUM_DOM_ALIASES , api_samr_enum_dom_aliases }, - {"SAMR_QUERY_USERALIASES" , SAMR_QUERY_USERALIASES, api_samr_query_useraliases}, - {"SAMR_QUERY_ALIASMEM" , SAMR_QUERY_ALIASMEM , api_samr_query_aliasmem }, - {"SAMR_QUERY_GROUPMEM" , SAMR_QUERY_GROUPMEM , api_samr_query_groupmem }, - {"SAMR_ADD_ALIASMEM" , SAMR_ADD_ALIASMEM , api_samr_add_aliasmem }, - {"SAMR_DEL_ALIASMEM" , SAMR_DEL_ALIASMEM , api_samr_del_aliasmem }, - {"SAMR_ADD_GROUPMEM" , SAMR_ADD_GROUPMEM , api_samr_add_groupmem }, - {"SAMR_DEL_GROUPMEM" , SAMR_DEL_GROUPMEM , api_samr_del_groupmem }, - - {"SAMR_DELETE_DOM_USER" , SAMR_DELETE_DOM_USER , api_samr_delete_dom_user }, - {"SAMR_DELETE_DOM_GROUP" , SAMR_DELETE_DOM_GROUP , api_samr_delete_dom_group }, - {"SAMR_DELETE_DOM_ALIAS" , SAMR_DELETE_DOM_ALIAS , api_samr_delete_dom_alias }, - {"SAMR_CREATE_DOM_GROUP" , SAMR_CREATE_DOM_GROUP , api_samr_create_dom_group }, - {"SAMR_CREATE_DOM_ALIAS" , SAMR_CREATE_DOM_ALIAS , api_samr_create_dom_alias }, - {"SAMR_LOOKUP_NAMES" , SAMR_LOOKUP_NAMES , api_samr_lookup_names }, - {"SAMR_OPEN_USER" , SAMR_OPEN_USER , api_samr_open_user }, - {"SAMR_QUERY_USERINFO" , SAMR_QUERY_USERINFO , api_samr_query_userinfo }, - {"SAMR_SET_USERINFO" , SAMR_SET_USERINFO , api_samr_set_userinfo }, - {"SAMR_SET_USERINFO2" , SAMR_SET_USERINFO2 , api_samr_set_userinfo2 }, - - {"SAMR_QUERY_DOMAIN_INFO" , SAMR_QUERY_DOMAIN_INFO, api_samr_query_domain_info}, - {"SAMR_QUERY_USERGROUPS" , SAMR_QUERY_USERGROUPS , api_samr_query_usergroups }, - {"SAMR_QUERY_DISPINFO" , SAMR_QUERY_DISPINFO , api_samr_query_dispinfo }, - {"SAMR_QUERY_DISPINFO3" , SAMR_QUERY_DISPINFO3 , api_samr_query_dispinfo }, - {"SAMR_QUERY_DISPINFO4" , SAMR_QUERY_DISPINFO4 , api_samr_query_dispinfo }, - - {"SAMR_QUERY_ALIASINFO" , SAMR_QUERY_ALIASINFO , api_samr_query_aliasinfo }, - {"SAMR_QUERY_GROUPINFO" , SAMR_QUERY_GROUPINFO , api_samr_query_groupinfo }, - {"SAMR_SET_GROUPINFO" , SAMR_SET_GROUPINFO , api_samr_set_groupinfo }, - {"SAMR_SET_ALIASINFO" , SAMR_SET_ALIASINFO , api_samr_set_aliasinfo }, - {"SAMR_CREATE_USER" , SAMR_CREATE_USER , api_samr_create_user }, - {"SAMR_LOOKUP_RIDS" , SAMR_LOOKUP_RIDS , api_samr_lookup_rids }, - {"SAMR_GET_DOM_PWINFO" , SAMR_GET_DOM_PWINFO , api_samr_get_dom_pwinfo }, - {"SAMR_CHGPASSWD_USER" , SAMR_CHGPASSWD_USER , api_samr_chgpasswd_user }, - {"SAMR_OPEN_ALIAS" , SAMR_OPEN_ALIAS , api_samr_open_alias }, - {"SAMR_OPEN_GROUP" , SAMR_OPEN_GROUP , api_samr_open_group }, - {"SAMR_OPEN_DOMAIN" , SAMR_OPEN_DOMAIN , api_samr_open_domain }, - {"SAMR_REMOVE_SID_FOREIGN_DOMAIN" , SAMR_REMOVE_SID_FOREIGN_DOMAIN , api_samr_remove_sid_foreign_domain }, - {"SAMR_LOOKUP_DOMAIN" , SAMR_LOOKUP_DOMAIN , api_samr_lookup_domain }, - - {"SAMR_QUERY_SEC_OBJECT" , SAMR_QUERY_SEC_OBJECT , api_samr_query_sec_obj }, - {"SAMR_SET_SEC_OBJECT" , SAMR_SET_SEC_OBJECT , api_samr_set_sec_obj }, - {"SAMR_GET_USRDOM_PWINFO" , SAMR_GET_USRDOM_PWINFO, api_samr_get_usrdom_pwinfo}, - {"SAMR_QUERY_DOMAIN_INFO2", SAMR_QUERY_DOMAIN_INFO2, api_samr_query_domain_info2}, - {"SAMR_SET_DOMAIN_INFO" , SAMR_SET_DOMAIN_INFO , api_samr_set_dom_info }, - {"SAMR_CONNECT4" , SAMR_CONNECT4 , api_samr_connect4 }, - {"SAMR_CHGPASSWD_USER3" , SAMR_CHGPASSWD_USER3 , api_samr_chgpasswd_user3 }, - {"SAMR_CONNECT5" , SAMR_CONNECT5 , api_samr_connect5 } -}; - -void samr2_get_pipe_fns( struct api_struct **fns, int *n_fns ) -{ - *fns = api_samr_cmds; - *n_fns = sizeof(api_samr_cmds) / sizeof(struct api_struct); -} - - -NTSTATUS rpc_samr2_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "samr", "lsass", api_samr_cmds, - sizeof(api_samr_cmds) / sizeof(struct api_struct)); -} -- cgit