summaryrefslogtreecommitdiff
path: root/source3/lsarpcd/srv_lsa.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-11-18 00:26:11 +0000
committerLuke Leighton <lkcl@samba.org>1999-11-18 00:26:11 +0000
commitccc8585567804d6a7e6f684a97d58871e2fd9f8a (patch)
tree00bc58c6cd0870a53fc5fb98648054c3ad9013e4 /source3/lsarpcd/srv_lsa.c
parentcc8df5ce4955fc721e11ff08de052554894d963a (diff)
downloadsamba-ccc8585567804d6a7e6f684a97d58871e2fd9f8a.tar.gz
samba-ccc8585567804d6a7e6f684a97d58871e2fd9f8a.tar.bz2
samba-ccc8585567804d6a7e6f684a97d58871e2fd9f8a.zip
added regqueryval command (experimental) to get reg_io_q_info() and
reg_io_r_info() working properly. previously they weren't well understood (well, they were the first of the registry functions i did, back in december 97, ok??? :-) set ntversion to 0x1 in SAMQUERY, so that we reply same as NT4 srv. (This used to be commit 98ddeaf442cb30972cb281bf0489a6e5f7eb2883)
Diffstat (limited to 'source3/lsarpcd/srv_lsa.c')
-rw-r--r--source3/lsarpcd/srv_lsa.c52
1 files changed, 38 insertions, 14 deletions
diff --git a/source3/lsarpcd/srv_lsa.c b/source3/lsarpcd/srv_lsa.c
index 36259477da..7bc5841cfc 100644
--- a/source3/lsarpcd/srv_lsa.c
+++ b/source3/lsarpcd/srv_lsa.c
@@ -39,18 +39,19 @@ lsa_reply_open_policy2
***************************************************************************/
static void lsa_reply_open_policy2(prs_struct *rdata)
{
- int i;
LSA_R_OPEN_POL2 r_o;
ZERO_STRUCT(r_o);
/* set up the LSA QUERY INFO response */
- for (i = 4; i < POL_HND_SIZE; i++)
+ r_o.status = 0x0;
+
+ /* get a (unique) handle. open a policy on it. */
+ if (!open_lsa_policy_hnd(&r_o.pol))
{
- r_o.pol.data[i] = i;
+ r_o.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
- r_o.status = 0x0;
/* store the response in the SMB stream */
lsa_io_r_open_pol2("", &r_o, rdata, 0);
@@ -61,18 +62,19 @@ lsa_reply_open_policy
***************************************************************************/
static void lsa_reply_open_policy(prs_struct *rdata)
{
- int i;
LSA_R_OPEN_POL r_o;
ZERO_STRUCT(r_o);
/* set up the LSA QUERY INFO response */
- for (i = 4; i < POL_HND_SIZE; i++)
+ r_o.status = 0x0;
+
+ /* get a (unique) handle. open a policy on it. */
+ if (!open_lsa_policy_hnd(&r_o.pol))
{
- r_o.pol.data[i] = i;
+ r_o.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
- r_o.status = 0x0;
/* store the response in the SMB stream */
lsa_io_r_open_pol("", &r_o, rdata, 0);
@@ -128,15 +130,22 @@ static void lsa_reply_query_info(LSA_Q_QUERY_INFO *q_q, prs_struct *rdata,
ZERO_STRUCT(r_q);
- /* set up the LSA QUERY INFO response */
-
- r_q.undoc_buffer = 0x22000000; /* bizarre */
- r_q.info_class = q_q->info_class;
+ /* get a (unique) handle. open a policy on it. */
+ if (r_q.status == 0x0 && !open_lsa_policy_hnd(&q_q->pol))
+ {
+ r_q.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
+ }
+ else
+ {
+ /* set up the LSA QUERY INFO response */
- make_dom_query(&r_q.dom.id5, dom_name, dom_sid);
+ r_q.undoc_buffer = 0x1; /* bizarre */
+ r_q.info_class = q_q->info_class;
- r_q.status = 0x0;
+ make_dom_query(&r_q.dom.id5, dom_name, dom_sid);
+ r_q.status = 0x0;
+ }
/* store the response in the SMB stream */
lsa_io_r_query("", &r_q, rdata, 0);
}
@@ -572,9 +581,24 @@ static void api_lsa_close( pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
LSA_R_CLOSE r_c;
+ LSA_Q_CLOSE q_c;
+
+ lsa_io_q_close("", &q_c, data, 0);
ZERO_STRUCT(r_c);
+ r_c.status = 0x0;
+
+ /* find the connection policy handle. */
+ if (r_c.status == 0x0 && (find_lsa_policy_by_hnd(&(q_c.pol)) == -1))
+ {
+ r_c.status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
+ }
+ if (r_c.status == 0x0)
+ {
+ close_lsa_policy_hnd(&(q_c.pol));
+ }
+
/* store the response in the SMB stream */
lsa_io_r_close("", &r_c, rdata, 0);
}