1998-03-12 00:11:04 +03:00
/*
2002-01-30 09:08:46 +03:00
* Unix SMB / CIFS implementation .
1998-03-12 00:11:04 +03:00
* RPC Pipe client / server routines
* Copyright ( C ) Andrew Tridgell 1992 - 1997 ,
* Copyright ( C ) Luke Kenneth Casson Leighton 1996 - 1997 ,
2002-08-17 19:34:15 +04:00
* Copyright ( C ) Paul Ashton 1997 ,
* Copyright ( C ) Marc Jacobsen 1999 ,
* Copyright ( C ) Jean Fran <EFBFBD> ois Micouleau 1998 - 2001 ,
2003-08-01 19:30:44 +04:00
* Copyright ( C ) Jim McDonough < jmcd @ us . ibm . com > 2002 - 2003.
2001-03-11 03:32:10 +03:00
*
* Split into interface and implementation modules by ,
*
* Copyright ( C ) Jeremy Allison 2001.
1998-03-12 00:11:04 +03: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 23:25:36 +04:00
* the Free Software Foundation ; either version 3 of the License , or
1998-03-12 00:11:04 +03: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 09:23:25 +04:00
* along with this program ; if not , see < http : //www.gnu.org/licenses/>.
1998-03-12 00:11:04 +03:00
*/
2001-03-11 03:32:10 +03:00
/*
* This is the interface to the SAMR code .
*/
1998-03-12 00:11:04 +03:00
# include "includes.h"
2002-07-15 14:35:28 +04:00
# undef DBGC_CLASS
# define DBGC_CLASS DBGC_RPC_SRV
1998-03-12 00:11:04 +03:00
/*******************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2008-01-30 14:53:09 +03:00
static bool proxy_samr_call ( pipes_struct * p , uint8 opnum )
1998-03-12 00:11:04 +03:00
{
2008-01-30 14:53:09 +03:00
struct api_struct * fns ;
int n_fns ;
1998-05-06 21:43:44 +04:00
2008-01-30 14:53:09 +03:00
samr_get_pipe_fns ( & fns , & n_fns ) ;
1998-05-06 21:43:44 +04:00
2008-01-30 14:53:09 +03:00
if ( opnum > = n_fns ) {
return false ;
1998-05-06 21:43:44 +04:00
}
2008-01-30 14:53:09 +03:00
if ( fns [ opnum ] . opnum ! = opnum ) {
smb_panic ( " SAMR function table not sorted " ) ;
2000-03-21 21:33:08 +03:00
}
2008-01-30 14:53:09 +03:00
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 ) ;
2000-03-21 21:33:08 +03:00
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_open_domain
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_open_domain ( pipes_struct * p )
1998-03-12 00:11:04 +03:00
{
2008-02-01 02:23:50 +03:00
return proxy_samr_call ( p , NDR_SAMR_OPENDOMAIN ) ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_get_usrdom_pwinfo
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_get_usrdom_pwinfo ( pipes_struct * p )
1998-03-12 00:11:04 +03:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_GET_USRDOM_PWINFO q_u ;
SAMR_R_GET_USRDOM_PWINFO r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2001-03-23 03:50:31 +03:00
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 " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_get_usrdom_pwinfo ( p , & q_u , & r_u ) ;
2001-03-23 03:50:31 +03:00
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 " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
return True ;
1998-03-12 00:11:04 +03:00
}
2002-07-15 14:35:28 +04:00
/*******************************************************************
api_samr_set_sec_obj
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_set_sec_obj ( pipes_struct * p )
2002-07-15 14:35:28 +04:00
{
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 ;
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_query_sec_obj
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_query_sec_obj ( pipes_struct * p )
2001-03-11 03:32:10 +03:00
{
SAMR_Q_QUERY_SEC_OBJ q_u ;
SAMR_R_QUERY_SEC_OBJ r_u ;
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-03-12 00:11:04 +03:00
2001-03-23 03:50:31 +03:00
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 " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
2001-03-23 03:50:31 +03:00
}
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_query_sec_obj ( p , & q_u , & r_u ) ;
1998-03-12 00:11:04 +03:00
2001-03-23 03:50:31 +03:00
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 " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1998-03-12 00:11:04 +03:00
2000-05-16 23:45:26 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_enum_dom_users
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_enum_dom_users ( pipes_struct * p )
1998-03-12 00:11:04 +03:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_ENUM_DOM_USERS q_u ;
SAMR_R_ENUM_DOM_USERS r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1999-12-13 16:27:58 +03:00
/* grab the samr open */
2001-03-23 03:50:31 +03:00
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 " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_enum_dom_users ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
2001-03-23 03:50:31 +03:00
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 " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
return True ;
1998-03-12 00:11:04 +03:00
}
1998-10-22 01:11:16 +04:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_enum_dom_groups
1998-10-22 01:11:16 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_enum_dom_groups ( pipes_struct * p )
2001-03-11 03:32:10 +03:00
{
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 ;
1998-10-22 01:11:16 +04:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-10-22 01:11:16 +04:00
2001-03-11 03:32:10 +03:00
/* grab the samr open */
2001-03-23 03:50:31 +03:00
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 " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
2001-03-23 03:50:31 +03:00
}
1998-10-22 01:11:16 +04:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_enum_dom_groups ( p , & q_u , & r_u ) ;
1998-10-22 01:11:16 +04:00
/* store the response in the SMB stream */
2001-03-23 03:50:31 +03:00
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 " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1998-10-22 01:11:16 +04:00
2000-05-16 23:45:26 +04:00
return True ;
1998-10-22 01:11:16 +04:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_enum_dom_aliases
1998-10-22 01:11:16 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_enum_dom_aliases ( pipes_struct * p )
1998-10-22 01:11:16 +04:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_ENUM_DOM_ALIASES q_u ;
SAMR_R_ENUM_DOM_ALIASES r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1999-12-13 16:27:58 +03:00
/* grab the samr open */
2001-03-23 03:50:31 +03:00
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 " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_enum_dom_aliases ( p , & q_u , & r_u ) ;
/* store the response in the SMB stream */
2001-03-23 03:50:31 +03:00
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 " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
return True ;
1998-10-22 01:11:16 +04:00
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_query_dispinfo
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_query_dispinfo ( pipes_struct * p )
2001-03-11 03:32:10 +03:00
{
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 ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-03-12 00:11:04 +03:00
2001-03-23 03:50:31 +03:00
if ( ! samr_io_q_query_dispinfo ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_query_dispinfo: unable to unmarshall SAMR_Q_QUERY_DISPINFO. \n " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
2001-03-23 03:50:31 +03:00
}
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_query_dispinfo ( p , & q_u , & r_u ) ;
1998-03-12 00:11:04 +03:00
/* store the response in the SMB stream */
2001-03-23 03:50:31 +03:00
if ( ! samr_io_r_query_dispinfo ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_query_dispinfo: unable to marshall SAMR_R_QUERY_DISPINFO. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1998-03-12 00:11:04 +03:00
2000-05-16 23:45:26 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_query_aliasinfo
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_query_aliasinfo ( pipes_struct * p )
1998-03-12 00:11:04 +03:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_QUERY_ALIASINFO q_u ;
SAMR_R_QUERY_ALIASINFO r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1999-12-13 16:27:58 +03:00
/* grab the samr open */
2001-03-23 03:50:31 +03:00
if ( ! samr_io_q_query_aliasinfo ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_query_aliasinfo: unable to unmarshall SAMR_Q_QUERY_ALIASINFO. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_query_aliasinfo ( p , & q_u , & r_u ) ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
/* store the response in the SMB stream */
2001-03-23 03:50:31 +03:00
if ( ! samr_io_r_query_aliasinfo ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_query_aliasinfo: unable to marshall SAMR_R_QUERY_ALIASINFO. \n " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
2001-03-23 03:50:31 +03:00
}
2001-03-11 03:32:10 +03:00
1999-12-13 16:27:58 +03:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_lookup_names
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_lookup_names ( pipes_struct * p )
2001-03-11 03:32:10 +03:00
{
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 ;
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
/* grab the samr lookup names */
2001-03-23 03:50:31 +03:00
if ( ! samr_io_q_lookup_names ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_lookup_names: unable to unmarshall SAMR_Q_LOOKUP_NAMES. \n " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
2001-03-23 03:50:31 +03:00
}
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_lookup_names ( p , & q_u , & r_u ) ;
1998-03-12 00:11:04 +03:00
/* store the response in the SMB stream */
2001-03-23 03:50:31 +03:00
if ( ! samr_io_r_lookup_names ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_lookup_names: unable to marshall SAMR_R_LOOKUP_NAMES. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1998-03-12 00:11:04 +03:00
2000-05-16 23:45:26 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_chgpasswd_user
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_chgpasswd_user ( pipes_struct * p )
1998-03-12 00:11:04 +03:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_CHGPASSWD_USER q_u ;
SAMR_R_CHGPASSWD_USER r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2003-08-20 20:07:19 +04:00
/* change password request */
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_chgpasswd_user ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_chgpasswd_user: Failed to unmarshall SAMR_Q_CHGPASSWD_USER. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
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 " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
1999-12-13 16:27:58 +03:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_lookup_rids
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_lookup_rids ( pipes_struct * p )
2001-03-11 03:32:10 +03:00
{
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 ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
2001-03-11 03:32:10 +03:00
/* grab the samr lookup names */
2001-03-23 03:50:31 +03:00
if ( ! samr_io_q_lookup_rids ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_lookup_rids: unable to unmarshall SAMR_Q_LOOKUP_RIDS. \n " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
2001-03-23 03:50:31 +03:00
}
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_lookup_rids ( p , & q_u , & r_u ) ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
/* store the response in the SMB stream */
2001-03-23 03:50:31 +03:00
if ( ! samr_io_r_lookup_rids ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_lookup_rids: unable to marshall SAMR_R_LOOKUP_RIDS. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
2000-05-16 23:45:26 +04:00
return True ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_open_user
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_open_user ( pipes_struct * p )
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_OPEN_USER q_u ;
SAMR_R_OPEN_USER r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2001-03-23 03:50:31 +03:00
if ( ! samr_io_q_open_user ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_open_user: unable to unmarshall SAMR_Q_OPEN_USER. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
2003-08-28 00:50:24 +04:00
r_u . status = _samr_open_user ( p , & q_u , & r_u ) ;
2001-03-11 03:32:10 +03:00
/* store the response in the SMB stream */
2001-03-23 03:50:31 +03:00
if ( ! samr_io_r_open_user ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_open_user: unable to marshall SAMR_R_OPEN_USER. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
2001-03-11 03:32:10 +03:00
1999-12-13 16:27:58 +03:00
return True ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_query_userinfo
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_query_userinfo ( pipes_struct * p )
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
{
2001-03-11 03:32:10 +03:00
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 ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
2001-03-23 03:50:31 +03:00
if ( ! samr_io_q_query_userinfo ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_query_userinfo: unable to unmarshall SAMR_Q_QUERY_USERINFO. \n " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
2001-03-23 03:50:31 +03:00
}
2001-03-11 03:32:10 +03:00
r_u . status = _samr_query_userinfo ( p , & q_u , & r_u ) ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
/* store the response in the SMB stream */
2001-03-23 03:50:31 +03:00
if ( ! samr_io_r_query_userinfo ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_query_userinfo: unable to marshall SAMR_R_QUERY_USERINFO. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
2000-05-16 23:45:26 +04:00
return True ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_query_usergroups
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_query_usergroups ( pipes_struct * p )
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_QUERY_USERGROUPS q_u ;
SAMR_R_QUERY_USERGROUPS r_u ;
2000-06-16 12:47:52 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2001-03-23 03:50:31 +03:00
if ( ! samr_io_q_query_usergroups ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_query_usergroups: unable to unmarshall SAMR_Q_QUERY_USERGROUPS. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
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 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_query_usergroups: unable to marshall SAMR_R_QUERY_USERGROUPS. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
1999-12-13 16:27:58 +03:00
return True ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
}
/*******************************************************************
2006-05-05 12:04:28 +04:00
api_samr_query_domain_info
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_query_domain_info ( pipes_struct * p )
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_QUERY_DOMAIN_INFO q_u ;
SAMR_R_QUERY_DOMAIN_INFO r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1999-12-13 16:27:58 +03:00
2006-05-05 12:04:28 +04:00
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 " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
2006-05-05 12:04:28 +04:00
r_u . status = _samr_query_domain_info ( p , & q_u , & r_u ) ;
1999-12-13 16:27:58 +03:00
/* store the response in the SMB stream */
2006-05-05 12:04:28 +04:00
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 " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
return True ;
1999-11-16 02:46:27 +03:00
}
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_create_user
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_create_user ( pipes_struct * p )
1998-10-22 01:11:16 +04:00
{
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1998-10-22 01:11:16 +04:00
2001-03-11 03:32:10 +03:00
SAMR_Q_CREATE_USER q_u ;
SAMR_R_CREATE_USER r_u ;
1998-10-22 01:11:16 +04:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-10-22 01:11:16 +04:00
2001-03-11 03:32:10 +03:00
/* 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 " ) ) ;
1998-03-12 00:11:04 +03:00
return False ;
}
2003-08-28 00:50:24 +04:00
r_u . status = _samr_create_user ( p , & q_u , & r_u ) ;
1998-03-12 00:11:04 +03:00
/* store the response in the SMB stream */
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_create_user ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_create_user: Unable to marshall SAMR_R_CREATE_USER. \n " ) ) ;
1999-03-25 23:56:28 +03:00
return False ;
}
1999-12-13 16:27:58 +03:00
return True ;
1999-03-25 18:14:30 +03:00
}
1999-03-25 16:54:31 +03:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_connect_anon
1999-03-25 16:54:31 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_connect_anon ( pipes_struct * p )
1999-03-25 16:54:31 +03:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_CONNECT_ANON q_u ;
SAMR_R_CONNECT_ANON r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1999-03-26 00:32:04 +03:00
2001-03-11 03:32:10 +03:00
/* grab the samr open policy */
2001-03-23 03:50:31 +03:00
if ( ! samr_io_q_connect_anon ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_connect_anon: unable to unmarshall SAMR_Q_CONNECT_ANON. \n " ) ) ;
1999-03-25 16:54:31 +03:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-11-18 22:29:08 +03:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_connect_anon ( p , & q_u , & r_u ) ;
1999-11-18 22:29:08 +03:00
1999-12-13 16:27:58 +03:00
/* store the response in the SMB stream */
2001-03-23 03:50:31 +03:00
if ( ! samr_io_r_connect_anon ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_connect_anon: unable to marshall SAMR_R_CONNECT_ANON. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-11-18 22:29:08 +03:00
2000-05-16 23:45:26 +04:00
return True ;
1999-11-18 22:29:08 +03:00
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_connect
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_connect ( pipes_struct * p )
1998-03-12 00:11:04 +03:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_CONNECT q_u ;
SAMR_R_CONNECT r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
/* grab the samr open policy */
2001-03-23 03:50:31 +03:00
if ( ! samr_io_q_connect ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_connect: unable to unmarshall SAMR_Q_CONNECT. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_connect ( p , & q_u , & r_u ) ;
1999-11-18 22:29:08 +03:00
/* store the response in the SMB stream */
2001-03-23 03:50:31 +03:00
if ( ! samr_io_r_connect ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_connect: unable to marshall SAMR_R_CONNECT. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-23 03:50:31 +03:00
}
1999-12-13 16:27:58 +03:00
return True ;
1999-11-18 22:29:08 +03:00
}
2002-08-17 19:34:15 +04:00
/*******************************************************************
api_samr_connect4
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_connect4 ( pipes_struct * p )
2002-08-17 19:34:15 +04:00
{
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 ;
}
2006-02-11 02:09:00 +03:00
/*******************************************************************
api_samr_chgpasswd_user3
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_chgpasswd_user3 ( pipes_struct * p )
2006-02-11 02:09:00 +03:00
{
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 ;
}
2005-11-18 01:40:10 +03:00
/*******************************************************************
api_samr_connect5
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_connect5 ( pipes_struct * p )
2005-11-18 01:40:10 +03:00
{
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 ;
}
2001-03-11 03:32:10 +03:00
/**********************************************************************
api_samr_lookup_domain
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-11-18 22:29:08 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_lookup_domain ( pipes_struct * p )
1999-03-25 16:54:31 +03:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_LOOKUP_DOMAIN q_u ;
SAMR_R_LOOKUP_DOMAIN r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2001-03-11 03:32:10 +03:00
2000-10-07 19:56:36 +04:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_lookup_domain ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_lookup_domain: Unable to unmarshall SAMR_Q_LOOKUP_DOMAIN. \n " ) ) ;
1999-12-13 16:27:58 +03:00
return False ;
1998-03-12 00:11:04 +03:00
}
2001-03-11 03:32:10 +03:00
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 " ) ) ;
1999-12-13 16:27:58 +03:00
return False ;
1998-03-12 00:11:04 +03:00
}
2001-03-11 03:32:10 +03:00
1999-12-13 16:27:58 +03:00
return True ;
}
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
/**********************************************************************
api_samr_enum_domains
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_enum_domains ( pipes_struct * p )
1999-12-13 16:27:58 +03:00
{
2001-03-11 03:32:10 +03:00
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 ) ;
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_enum_domains ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_enum_domains: Unable to unmarshall SAMR_Q_ENUM_DOMAINS. \n " ) ) ;
1999-12-13 16:27:58 +03:00
return False ;
1998-09-25 00:02:56 +04:00
}
2001-03-11 03:32:10 +03:00
r_u . status = _samr_enum_domains ( p , & q_u , & r_u ) ;
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_enum_domains ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_enum_domains: Unable to marshall SAMR_R_ENUM_DOMAINS. \n " ) ) ;
1999-12-13 16:27:58 +03:00
return False ;
}
2001-03-11 03:32:10 +03:00
1999-12-13 16:27:58 +03:00
return True ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_open_alias
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_open_alias ( pipes_struct * p )
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_OPEN_ALIAS q_u ;
SAMR_R_OPEN_ALIAS r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
2001-03-11 03:32:10 +03:00
/* 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 " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
}
2003-08-28 00:50:24 +04:00
r_u . status = _samr_open_alias ( p , & q_u , & r_u ) ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
/* store the response in the SMB stream */
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_open_alias ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_open_alias: Unable to marshall SAMR_R_OPEN_ALIAS. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
}
return True ;
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_set_userinfo
- lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
change module that is independent of "cnums" and "snums".
a security context is needed for pipes, not just IPC$ or other
services.
- group database API
added add_group/alias_member, del_group/alias_member,
del_group/alias_entry functions. del_builtin_entry() is
deliberately set to NULL to cause an exception, you cannot
delete builtin aliases.
- parse_lsa.c srv_lsa.c
fixed lookup_names code, it was a load of trash and didn't do
anything.
- cmd_samr.c rpcclient.c srv_samr.c
added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
"addgroupmem", "addaliasmem", "createalias", "creategroup", to
both client and server code.
server code calls into unix stubs right now, which don't actually
do anything. the only instance where they are expected to do
anything is in appliance mode NOT even in the ldap code or anything.
client code modified to call samr_lookup_names() for group code
(because we can) and lsa_lookup_names() for alias code (because
we have to).
- srv_lookup.c
oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
instead of DOMAIN, name.
(This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-07 20:23:48 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_set_userinfo ( pipes_struct * p )
1998-10-22 01:11:16 +04:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_SET_USERINFO q_u ;
SAMR_R_SET_USERINFO r_u ;
2000-10-07 19:56:36 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
ZERO_STRUCT ( q_u ) ;
1998-10-22 01:11:16 +04:00
ZERO_STRUCT ( r_u ) ;
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_set_userinfo ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_set_userinfo: Unable to unmarshall SAMR_Q_SET_USERINFO. \n " ) ) ;
2001-05-18 05:30:21 +04:00
/* Fix for W2K SP2 */
2005-02-12 03:51:31 +03:00
/* what is that status-code ? - gd */
2001-05-18 05:30:21 +04:00
if ( q_u . switch_value = = 0x1a ) {
2006-03-21 03:04:05 +03:00
setup_fault_pdu ( p , NT_STATUS ( DCERPC_FAULT_INVALID_TAG ) ) ;
2001-05-18 05:30:21 +04:00
return True ;
}
2000-10-07 19:56:36 +04:00
return False ;
1998-10-22 01:11:16 +04:00
}
2001-03-11 03:32:10 +03:00
r_u . status = _samr_set_userinfo ( p , & q_u , & r_u ) ;
1998-10-22 01:11:16 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_set_userinfo ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_set_userinfo: Unable to marshall SAMR_R_SET_USERINFO. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
1999-12-13 16:27:58 +03:00
return True ;
1998-10-22 01:11:16 +04:00
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_set_userinfo2
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-09-28 21:35:03 +04:00
2007-10-19 04:40:25 +04:00
static bool api_samr_set_userinfo2 ( pipes_struct * p )
2000-10-07 19:56:36 +04:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_SET_USERINFO2 q_u ;
SAMR_R_SET_USERINFO2 r_u ;
2000-10-07 19:56:36 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_set_userinfo2 ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_set_userinfo2: Unable to unmarshall SAMR_Q_SET_USERINFO2. \n " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
2000-09-27 17:02:57 +04:00
}
2001-03-11 03:32:10 +03:00
r_u . status = _samr_set_userinfo2 ( p , & q_u , & r_u ) ;
2000-09-27 17:02:57 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_set_userinfo2 ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_set_userinfo2: Unable to marshall SAMR_R_SET_USERINFO2. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2000-10-07 21:32:40 +04:00
}
1999-12-13 16:27:58 +03:00
return True ;
1998-03-12 00:11:04 +03:00
}
1998-10-15 09:47:29 +04:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_query_useraliases
1998-10-15 09:47:29 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_query_useraliases ( pipes_struct * p )
2001-03-11 03:32:10 +03:00
{
SAMR_Q_QUERY_USERALIASES q_u ;
SAMR_R_QUERY_USERALIASES r_u ;
1998-10-15 09:47:29 +04:00
2001-03-11 03:32:10 +03:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1998-10-15 09:47:29 +04:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-10-15 09:47:29 +04:00
2001-03-11 03:32:10 +03:00
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 ;
1998-10-15 09:47:29 +04:00
}
2001-03-11 03:32:10 +03:00
r_u . status = _samr_query_useraliases ( p , & q_u , & r_u ) ;
1998-10-15 09:47:29 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_query_useraliases ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " api_samr_query_useraliases: Unable to nmarshall SAMR_R_QUERY_USERALIASES. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
1998-10-15 09:47:29 +04:00
2000-05-16 23:45:26 +04:00
return True ;
1998-10-15 09:47:29 +04:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_query_aliasmem
1998-10-15 09:47:29 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_query_aliasmem ( pipes_struct * p )
1998-10-15 09:47:29 +04:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_QUERY_ALIASMEM q_u ;
SAMR_R_QUERY_ALIASMEM r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
if ( ! samr_io_q_query_aliasmem ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_query_aliasmem: unable to unmarshall SAMR_Q_QUERY_ALIASMEM. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
r_u . status = _samr_query_aliasmem ( p , & q_u , & r_u ) ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_query_aliasmem ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_query_aliasmem: unable to marshall SAMR_R_QUERY_ALIASMEM. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
1999-12-13 16:27:58 +03:00
return True ;
1998-10-15 09:47:29 +04:00
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_query_groupmem
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_query_groupmem ( pipes_struct * p )
2001-03-11 03:32:10 +03:00
{
SAMR_Q_QUERY_GROUPMEM q_u ;
SAMR_R_QUERY_GROUPMEM r_u ;
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_query_groupmem ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_query_groupmem: unable to unmarshall SAMR_Q_QUERY_GROUPMEM. \n " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
1998-03-12 00:11:04 +03:00
}
2001-03-11 03:32:10 +03:00
r_u . status = _samr_query_groupmem ( p , & q_u , & r_u ) ;
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_query_groupmem ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_query_groupmem: unable to marshall SAMR_R_QUERY_GROUPMEM. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
1998-03-12 00:11:04 +03:00
2000-05-16 23:45:26 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_add_aliasmem
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_add_aliasmem ( pipes_struct * p )
1998-03-12 00:11:04 +03:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_ADD_ALIASMEM q_u ;
SAMR_R_ADD_ALIASMEM r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
if ( ! samr_io_q_add_aliasmem ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_add_aliasmem: unable to unmarshall SAMR_Q_ADD_ALIASMEM. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
1999-12-13 16:27:58 +03:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_add_aliasmem ( p , & q_u , & r_u ) ;
if ( ! samr_io_r_add_aliasmem ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_add_aliasmem: unable to marshall SAMR_R_ADD_ALIASMEM. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
2000-05-16 23:45:26 +04:00
return True ;
}
2001-03-11 03:32:10 +03:00
/*******************************************************************
api_samr_del_aliasmem
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_del_aliasmem ( pipes_struct * p )
2000-05-16 23:45:26 +04:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_DEL_ALIASMEM q_u ;
SAMR_R_DEL_ALIASMEM r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2001-03-11 03:32:10 +03:00
2000-10-07 21:32:40 +04:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_del_aliasmem ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_del_aliasmem: unable to unmarshall SAMR_Q_DEL_ALIASMEM. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2000-10-07 21:32:40 +04:00
}
2000-05-16 23:45:26 +04:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_del_aliasmem ( p , & q_u , & r_u ) ;
if ( ! samr_io_r_del_aliasmem ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_del_aliasmem: unable to marshall SAMR_R_DEL_ALIASMEM. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
}
2001-03-11 03:32:10 +03:00
1999-12-13 16:27:58 +03:00
return True ;
1998-03-12 00:11:04 +03:00
}
2001-03-11 03:32:10 +03:00
/*******************************************************************
api_samr_add_groupmem
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_add_groupmem ( pipes_struct * p )
2000-05-16 23:45:26 +04:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_ADD_GROUPMEM q_u ;
SAMR_R_ADD_GROUPMEM r_u ;
2000-06-16 12:11:32 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2000-10-07 21:32:40 +04:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2000-05-16 23:45:26 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_add_groupmem ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_add_groupmem: unable to unmarshall SAMR_Q_ADD_GROUPMEM. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2000-10-07 21:32:40 +04:00
}
2001-03-11 03:32:10 +03:00
r_u . status = _samr_add_groupmem ( p , & q_u , & r_u ) ;
2000-10-07 21:32:40 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_add_groupmem ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_add_groupmem: unable to marshall SAMR_R_ADD_GROUPMEM. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2000-10-07 21:32:40 +04:00
}
2000-06-16 12:11:32 +04:00
return True ;
2000-05-16 23:45:26 +04:00
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_del_groupmem
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_del_groupmem ( pipes_struct * p )
1998-03-12 00:11:04 +03:00
{
2001-03-11 03:32:10 +03:00
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 ) ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_del_groupmem ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_del_groupmem: unable to unmarshall SAMR_Q_DEL_GROUPMEM. \n " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
1998-03-12 00:11:04 +03:00
}
2001-03-11 03:32:10 +03:00
r_u . status = _samr_del_groupmem ( p , & q_u , & r_u ) ;
if ( ! samr_io_r_del_groupmem ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_del_groupmem: unable to marshall SAMR_R_DEL_GROUPMEM. \n " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
1998-12-01 22:10:44 +03:00
}
2001-03-11 03:32:10 +03:00
return True ;
2000-10-07 19:56:36 +04:00
}
1998-03-12 00:11:04 +03:00
2000-10-07 19:56:36 +04:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_delete_dom_user
2000-10-07 19:56:36 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_delete_dom_user ( pipes_struct * p )
2000-10-07 19:56:36 +04:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_DELETE_DOM_USER q_u ;
SAMR_R_DELETE_DOM_USER r_u ;
2000-10-07 19:56:36 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_delete_dom_user ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_delete_dom_user: unable to unmarshall SAMR_Q_DELETE_DOM_USER. \n " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
2000-10-07 21:32:40 +04:00
}
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_delete_dom_user ( p , & q_u , & r_u ) ;
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_delete_dom_user ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_delete_dom_user: unable to marshall SAMR_R_DELETE_DOM_USER. \n " ) ) ;
2000-05-16 23:45:26 +04:00
return False ;
2000-10-07 21:32:40 +04:00
}
2001-03-11 03:32:10 +03:00
2000-10-07 19:56:36 +04:00
return True ;
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_delete_dom_group
2000-10-07 19:56:36 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_delete_dom_group ( pipes_struct * p )
2000-10-07 19:56:36 +04:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_DELETE_DOM_GROUP q_u ;
SAMR_R_DELETE_DOM_GROUP r_u ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_delete_dom_group ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_delete_dom_group: unable to unmarshall SAMR_Q_DELETE_DOM_GROUP. \n " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_delete_dom_group ( p , & q_u , & r_u ) ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_delete_dom_group ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_delete_dom_group: unable to marshall SAMR_R_DELETE_DOM_GROUP. \n " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
2000-10-07 19:56:36 +04:00
return True ;
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_delete_dom_alias
2000-10-07 19:56:36 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_delete_dom_alias ( pipes_struct * p )
2000-10-07 19:56:36 +04:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_DELETE_DOM_ALIAS q_u ;
SAMR_R_DELETE_DOM_ALIAS r_u ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
if ( ! samr_io_q_delete_dom_alias ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_delete_dom_alias: unable to unmarshall SAMR_Q_DELETE_DOM_ALIAS. \n " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
}
2001-03-11 03:32:10 +03:00
r_u . status = _samr_delete_dom_alias ( p , & q_u , & r_u ) ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_delete_dom_alias ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_delete_dom_alias: unable to marshall SAMR_R_DELETE_DOM_ALIAS. \n " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
2000-10-07 19:56:36 +04:00
return True ;
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_create_dom_group
2000-10-07 19:56:36 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_create_dom_group ( pipes_struct * p )
2000-10-07 19:56:36 +04:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_CREATE_DOM_GROUP q_u ;
SAMR_R_CREATE_DOM_GROUP r_u ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_create_dom_group ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_create_dom_group: unable to unmarshall SAMR_Q_CREATE_DOM_GROUP. \n " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_create_dom_group ( p , & q_u , & r_u ) ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_create_dom_group ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_create_dom_group: unable to marshall SAMR_R_CREATE_DOM_GROUP. \n " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
2000-10-07 19:56:36 +04:00
return True ;
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_create_dom_alias
2000-10-07 19:56:36 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_create_dom_alias ( pipes_struct * p )
2001-03-11 03:32:10 +03:00
{
SAMR_Q_CREATE_DOM_ALIAS q_u ;
SAMR_R_CREATE_DOM_ALIAS r_u ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
1998-03-12 00:11:04 +03:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_create_dom_alias ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_create_dom_alias: unable to unmarshall SAMR_Q_CREATE_DOM_ALIAS. \n " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_create_dom_alias ( p , & q_u , & r_u ) ;
2000-10-10 17:08:55 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_create_dom_alias ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_create_dom_alias: unable to marshall SAMR_R_CREATE_DOM_ALIAS. \n " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
2000-05-16 23:45:26 +04:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_query_groupinfo
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_query_groupinfo ( pipes_struct * p )
1998-03-12 00:11:04 +03:00
{
2001-03-11 03:32:10 +03:00
SAMR_Q_QUERY_GROUPINFO q_u ;
SAMR_R_QUERY_GROUPINFO r_u ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2000-10-13 18:02:01 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_query_groupinfo ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_query_groupinfo: unable to unmarshall SAMR_Q_QUERY_GROUPINFO. \n " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
r_u . status = _samr_query_groupinfo ( p , & q_u , & r_u ) ;
2000-10-10 17:08:55 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_query_groupinfo ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_query_groupinfo: unable to marshall SAMR_R_QUERY_GROUPINFO. \n " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
2001-03-11 03:32:10 +03:00
}
2000-10-07 19:56:36 +04:00
return True ;
}
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_set_groupinfo
2000-10-07 19:56:36 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_set_groupinfo ( pipes_struct * p )
2001-03-11 03:32:10 +03:00
{
SAMR_Q_SET_GROUPINFO q_u ;
SAMR_R_SET_GROUPINFO r_u ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_set_groupinfo ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_set_groupinfo: unable to unmarshall SAMR_Q_SET_GROUPINFO. \n " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
2000-10-07 19:56:36 +04:00
}
2001-03-11 03:32:10 +03:00
r_u . status = _samr_set_groupinfo ( p , & q_u , & r_u ) ;
2000-10-10 17:08:55 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_r_set_groupinfo ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_set_groupinfo: unable to marshall SAMR_R_SET_GROUPINFO. \n " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
2000-10-07 19:56:36 +04:00
}
2001-03-11 03:32:10 +03:00
return True ;
2000-10-07 19:56:36 +04:00
}
2001-05-08 20:33:18 +04:00
/*******************************************************************
api_samr_set_aliasinfo
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_set_aliasinfo ( pipes_struct * p )
2001-05-08 20:33:18 +04:00
{
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 ;
}
2000-10-07 19:56:36 +04:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_get_dom_pwinfo
2000-10-07 19:56:36 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_get_dom_pwinfo ( pipes_struct * p )
2000-10-07 19:56:36 +04:00
{
2008-01-30 23:55:03 +03:00
return proxy_samr_call ( p , NDR_SAMR_GETDOMPWINFO ) ;
1999-02-24 04:52:30 +03:00
}
2000-10-07 19:56:36 +04:00
/*******************************************************************
2001-03-11 03:32:10 +03:00
api_samr_open_group
2000-10-07 19:56:36 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_open_group ( pipes_struct * p )
2001-03-11 03:32:10 +03:00
{
SAMR_Q_OPEN_GROUP q_u ;
SAMR_R_OPEN_GROUP r_u ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2000-10-07 19:56:36 +04:00
2001-03-11 03:32:10 +03:00
if ( ! samr_io_q_open_group ( " " , & q_u , data , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_open_group: unable to unmarshall SAMR_Q_OPEN_GROUP. \n " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
2000-10-07 19:56:36 +04:00
}
2001-03-11 03:32:10 +03:00
r_u . status = _samr_open_group ( p , & q_u , & r_u ) ;
if ( ! samr_io_r_open_group ( " " , & r_u , rdata , 0 ) ) {
2001-03-23 03:50:31 +03:00
DEBUG ( 0 , ( " api_samr_open_group: unable to marshall SAMR_R_OPEN_GROUP. \n " ) ) ;
2001-03-11 03:32:10 +03:00
return False ;
2000-10-07 19:56:36 +04:00
}
2001-03-11 03:32:10 +03:00
return True ;
2000-10-07 19:56:36 +04:00
}
/*******************************************************************
2003-12-04 06:35:46 +03:00
api_samr_remove_sid_foreign_domain
2000-10-07 19:56:36 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2007-10-19 04:40:25 +04:00
static bool api_samr_remove_sid_foreign_domain ( pipes_struct * p )
2000-10-07 19:56:36 +04:00
{
2003-12-04 06:35:46 +03:00
SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN q_u ;
SAMR_R_REMOVE_SID_FOREIGN_DOMAIN r_u ;
2000-10-07 19:56:36 +04:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2003-12-04 06:35:46 +03:00
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 " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
2000-10-07 21:32:40 +04:00
}
2000-10-07 19:56:36 +04:00
2003-12-04 06:35:46 +03:00
r_u . status = _samr_remove_sid_foreign_domain ( p , & q_u , & r_u ) ;
2000-10-07 19:56:36 +04:00
2003-12-04 06:35:46 +03:00
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 " ) ) ;
2000-10-07 19:56:36 +04:00
return False ;
2000-10-07 21:32:40 +04:00
}
2000-10-07 19:56:36 +04:00
return True ;
}
2001-11-28 03:06:00 +03:00
/*******************************************************************
2005-11-19 02:15:47 +03:00
api_samr_query_dom_info2
2001-11-28 03:06:00 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_query_domain_info2 ( pipes_struct * p )
2001-11-28 03:06:00 +03:00
{
2005-11-19 02:15:47 +03:00
SAMR_Q_QUERY_DOMAIN_INFO2 q_u ;
SAMR_R_QUERY_DOMAIN_INFO2 r_u ;
2001-11-28 03:06:00 +03:00
prs_struct * data = & p - > in_data . data ;
prs_struct * rdata = & p - > out_data . rdata ;
ZERO_STRUCT ( q_u ) ;
ZERO_STRUCT ( r_u ) ;
2005-11-19 02:15:47 +03:00
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 " ) ) ;
2001-11-28 03:06:00 +03:00
return False ;
}
2005-11-19 02:15:47 +03:00
r_u . status = _samr_query_domain_info2 ( p , & q_u , & r_u ) ;
2001-11-28 03:06:00 +03:00
/* store the response in the SMB stream */
2006-05-05 12:04:28 +04:00
if ( ! samr_io_r_query_domain_info2 ( " " , & r_u , rdata , 0 ) ) {
2005-11-19 02:15:47 +03:00
DEBUG ( 0 , ( " api_samr_query_domain_info2: unable to marshall SAMR_R_QUERY_DOMAIN_INFO2. \n " ) ) ;
2001-11-28 03:06:00 +03:00
return False ;
}
return True ;
}
/*******************************************************************
api_samr_set_dom_info
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-10-19 04:40:25 +04:00
static bool api_samr_set_dom_info ( pipes_struct * p )
2001-11-28 03:06:00 +03:00
{
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 ;
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
array of \ PIPE \ samr operations
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-03-11 03:32:10 +03:00
2003-08-15 01:14:28 +04:00
static struct api_struct api_samr_cmds [ ] =
1998-03-12 00:11:04 +03:00
{
2003-02-14 03:48:28 +03:00
{ " 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 } ,
2006-05-05 12:04:28 +04:00
{ " SAMR_QUERY_DOMAIN_INFO " , SAMR_QUERY_DOMAIN_INFO , api_samr_query_domain_info } ,
2003-02-14 03:48:28 +03:00
{ " 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 } ,
2007-10-11 00:34:30 +04:00
{ " SAMR_QUERY_DISPINFO4 " , SAMR_QUERY_DISPINFO4 , api_samr_query_dispinfo } ,
2003-02-14 03:48:28 +03:00
{ " 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 } ,
2003-12-04 06:35:46 +03:00
{ " SAMR_REMOVE_SID_FOREIGN_DOMAIN " , SAMR_REMOVE_SID_FOREIGN_DOMAIN , api_samr_remove_sid_foreign_domain } ,
2003-02-14 03:48:28 +03:00
{ " 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 } ,
2005-11-19 02:15:47 +03:00
{ " SAMR_QUERY_DOMAIN_INFO2 " , SAMR_QUERY_DOMAIN_INFO2 , api_samr_query_domain_info2 } ,
2003-02-14 03:48:28 +03:00
{ " SAMR_SET_DOMAIN_INFO " , SAMR_SET_DOMAIN_INFO , api_samr_set_dom_info } ,
2005-11-18 01:40:10 +03:00
{ " SAMR_CONNECT4 " , SAMR_CONNECT4 , api_samr_connect4 } ,
2006-02-11 02:09:00 +03:00
{ " SAMR_CHGPASSWD_USER3 " , SAMR_CHGPASSWD_USER3 , api_samr_chgpasswd_user3 } ,
2005-11-18 01:40:10 +03:00
{ " SAMR_CONNECT5 " , SAMR_CONNECT5 , api_samr_connect5 }
2003-08-15 01:14:28 +04:00
} ;
2008-01-30 14:53:09 +03:00
void samr2_get_pipe_fns ( struct api_struct * * fns , int * n_fns )
2003-08-15 01:14:28 +04:00
{
* fns = api_samr_cmds ;
* n_fns = sizeof ( api_samr_cmds ) / sizeof ( struct api_struct ) ;
}
2008-01-30 14:53:09 +03:00
NTSTATUS rpc_samr2_init ( void )
2003-08-15 01:14:28 +04:00
{
2003-04-28 21:48:48 +04:00
return rpc_pipe_register_commands ( SMB_RPC_INTERFACE_VERSION , " samr " , " lsass " , api_samr_cmds ,
2003-02-14 03:48:28 +03:00
sizeof ( api_samr_cmds ) / sizeof ( struct api_struct ) ) ;
1998-03-12 00:11:04 +03:00
}