summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-05-15 20:53:08 +0000
committerJeremy Allison <jra@samba.org>2000-05-15 20:53:08 +0000
commitad9a3a16e000e25693508e0b2eac280f7593d095 (patch)
tree4b9f0fb76c131b34d28c62fb44b8c80cb150f7e2 /source3/rpc_server
parent4fb2e2c72f25a1204bf764504c370d746d12a162 (diff)
downloadsamba-ad9a3a16e000e25693508e0b2eac280f7593d095.tar.gz
samba-ad9a3a16e000e25693508e0b2eac280f7593d095.tar.bz2
samba-ad9a3a16e000e25693508e0b2eac280f7593d095.zip
Added Shirish's reg changes to HEAD. Sync up with 2.2.0 backport.
Also added prs_xx error return checks to new code in rpc_parse/parse_reg.c Jeremy. (This used to be commit a148cb996297ed34342660f82ef0e66773d40500)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_reg.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/source3/rpc_server/srv_reg.c b/source3/rpc_server/srv_reg.c
index 6a8d803c2e..cba24d7dfb 100644
--- a/source3/rpc_server/srv_reg.c
+++ b/source3/rpc_server/srv_reg.c
@@ -23,6 +23,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+
#include "includes.h"
extern int DEBUGLEVEL;
@@ -59,7 +60,7 @@ static void reg_reply_close(REG_Q_CLOSE *q_r,
/*******************************************************************
api_reg_close
********************************************************************/
-static BOOL api_reg_close(prs_struct *data, prs_struct *rdata)
+static BOOL api_reg_close(prs_struct *data, prs_struct *rdata )
{
REG_Q_CLOSE q_r;
@@ -99,7 +100,7 @@ static void reg_reply_open(REG_Q_OPEN_HKLM *q_r,
/*******************************************************************
api_reg_open
********************************************************************/
-static BOOL api_reg_open(prs_struct *data, prs_struct *rdata)
+static BOOL api_reg_open(prs_struct *data, prs_struct *rdata )
{
REG_Q_OPEN_HKLM q_u;
@@ -164,7 +165,7 @@ static void reg_reply_open_entry(REG_Q_OPEN_ENTRY *q_u,
/*******************************************************************
api_reg_open_entry
********************************************************************/
-static BOOL api_reg_open_entry(prs_struct *data, prs_struct *rdata)
+static BOOL api_reg_open_entry(prs_struct *data, prs_struct *rdata )
{
REG_Q_OPEN_ENTRY q_u;
@@ -185,6 +186,11 @@ static void reg_reply_info(REG_Q_INFO *q_u,
prs_struct *rdata)
{
uint32 status = 0;
+ fstring key = "ServerNT"; /* always a non-PDC */
+ uint32 type=0x1; /* key type: REG_SZ */
+
+ UNISTR2 uni_key;
+ BUFFER2 buf;
REG_R_INFO r_u;
@@ -195,14 +201,13 @@ static void reg_reply_info(REG_Q_INFO *q_u,
status = 0xC000000 | NT_STATUS_INVALID_HANDLE;
}
- if (status == 0)
- {
- }
-
/* This makes the server look like a member server to clients */
/* which tells clients that we have our own local user and */
/* group databases and helps with ACL support. */
- init_reg_r_info(&r_u, 1, "ServerNT", 0x12, 0x12, status);
+ init_unistr2(&uni_key, key, strlen(key)+1);
+ init_buffer2(&buf, (uint8*) uni_key.buffer, uni_key.uni_str_len*2);
+
+ init_reg_r_info(q_u->ptr_buf, &r_u, &buf, type, status);
/* store the response in the SMB stream */
reg_io_r_info("", &r_u, rdata, 0);
@@ -213,7 +218,7 @@ static void reg_reply_info(REG_Q_INFO *q_u,
/*******************************************************************
api_reg_info
********************************************************************/
-static BOOL api_reg_info(prs_struct *data, prs_struct *rdata)
+static BOOL api_reg_info(prs_struct *data, prs_struct *rdata )
{
REG_Q_INFO q_u;
@@ -246,5 +251,4 @@ BOOL api_reg_rpc(pipes_struct *p, prs_struct *data)
{
return api_rpcTNP(p, "api_reg_rpc", api_reg_cmds, data);
}
-
#undef OLD_NTDOMAIN