diff options
author | Gerald Carter <jerry@samba.org> | 2002-07-26 22:40:06 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2002-07-26 22:40:06 +0000 |
commit | a23e96316ebf5086a27365d4a9fb63b0e4533f6f (patch) | |
tree | 551cc677dcedd058402fab2c8eab77980edc6cb9 /source3/rpc_server | |
parent | dbedccc75a0b651c803cb3e4ced375e02377112c (diff) | |
download | samba-a23e96316ebf5086a27365d4a9fb63b0e4533f6f.tar.gz samba-a23e96316ebf5086a27365d4a9fb63b0e4533f6f.tar.bz2 samba-a23e96316ebf5086a27365d4a9fb63b0e4533f6f.zip |
3 things:
* normalize all registry key strings before storing or looking
up paths in the registry tdb
* return the current buffer size for REG_INFO even when not returning
actual data
* fix a segfault report by metze on #samba-technical so that the
user/group object picker works again (was the "ProductType" key
lookup that was failing).
(This used to be commit 5640e6cdb213502d95fff33e06eaeed5ce3aeb76)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_reg_nt.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_reg_nt.c b/source3/rpc_server/srv_reg_nt.c index 2154b5a38a..7ebf940588 100644 --- a/source3/rpc_server/srv_reg_nt.c +++ b/source3/rpc_server/srv_reg_nt.c @@ -29,6 +29,11 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV +#define REGSTR_PRODUCTTYPE "ProductType" +#define REG_PT_WINNT "WinNT" +#define REG_PT_LANMANNT "LanmanNT" +#define REG_PT_SERVERNT "ServerNT" + #define OUR_HANDLE(hnd) (((hnd)==NULL)?"NULL":(IVAL((hnd)->data5,4)==(uint32)sys_getpid()?"OURS":"OTHER")), \ ((unsigned int)IVAL((hnd)->data5,4)),((unsigned int)sys_getpid()) @@ -367,7 +372,7 @@ NTSTATUS _reg_info(pipes_struct *p, REG_Q_INFO *q_u, REG_R_INFO *r_u) goto out; } - if ( strequal(name, "ProductType") ) { + if ( strequal(name, REGSTR_PRODUCTTYPE) ) { /* 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. */ @@ -375,17 +380,17 @@ NTSTATUS _reg_info(pipes_struct *p, REG_Q_INFO *q_u, REG_R_INFO *r_u) switch (lp_server_role()) { case ROLE_DOMAIN_PDC: case ROLE_DOMAIN_BDC: - regval_ctr_addvalue( ®vals, "ProductType", REG_SZ, "LanmanNT", strlen("LanmanNT")+1 ); + regval_ctr_addvalue( ®vals, REGSTR_PRODUCTTYPE, REG_SZ, REG_PT_LANMANNT, strlen(REG_PT_LANMANNT)+1 ); break; case ROLE_STANDALONE: - regval_ctr_addvalue( ®vals, "ProductType", REG_SZ, "ServerNT", strlen("ServerNT")+1 ); + regval_ctr_addvalue( ®vals, REGSTR_PRODUCTTYPE, REG_SZ, REG_PT_SERVERNT, strlen(REG_PT_SERVERNT)+1 ); break; case ROLE_DOMAIN_MEMBER: - regval_ctr_addvalue( ®vals, "ProductType", REG_SZ, "WinNT", strlen("WinNT")+1 ); + regval_ctr_addvalue( ®vals, REGSTR_PRODUCTTYPE, REG_SZ, REG_PT_WINNT, strlen(REG_PT_WINNT)+1 ); break; } - val = regval_ctr_specific_value( ®vals, 0 ); + val = dup_registry_value( regval_ctr_specific_value( ®vals, 0 ) ); status = NT_STATUS_OK; |