1998-03-11 21:11:04 +00:00
/*
2002-01-30 06:08:46 +00:00
* Unix SMB / CIFS implementation .
1998-03-11 21:11:04 +00:00
* RPC Pipe client / server routines
* Copyright ( C ) Andrew Tridgell 1992 - 1997 ,
* Copyright ( C ) Luke Kenneth Casson Leighton 1996 - 1997 ,
2002-08-17 15:34:15 +00:00
* Copyright ( C ) Paul Ashton 1997 ,
* Copyright ( C ) Jeremy Allison 2001 ,
2003-08-01 15:30:44 +00:00
* Copyright ( C ) Jim McDonough < jmcd @ us . ibm . com > 2002 - 2003.
2005-05-31 13:46:45 +00:00
* Copyright ( C ) Gerald ( Jerry ) Carter 2005
1998-05-14 01:30:40 +00:00
*
1998-03-11 21:11:04 +00:00
* 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
2007-07-09 19:25:36 +00:00
* the Free Software Foundation ; either version 3 of the License , or
1998-03-11 21:11:04 +00:00
* ( 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
2007-07-10 05:23:25 +00:00
* along with this program ; if not , see < http : //www.gnu.org/licenses/>.
1998-03-11 21:11:04 +00:00
*/
2001-02-26 19:45:00 +00:00
/* This is the interface to the lsa server code. */
1998-03-11 21:11:04 +00:00
# include "includes.h"
2002-07-15 10:35:28 +00:00
# undef DBGC_CLASS
# define DBGC_CLASS DBGC_RPC_SRV
2006-10-10 08:39:11 +00:00
static BOOL proxy_lsa_call ( pipes_struct * p , uint8 opnum )
{
struct api_struct * fns ;
int n_fns ;
lsarpc_get_pipe_fns ( & fns , & n_fns ) ;
if ( opnum > = n_fns )
return False ;
if ( fns [ opnum ] . opnum ! = opnum ) {
2007-06-15 21:58:49 +00:00
smb_panic ( " LSA function table not sorted " ) ;
2006-10-10 08:39:11 +00:00
}
return fns [ opnum ] . fn ( p ) ;
}
1998-10-15 05:47:29 +00:00
/***************************************************************************
1999-12-13 13:27:58 +00:00
api_lsa_open_policy2
1998-10-15 05:47:29 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 13:27:58 +00:00
2000-06-16 08:11:32 +00:00
static BOOL api_lsa_open_policy2 ( pipes_struct * p )
1998-10-15 05:47:29 +00:00
{
2001-02-26 19:45:00 +00:00
LSA_Q_OPEN_POL2 q_u ;
LSA_R_OPEN_POL2 r_u ;
2000-06-16 08:11:32 +00:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2001-02-26 19:45:00 +00:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-10-15 05:47:29 +00:00
/* grab the server, object attributes and desired access flag...*/
2001-02-26 19:45:00 +00:00
if ( ! lsa_io_q_open_pol2 ( " " , & q_u , data , 0 ) ) {
1999-12-13 13:27:58 +00:00
DEBUG ( 0 , ( " api_lsa_open_policy2: unable to unmarshall LSA_Q_OPEN_POL2. \n " ) ) ;
return False ;
}
1998-10-15 05:47:29 +00:00
2001-02-26 19:45:00 +00:00
r_u . status = _lsa_open_policy2 ( p , & q_u , & r_u ) ;
1998-10-15 05:47:29 +00:00
2001-02-26 19:45:00 +00:00
/* store the response in the SMB stream */
if ( ! lsa_io_r_open_pol2 ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_open_policy2: unable to marshall LSA_R_OPEN_POL2. \n " ) ) ;
1999-12-13 13:27:58 +00:00
return False ;
2001-02-26 19:45:00 +00:00
}
1999-12-13 13:27:58 +00:00
return True ;
1998-10-15 05:47:29 +00:00
}
1998-03-11 21:11:04 +00:00
/***************************************************************************
api_lsa_open_policy
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-26 19:45:00 +00:00
2000-06-16 08:11:32 +00:00
static BOOL api_lsa_open_policy ( pipes_struct * p )
1998-03-11 21:11:04 +00:00
{
2001-02-26 19:45:00 +00:00
LSA_Q_OPEN_POL q_u ;
LSA_R_OPEN_POL r_u ;
2000-06-16 08:11:32 +00:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2001-02-26 19:45:00 +00:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-08-21 09:44:30 +00:00
1998-03-11 21:11:04 +00:00
/* grab the server, object attributes and desired access flag...*/
2001-02-26 19:45:00 +00:00
if ( ! lsa_io_q_open_pol ( " " , & q_u , data , 0 ) ) {
1999-12-13 13:27:58 +00:00
DEBUG ( 0 , ( " api_lsa_open_policy: unable to unmarshall LSA_Q_OPEN_POL. \n " ) ) ;
return False ;
}
1998-03-11 21:11:04 +00:00
2001-02-26 19:45:00 +00:00
r_u . status = _lsa_open_policy ( p , & q_u , & r_u ) ;
1998-03-11 21:11:04 +00:00
2001-02-26 19:45:00 +00:00
/* store the response in the SMB stream */
if ( ! lsa_io_r_open_pol ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_open_policy: unable to marshall LSA_R_OPEN_POL. \n " ) ) ;
1999-12-13 13:27:58 +00:00
return False ;
2001-02-26 19:45:00 +00:00
}
1999-12-13 13:27:58 +00:00
return True ;
1998-03-11 21:11:04 +00:00
}
/***************************************************************************
2001-02-26 19:45:00 +00:00
api_lsa_enum_trust_dom
1998-03-11 21:11:04 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-26 19:45:00 +00:00
2000-06-16 08:11:32 +00:00
static BOOL api_lsa_enum_trust_dom ( pipes_struct * p )
1998-03-11 21:11:04 +00:00
{
2001-02-26 19:45:00 +00:00
LSA_Q_ENUM_TRUST_DOM q_u ;
LSA_R_ENUM_TRUST_DOM r_u ;
2000-06-16 08:11:32 +00:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1998-03-11 21:11:04 +00:00
2001-02-26 19:45:00 +00:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-08-21 09:44:30 +00:00
1998-03-11 21:11:04 +00:00
/* grab the enum trust domain context etc. */
2001-02-26 19:45:00 +00:00
if ( ! lsa_io_q_enum_trust_dom ( " " , & q_u , data , 0 ) )
2000-05-04 21:57:28 +00:00
return False ;
1998-03-11 21:11:04 +00:00
2002-07-15 10:35:28 +00:00
/* get required trusted domains information */
2001-02-26 19:45:00 +00:00
r_u . status = _lsa_enum_trust_dom ( p , & q_u , & r_u ) ;
2002-07-15 10:35:28 +00:00
/* prepare the response */
2001-02-26 19:45:00 +00:00
if ( ! lsa_io_r_enum_trust_dom ( " " , & r_u , rdata , 0 ) )
return False ;
1999-12-13 13:27:58 +00:00
return True ;
1998-03-11 21:11:04 +00:00
}
/***************************************************************************
2001-02-26 19:45:00 +00:00
api_lsa_query_info
1998-03-11 21:11:04 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-26 19:45:00 +00:00
2000-06-16 08:11:32 +00:00
static BOOL api_lsa_query_info ( pipes_struct * p )
1998-03-11 21:11:04 +00:00
{
2001-02-26 19:45:00 +00:00
LSA_Q_QUERY_INFO q_u ;
LSA_R_QUERY_INFO r_u ;
2000-06-16 08:11:32 +00:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2000-05-04 21:57:28 +00:00
2001-02-26 19:45:00 +00:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-08-21 09:44:30 +00:00
1998-03-11 21:11:04 +00:00
/* grab the info class and policy handle */
2001-02-26 19:45:00 +00:00
if ( ! lsa_io_q_query ( " " , & q_u , data , 0 ) ) {
1999-12-13 13:27:58 +00:00
DEBUG ( 0 , ( " api_lsa_query_info: failed to unmarshall LSA_Q_QUERY_INFO. \n " ) ) ;
return False ;
}
2001-02-26 19:45:00 +00:00
r_u . status = _lsa_query_info ( p , & q_u , & r_u ) ;
1998-03-11 21:11:04 +00:00
2001-02-26 19:45:00 +00:00
/* store the response in the SMB stream */
if ( ! lsa_io_r_query ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_query_info: failed to marshall LSA_R_QUERY_INFO. \n " ) ) ;
1999-12-13 13:27:58 +00:00
return False ;
2001-02-26 19:45:00 +00:00
}
1999-12-13 13:27:58 +00:00
return True ;
1998-03-11 21:11:04 +00:00
}
/***************************************************************************
1999-12-13 13:27:58 +00:00
api_lsa_lookup_sids
1998-03-11 21:11:04 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 13:27:58 +00:00
2000-06-16 08:11:32 +00:00
static BOOL api_lsa_lookup_sids ( pipes_struct * p )
1998-03-11 21:11:04 +00:00
{
2001-02-26 19:45:00 +00:00
LSA_Q_LOOKUP_SIDS q_u ;
LSA_R_LOOKUP_SIDS r_u ;
2000-06-16 08:11:32 +00:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2001-02-26 19:45:00 +00:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-08-21 09:44:30 +00:00
1998-03-11 21:11:04 +00:00
/* grab the info class and policy handle */
2001-02-26 19:45:00 +00:00
if ( ! lsa_io_q_lookup_sids ( " " , & q_u , data , 0 ) ) {
1999-12-13 13:27:58 +00:00
DEBUG ( 0 , ( " api_lsa_lookup_sids: failed to unmarshall LSA_Q_LOOKUP_SIDS. \n " ) ) ;
2001-02-26 19:45:00 +00:00
return False ;
2000-12-12 02:45:11 +00:00
}
1999-12-13 13:27:58 +00:00
2001-02-26 19:45:00 +00:00
r_u . status = _lsa_lookup_sids ( p , & q_u , & r_u ) ;
2001-02-26 08:10:51 +00:00
2001-02-26 19:45:00 +00:00
if ( ! lsa_io_r_lookup_sids ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_sids: Failed to marshall LSA_R_LOOKUP_SIDS. \n " ) ) ;
return False ;
}
2001-02-26 08:10:51 +00:00
2001-02-26 19:45:00 +00:00
return True ;
2001-02-26 08:10:51 +00:00
}
1998-03-11 21:11:04 +00:00
/***************************************************************************
1999-12-13 13:27:58 +00:00
api_lsa_lookup_names
1998-03-11 21:11:04 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 13:27:58 +00:00
2000-06-16 08:11:32 +00:00
static BOOL api_lsa_lookup_names ( pipes_struct * p )
1998-03-11 21:11:04 +00:00
{
2001-02-26 08:10:51 +00:00
LSA_Q_LOOKUP_NAMES q_u ;
LSA_R_LOOKUP_NAMES r_u ;
2000-06-16 08:11:32 +00:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2001-02-26 08:10:51 +00:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-08-21 09:44:30 +00:00
1998-03-11 21:11:04 +00:00
/* grab the info class and policy handle */
2001-02-26 08:10:51 +00:00
if ( ! lsa_io_q_lookup_names ( " " , & q_u , data , 0 ) ) {
1999-12-13 13:27:58 +00:00
DEBUG ( 0 , ( " api_lsa_lookup_names: failed to unmarshall LSA_Q_LOOKUP_NAMES. \n " ) ) ;
return False ;
}
1998-03-11 21:11:04 +00:00
2001-02-26 08:10:51 +00:00
r_u . status = _lsa_lookup_names ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_lookup_names ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_names: Failed to marshall LSA_R_LOOKUP_NAMES. \n " ) ) ;
return False ;
}
return True ;
1998-03-11 21:11:04 +00:00
}
2001-02-26 08:10:51 +00:00
/***************************************************************************
api_lsa_close .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-06-16 08:11:32 +00:00
static BOOL api_lsa_close ( pipes_struct * p )
1998-03-11 21:11:04 +00:00
{
2006-10-10 08:39:11 +00:00
return proxy_lsa_call ( p , DCERPC_LSA_CLOSE ) ;
1998-03-11 21:11:04 +00:00
}
2001-02-26 08:10:51 +00:00
/***************************************************************************
api_lsa_open_secret .
1998-03-11 21:11:04 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-02-26 08:10:51 +00:00
2000-06-16 08:11:32 +00:00
static BOOL api_lsa_open_secret ( pipes_struct * p )
1998-03-11 21:11:04 +00:00
{
2006-10-10 08:39:11 +00:00
return proxy_lsa_call ( p , DCERPC_LSA_OPENSECRET ) ;
1998-03-11 21:11:04 +00:00
}
2001-07-09 18:32:54 +00:00
/***************************************************************************
api_lsa_open_secret .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_enum_privs ( pipes_struct * p )
{
LSA_Q_ENUM_PRIVS q_u ;
LSA_R_ENUM_PRIVS 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 ( ! lsa_io_q_enum_privs ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_enum_privs: failed to unmarshall LSA_Q_ENUM_PRIVS. \n " ) ) ;
return False ;
}
r_u . status = _lsa_enum_privs ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_enum_privs ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_enum_privs: Failed to marshall LSA_R_ENUM_PRIVS. \n " ) ) ;
return False ;
}
return True ;
}
/***************************************************************************
api_lsa_open_secret .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_priv_get_dispname ( pipes_struct * p )
{
LSA_Q_PRIV_GET_DISPNAME q_u ;
LSA_R_PRIV_GET_DISPNAME 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 ( ! lsa_io_q_priv_get_dispname ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_priv_get_dispname: failed to unmarshall LSA_Q_PRIV_GET_DISPNAME. \n " ) ) ;
return False ;
}
r_u . status = _lsa_priv_get_dispname ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_priv_get_dispname ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_priv_get_dispname: Failed to marshall LSA_R_PRIV_GET_DISPNAME. \n " ) ) ;
return False ;
}
return True ;
}
/***************************************************************************
api_lsa_open_secret .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_enum_accounts ( pipes_struct * p )
{
LSA_Q_ENUM_ACCOUNTS q_u ;
LSA_R_ENUM_ACCOUNTS 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 ( ! lsa_io_q_enum_accounts ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_enum_accounts: failed to unmarshall LSA_Q_ENUM_ACCOUNTS. \n " ) ) ;
return False ;
}
r_u . status = _lsa_enum_accounts ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_enum_accounts ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_enum_accounts: Failed to marshall LSA_R_ENUM_ACCOUNTS. \n " ) ) ;
return False ;
}
return True ;
}
2001-06-29 23:12:55 +00:00
/***************************************************************************
api_lsa_UNK_GET_CONNUSER
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_unk_get_connuser ( pipes_struct * p )
{
LSA_Q_UNK_GET_CONNUSER q_u ;
LSA_R_UNK_GET_CONNUSER 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 ( ! lsa_io_q_unk_get_connuser ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_unk_get_connuser: failed to unmarshall LSA_Q_UNK_GET_CONNUSER. \n " ) ) ;
return False ;
}
r_u . status = _lsa_unk_get_connuser ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_unk_get_connuser ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_unk_get_connuser: Failed to marshall LSA_R_UNK_GET_CONNUSER. \n " ) ) ;
return False ;
}
return True ;
}
2005-01-13 18:20:37 +00:00
/***************************************************************************
api_lsa_create_user
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_create_account ( pipes_struct * p )
{
LSA_Q_CREATEACCOUNT q_u ;
LSA_R_CREATEACCOUNT 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 ( ! lsa_io_q_create_account ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_create_account: failed to unmarshall LSA_Q_CREATEACCOUNT. \n " ) ) ;
return False ;
}
r_u . status = _lsa_create_account ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_create_account ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_create_account: Failed to marshall LSA_R_CREATEACCOUNT. \n " ) ) ;
return False ;
}
return True ;
}
2001-07-09 18:32:54 +00:00
/***************************************************************************
api_lsa_open_user
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_open_account ( pipes_struct * p )
{
LSA_Q_OPENACCOUNT q_u ;
LSA_R_OPENACCOUNT 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 ( ! lsa_io_q_open_account ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_open_account: failed to unmarshall LSA_Q_OPENACCOUNT. \n " ) ) ;
return False ;
}
r_u . status = _lsa_open_account ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_open_account ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_open_account: Failed to marshall LSA_R_OPENACCOUNT. \n " ) ) ;
return False ;
}
return True ;
}
/***************************************************************************
api_lsa_get_privs
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_enum_privsaccount ( pipes_struct * p )
{
LSA_Q_ENUMPRIVSACCOUNT q_u ;
LSA_R_ENUMPRIVSACCOUNT 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 ( ! lsa_io_q_enum_privsaccount ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_enum_privsaccount: failed to unmarshall LSA_Q_ENUMPRIVSACCOUNT. \n " ) ) ;
return False ;
}
2003-10-06 01:38:46 +00:00
r_u . status = _lsa_enum_privsaccount ( p , rdata , & q_u , & r_u ) ;
2001-07-09 18:32:54 +00:00
/* store the response in the SMB stream */
if ( ! lsa_io_r_enum_privsaccount ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_enum_privsaccount: Failed to marshall LSA_R_ENUMPRIVSACCOUNT. \n " ) ) ;
return False ;
}
return True ;
}
/***************************************************************************
api_lsa_getsystemaccount
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_getsystemaccount ( pipes_struct * p )
{
LSA_Q_GETSYSTEMACCOUNT q_u ;
LSA_R_GETSYSTEMACCOUNT 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 ( ! lsa_io_q_getsystemaccount ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_getsystemaccount: failed to unmarshall LSA_Q_GETSYSTEMACCOUNT. \n " ) ) ;
return False ;
}
r_u . status = _lsa_getsystemaccount ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_getsystemaccount ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_getsystemaccount: Failed to marshall LSA_R_GETSYSTEMACCOUNT. \n " ) ) ;
return False ;
}
return True ;
}
2001-11-29 16:05:05 +00:00
/***************************************************************************
api_lsa_setsystemaccount
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_setsystemaccount ( pipes_struct * p )
{
LSA_Q_SETSYSTEMACCOUNT q_u ;
LSA_R_SETSYSTEMACCOUNT 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 ( ! lsa_io_q_setsystemaccount ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_setsystemaccount: failed to unmarshall LSA_Q_SETSYSTEMACCOUNT. \n " ) ) ;
return False ;
}
r_u . status = _lsa_setsystemaccount ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_setsystemaccount ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_setsystemaccount: Failed to marshall LSA_R_SETSYSTEMACCOUNT. \n " ) ) ;
return False ;
}
return True ;
}
/***************************************************************************
api_lsa_addprivs
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_addprivs ( pipes_struct * p )
{
LSA_Q_ADDPRIVS q_u ;
LSA_R_ADDPRIVS 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 ( ! lsa_io_q_addprivs ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_addprivs: failed to unmarshall LSA_Q_ADDPRIVS. \n " ) ) ;
return False ;
}
r_u . status = _lsa_addprivs ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_addprivs ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_addprivs: Failed to marshall LSA_R_ADDPRIVS. \n " ) ) ;
return False ;
}
return True ;
}
/***************************************************************************
api_lsa_removeprivs
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_removeprivs ( pipes_struct * p )
{
LSA_Q_REMOVEPRIVS q_u ;
LSA_R_REMOVEPRIVS 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 ( ! lsa_io_q_removeprivs ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_removeprivs: failed to unmarshall LSA_Q_REMOVEPRIVS. \n " ) ) ;
return False ;
}
r_u . status = _lsa_removeprivs ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_removeprivs ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_removeprivs: Failed to marshall LSA_R_REMOVEPRIVS. \n " ) ) ;
return False ;
}
return True ;
}
2001-12-14 17:31:48 +00:00
/***************************************************************************
api_lsa_query_secobj
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_query_secobj ( pipes_struct * p )
{
LSA_Q_QUERY_SEC_OBJ q_u ;
LSA_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 ( ! lsa_io_q_query_sec_obj ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_query_secobj: failed to unmarshall LSA_Q_QUERY_SEC_OBJ. \n " ) ) ;
return False ;
}
r_u . status = _lsa_query_secobj ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_query_sec_obj ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_query_secobj: Failed to marshall LSA_R_QUERY_SEC_OBJ. \n " ) ) ;
return False ;
}
return True ;
}
2001-11-29 16:05:05 +00:00
2002-08-17 15:34:15 +00:00
/***************************************************************************
2005-01-15 02:20:30 +00:00
api_lsa_add_acct_rights
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_add_acct_rights ( pipes_struct * p )
{
LSA_Q_ADD_ACCT_RIGHTS q_u ;
LSA_R_ADD_ACCT_RIGHTS 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 ( ! lsa_io_q_add_acct_rights ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_add_acct_rights: failed to unmarshall LSA_Q_ADD_ACCT_RIGHTS. \n " ) ) ;
return False ;
}
r_u . status = _lsa_add_acct_rights ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_add_acct_rights ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_add_acct_rights: Failed to marshall LSA_R_ADD_ACCT_RIGHTS. \n " ) ) ;
return False ;
}
return True ;
}
/***************************************************************************
api_lsa_remove_acct_rights
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_remove_acct_rights ( pipes_struct * p )
{
LSA_Q_REMOVE_ACCT_RIGHTS q_u ;
LSA_R_REMOVE_ACCT_RIGHTS 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 ( ! lsa_io_q_remove_acct_rights ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_remove_acct_rights: failed to unmarshall LSA_Q_REMOVE_ACCT_RIGHTS. \n " ) ) ;
return False ;
}
r_u . status = _lsa_remove_acct_rights ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_remove_acct_rights ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_remove_acct_rights: Failed to marshall LSA_R_REMOVE_ACCT_RIGHTS. \n " ) ) ;
return False ;
}
return True ;
}
2005-01-15 03:54:03 +00:00
/***************************************************************************
api_lsa_enum_acct_rights
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_enum_acct_rights ( pipes_struct * p )
{
LSA_Q_ENUM_ACCT_RIGHTS q_u ;
LSA_R_ENUM_ACCT_RIGHTS 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 ( ! lsa_io_q_enum_acct_rights ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_enum_acct_rights: failed to unmarshall LSA_Q_ENUM_ACCT_RIGHTS. \n " ) ) ;
return False ;
}
r_u . status = _lsa_enum_acct_rights ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_enum_acct_rights ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_enum_acct_rights: Failed to marshall LSA_R_ENUM_ACCT_RIGHTS. \n " ) ) ;
return False ;
}
return True ;
}
2005-03-10 18:50:47 +00:00
/***************************************************************************
api_lsa_lookup_priv_value
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_lookup_priv_value ( pipes_struct * p )
{
LSA_Q_LOOKUP_PRIV_VALUE q_u ;
LSA_R_LOOKUP_PRIV_VALUE 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 ( ! lsa_io_q_lookup_priv_value ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_priv_value: failed to unmarshall LSA_Q_LOOKUP_PRIV_VALUE . \n " ) ) ;
return False ;
}
r_u . status = _lsa_lookup_priv_value ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_lookup_priv_value ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_priv_value: Failed to marshall LSA_R_LOOKUP_PRIV_VALUE. \n " ) ) ;
return False ;
}
return True ;
}
2005-05-31 13:46:45 +00:00
/***************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_open_trust_dom ( pipes_struct * p )
{
2006-10-10 08:39:11 +00:00
return proxy_lsa_call ( p , DCERPC_LSA_OPENTRUSTEDDOMAIN ) ;
2005-05-31 13:46:45 +00:00
}
/***************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_create_trust_dom ( pipes_struct * p )
{
2006-10-10 08:39:11 +00:00
return proxy_lsa_call ( p , DCERPC_LSA_CREATETRUSTEDDOMAIN ) ;
2005-05-31 13:46:45 +00:00
}
/***************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_create_secret ( pipes_struct * p )
{
2006-10-10 08:39:11 +00:00
return proxy_lsa_call ( p , DCERPC_LSA_CREATESECRET ) ;
2005-05-31 13:46:45 +00:00
}
/***************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_set_secret ( pipes_struct * p )
{
2006-10-10 08:39:11 +00:00
return proxy_lsa_call ( p , DCERPC_LSA_SETSECRET ) ;
2005-05-31 13:46:45 +00:00
}
/***************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_delete_object ( pipes_struct * p )
{
LSA_Q_DELETE_OBJECT q_u ;
LSA_R_DELETE_OBJECT 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 ( ! lsa_io_q_delete_object ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_delete_object: failed to unmarshall LSA_Q_DELETE_OBJECT. \n " ) ) ;
return False ;
}
r_u . status = _lsa_delete_object ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_delete_object ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_delete_object: Failed to marshall LSA_R_DELETE_OBJECT. \n " ) ) ;
return False ;
}
return True ;
}
2006-02-10 23:52:53 +00:00
/***************************************************************************
api_lsa_lookup_sids2
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_lookup_sids2 ( pipes_struct * p )
{
LSA_Q_LOOKUP_SIDS2 q_u ;
LSA_R_LOOKUP_SIDS2 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 info class and policy handle */
if ( ! lsa_io_q_lookup_sids2 ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_sids2: failed to unmarshall LSA_Q_LOOKUP_SIDS2. \n " ) ) ;
return False ;
}
r_u . status = _lsa_lookup_sids2 ( p , & q_u , & r_u ) ;
if ( ! lsa_io_r_lookup_sids2 ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_sids2: Failed to marshall LSA_R_LOOKUP_SIDS2. \n " ) ) ;
return False ;
}
return True ;
}
/***************************************************************************
api_lsa_lookup_sids3
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_lookup_sids3 ( pipes_struct * p )
{
LSA_Q_LOOKUP_SIDS3 q_u ;
LSA_R_LOOKUP_SIDS3 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 info class and policy handle */
if ( ! lsa_io_q_lookup_sids3 ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_sids3: failed to unmarshall LSA_Q_LOOKUP_SIDS3. \n " ) ) ;
return False ;
}
r_u . status = _lsa_lookup_sids3 ( p , & q_u , & r_u ) ;
if ( ! lsa_io_r_lookup_sids3 ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_sids3: Failed to marshall LSA_R_LOOKUP_SIDS3. \n " ) ) ;
return False ;
}
return True ;
}
2006-02-11 04:25:06 +00:00
/***************************************************************************
api_lsa_lookup_names2
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_lookup_names2 ( pipes_struct * p )
{
LSA_Q_LOOKUP_NAMES2 q_u ;
LSA_R_LOOKUP_NAMES2 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 info class and policy handle */
if ( ! lsa_io_q_lookup_names2 ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_names2: failed to unmarshall LSA_Q_LOOKUP_NAMES2. \n " ) ) ;
return False ;
}
r_u . status = _lsa_lookup_names2 ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_lookup_names2 ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_names2: Failed to marshall LSA_R_LOOKUP_NAMES2. \n " ) ) ;
return False ;
}
return True ;
}
2006-02-11 05:36:27 +00:00
/***************************************************************************
api_lsa_lookup_names3
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_lookup_names3 ( pipes_struct * p )
{
LSA_Q_LOOKUP_NAMES3 q_u ;
LSA_R_LOOKUP_NAMES3 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 info class and policy handle */
if ( ! lsa_io_q_lookup_names3 ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_names3: failed to unmarshall LSA_Q_LOOKUP_NAMES3. \n " ) ) ;
return False ;
}
r_u . status = _lsa_lookup_names3 ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_lookup_names3 ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_names3: Failed to marshall LSA_R_LOOKUP_NAMES3. \n " ) ) ;
return False ;
}
return True ;
}
/***************************************************************************
api_lsa_lookup_names4
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_lookup_names4 ( pipes_struct * p )
{
LSA_Q_LOOKUP_NAMES4 q_u ;
LSA_R_LOOKUP_NAMES4 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 info class and policy handle */
if ( ! lsa_io_q_lookup_names4 ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_names4: failed to unmarshall LSA_Q_LOOKUP_NAMES4. \n " ) ) ;
return False ;
}
r_u . status = _lsa_lookup_names4 ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
if ( ! lsa_io_r_lookup_names4 ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_lookup_names4: Failed to marshall LSA_R_LOOKUP_NAMES4. \n " ) ) ;
return False ;
}
return True ;
}
2005-03-10 18:50:47 +00:00
#if 0 /* AD DC work in ongoing in Samba 4 */
2005-01-15 02:20:30 +00:00
/***************************************************************************
api_lsa_query_info2
2002-08-17 15:34:15 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL api_lsa_query_info2 ( pipes_struct * p )
{
LSA_Q_QUERY_INFO2 q_u ;
LSA_R_QUERY_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 ( ! lsa_io_q_query_info2 ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_query_info2: failed to unmarshall LSA_Q_QUERY_INFO2. \n " ) ) ;
return False ;
}
r_u . status = _lsa_query_info2 ( p , & q_u , & r_u ) ;
if ( ! lsa_io_r_query_info2 ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_lsa_query_info2: failed to marshall LSA_R_QUERY_INFO2. \n " ) ) ;
return False ;
}
return True ;
}
2005-03-10 18:50:47 +00:00
# endif /* AD DC work in ongoing in Samba 4 */
2002-08-17 15:34:15 +00:00
1998-03-11 21:11:04 +00:00
/***************************************************************************
\ PIPE \ ntlsa commands
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2003-08-14 21:14:28 +00:00
static struct api_struct api_lsa_cmds [ ] =
1998-03-11 21:11:04 +00:00
{
2001-11-29 16:05:05 +00:00
{ " LSA_OPENPOLICY2 " , LSA_OPENPOLICY2 , api_lsa_open_policy2 } ,
{ " LSA_OPENPOLICY " , LSA_OPENPOLICY , api_lsa_open_policy } ,
{ " LSA_QUERYINFOPOLICY " , LSA_QUERYINFOPOLICY , api_lsa_query_info } ,
{ " LSA_ENUMTRUSTDOM " , LSA_ENUMTRUSTDOM , api_lsa_enum_trust_dom } ,
{ " LSA_CLOSE " , LSA_CLOSE , api_lsa_close } ,
{ " LSA_OPENSECRET " , LSA_OPENSECRET , api_lsa_open_secret } ,
{ " LSA_LOOKUPSIDS " , LSA_LOOKUPSIDS , api_lsa_lookup_sids } ,
{ " LSA_LOOKUPNAMES " , LSA_LOOKUPNAMES , api_lsa_lookup_names } ,
{ " LSA_ENUM_PRIVS " , LSA_ENUM_PRIVS , api_lsa_enum_privs } ,
2001-07-09 18:32:54 +00:00
{ " LSA_PRIV_GET_DISPNAME " , LSA_PRIV_GET_DISPNAME , api_lsa_priv_get_dispname } ,
2001-11-29 16:05:05 +00:00
{ " LSA_ENUM_ACCOUNTS " , LSA_ENUM_ACCOUNTS , api_lsa_enum_accounts } ,
{ " LSA_UNK_GET_CONNUSER " , LSA_UNK_GET_CONNUSER , api_lsa_unk_get_connuser } ,
2005-01-13 18:20:37 +00:00
{ " LSA_CREATEACCOUNT " , LSA_CREATEACCOUNT , api_lsa_create_account } ,
2001-11-29 16:05:05 +00:00
{ " LSA_OPENACCOUNT " , LSA_OPENACCOUNT , api_lsa_open_account } ,
2001-07-09 18:32:54 +00:00
{ " LSA_ENUMPRIVSACCOUNT " , LSA_ENUMPRIVSACCOUNT , api_lsa_enum_privsaccount } ,
2001-11-29 16:05:05 +00:00
{ " LSA_GETSYSTEMACCOUNT " , LSA_GETSYSTEMACCOUNT , api_lsa_getsystemaccount } ,
{ " LSA_SETSYSTEMACCOUNT " , LSA_SETSYSTEMACCOUNT , api_lsa_setsystemaccount } ,
{ " LSA_ADDPRIVS " , LSA_ADDPRIVS , api_lsa_addprivs } ,
{ " LSA_REMOVEPRIVS " , LSA_REMOVEPRIVS , api_lsa_removeprivs } ,
2005-01-15 02:20:30 +00:00
{ " LSA_ADDACCTRIGHTS " , LSA_ADDACCTRIGHTS , api_lsa_add_acct_rights } ,
{ " LSA_REMOVEACCTRIGHTS " , LSA_REMOVEACCTRIGHTS , api_lsa_remove_acct_rights } ,
2005-01-15 03:54:03 +00:00
{ " LSA_ENUMACCTRIGHTS " , LSA_ENUMACCTRIGHTS , api_lsa_enum_acct_rights } ,
2001-12-14 17:31:48 +00:00
{ " LSA_QUERYSECOBJ " , LSA_QUERYSECOBJ , api_lsa_query_secobj } ,
2005-05-31 13:46:45 +00:00
{ " LSA_LOOKUPPRIVVALUE " , LSA_LOOKUPPRIVVALUE , api_lsa_lookup_priv_value } ,
{ " LSA_OPENTRUSTDOM " , LSA_OPENTRUSTDOM , api_lsa_open_trust_dom } ,
{ " LSA_OPENSECRET " , LSA_OPENSECRET , api_lsa_open_secret } ,
{ " LSA_CREATETRUSTDOM " , LSA_CREATETRUSTDOM , api_lsa_create_trust_dom } ,
{ " LSA_CREATSECRET " , LSA_CREATESECRET , api_lsa_create_secret } ,
{ " LSA_SETSECRET " , LSA_SETSECRET , api_lsa_set_secret } ,
2006-02-10 23:52:53 +00:00
{ " LSA_DELETEOBJECT " , LSA_DELETEOBJECT , api_lsa_delete_object } ,
{ " LSA_LOOKUPSIDS2 " , LSA_LOOKUPSIDS2 , api_lsa_lookup_sids2 } ,
2006-02-11 04:25:06 +00:00
{ " LSA_LOOKUPNAMES2 " , LSA_LOOKUPNAMES2 , api_lsa_lookup_names2 } ,
2006-02-11 05:36:27 +00:00
{ " LSA_LOOKUPNAMES3 " , LSA_LOOKUPNAMES3 , api_lsa_lookup_names3 } ,
{ " LSA_LOOKUPSIDS3 " , LSA_LOOKUPSIDS3 , api_lsa_lookup_sids3 } ,
{ " LSA_LOOKUPNAMES4 " , LSA_LOOKUPNAMES4 , api_lsa_lookup_names4 }
2005-03-10 18:50:47 +00:00
#if 0 /* AD DC work in ongoing in Samba 4 */
2003-05-22 15:27:27 +00:00
/* be careful of the adding of new RPC's. See commentrs below about
ADS DC capabilities */
2003-02-14 00:48:28 +00:00
{ " LSA_QUERYINFO2 " , LSA_QUERYINFO2 , api_lsa_query_info2 }
2005-03-10 18:50:47 +00:00
# endif /* AD DC work in ongoing in Samba 4 */
1998-03-11 21:11:04 +00:00
} ;
2003-05-22 15:27:27 +00:00
2003-08-14 21:14:28 +00:00
static int count_fns ( void )
{
int funcs = sizeof ( api_lsa_cmds ) / sizeof ( struct api_struct ) ;
2005-03-10 18:50:47 +00:00
#if 0 /* AD DC work is on going in Samba 4 */
2003-08-14 21:14:28 +00:00
/*
* NOTE : Certain calls can not be enabled if we aren ' t an ADS DC . Make sure
* these calls are always last and that you decrement by the amount of calls
* to disable .
*/
if ( ! ( SEC_ADS = = lp_security ( ) & & ROLE_DOMAIN_PDC = = lp_server_role ( ) ) ) {
funcs - = 1 ;
}
2005-03-10 18:50:47 +00:00
# endif /* AD DC work in ongoing in Samba 4 */
2003-08-14 21:14:28 +00:00
return funcs ;
}
void lsa_get_pipe_fns ( struct api_struct * * fns , int * n_fns )
{
* fns = api_lsa_cmds ;
* n_fns = count_fns ( ) ;
}
NTSTATUS rpc_lsa_init ( void )
{
int funcs = count_fns ( ) ;
1998-03-11 21:11:04 +00:00
2003-08-14 21:14:28 +00:00
return rpc_pipe_register_commands ( SMB_RPC_INTERFACE_VERSION , " lsarpc " , " lsass " , api_lsa_cmds ,
funcs ) ;
1998-03-11 21:11:04 +00:00
}