1998-03-12 00:11:04 +03:00
/*
* Unix SMB / Netbios implementation .
* Version 1.9 .
* RPC Pipe client / server routines
* Copyright ( C ) Andrew Tridgell 1992 - 1997 ,
* Copyright ( C ) Luke Kenneth Casson Leighton 1996 - 1997 ,
* Copyright ( C ) Paul Ashton 1997.
2000-03-21 21:33:08 +03:00
* Copyright ( C ) Hewlett - Packard Company 1999.
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
* the Free Software Foundation ; either version 2 of the License , or
* ( 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
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 675 Mass Ave , Cambridge , MA 0213 9 , USA .
*/
# include "includes.h"
extern int DEBUGLEVEL ;
1999-12-13 16:27:58 +03:00
extern fstring global_myworkgroup ;
1998-10-22 01:11:16 +04:00
extern pstring global_myname ;
1998-10-22 02:36:26 +04:00
extern DOM_SID global_sam_sid ;
1999-12-13 16:27:58 +03:00
extern rid_name domain_group_rids [ ] ;
extern rid_name domain_alias_rids [ ] ;
extern rid_name builtin_alias_rids [ ] ;
1998-05-14 07:32:21 +04:00
1998-03-12 00:11:04 +03:00
/*******************************************************************
This next function should be replaced with something that
dynamically returns the correct user info . . . . . JRA .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1998-05-07 22:19:05 +04:00
static BOOL get_sampwd_entries ( SAM_USER_INFO_21 * pw_buf ,
1998-10-21 22:06:46 +04:00
int start_idx ,
1998-03-12 00:11:04 +03:00
int * total_entries , int * num_entries ,
int max_num_entries ,
uint16 acb_mask )
{
1998-04-14 04:41:59 +04:00
void * vp = NULL ;
1998-09-25 00:02:56 +04:00
struct sam_passwd * pwd = NULL ;
1998-05-06 21:43:44 +04:00
( * num_entries ) = 0 ;
( * total_entries ) = 0 ;
if ( pw_buf = = NULL ) return False ;
1998-05-19 01:30:57 +04:00
vp = startsmbpwent ( False ) ;
2000-03-21 21:33:08 +03:00
if ( ! vp ) {
1998-05-19 01:30:57 +04:00
DEBUG ( 0 , ( " get_sampwd_entries: Unable to open SMB password database. \n " ) ) ;
1998-05-06 21:43:44 +04:00
return False ;
}
2000-03-21 21:33:08 +03:00
while ( ( ( pwd = getsam21pwent ( vp ) ) ! = NULL ) & & ( * num_entries ) < max_num_entries ) {
1998-10-21 22:06:46 +04:00
int user_name_len ;
2000-03-21 21:33:08 +03:00
if ( start_idx > 0 ) {
1998-10-21 22:06:46 +04:00
/* skip the requested number of entries.
not very efficient , but hey . . .
*/
1999-12-13 16:27:58 +03:00
start_idx - - ;
1998-10-21 22:06:46 +04:00
continue ;
}
1999-12-13 16:27:58 +03:00
user_name_len = strlen ( pwd - > smb_name ) ;
init_unistr2 ( & ( pw_buf [ ( * num_entries ) ] . uni_user_name ) , pwd - > smb_name , user_name_len ) ;
init_uni_hdr ( & ( pw_buf [ ( * num_entries ) ] . hdr_user_name ) , user_name_len ) ;
1998-09-25 00:02:56 +04:00
pw_buf [ ( * num_entries ) ] . user_rid = pwd - > user_rid ;
1999-12-13 16:27:58 +03:00
memset ( ( char * ) pw_buf [ ( * num_entries ) ] . nt_pwd , ' \0 ' , 16 ) ;
1998-05-06 21:43:44 +04:00
/* Now check if the NT compatible password is available. */
2000-03-21 21:33:08 +03:00
if ( pwd - > smb_nt_passwd ! = NULL ) {
1998-05-06 21:43:44 +04:00
memcpy ( pw_buf [ ( * num_entries ) ] . nt_pwd , pwd - > smb_nt_passwd , 16 ) ;
}
pw_buf [ ( * num_entries ) ] . acb_info = ( uint16 ) pwd - > acct_ctrl ;
1998-09-25 00:02:56 +04:00
DEBUG ( 5 , ( " entry idx: %d user %s, rid 0x%x, acb %x " ,
1999-12-13 16:27:58 +03:00
( * num_entries ) , pwd - > smb_name ,
1998-10-15 09:47:29 +04:00
pwd - > user_rid , pwd - > acct_ctrl ) ) ;
1998-05-06 21:43:44 +04:00
2000-03-21 21:33:08 +03:00
if ( acb_mask = = 0 | | IS_BITS_SET_SOME ( pwd - > acct_ctrl , acb_mask ) ) {
1998-05-06 21:43:44 +04:00
DEBUG ( 5 , ( " acb_mask %x accepts \n " , acb_mask ) ) ;
( * num_entries ) + + ;
2000-03-21 21:33:08 +03:00
} else {
1998-05-06 21:43:44 +04:00
DEBUG ( 5 , ( " acb_mask %x rejects \n " , acb_mask ) ) ;
}
( * total_entries ) + + ;
}
1998-05-19 01:30:57 +04:00
endsmbpwent ( vp ) ;
1998-05-06 21:43:44 +04:00
return ( * num_entries ) > 0 ;
1998-03-12 00:11:04 +03:00
}
2000-03-21 21:33:08 +03:00
/*******************************************************************
This function uses the username map file and tries to map a UNIX
user name to an DOS name . ( Sort of the reverse of the
map_username ( ) function . ) Since more than one DOS name can map
to the UNIX name , to reverse the mapping you have to specify
which corresponding DOS name you want ; that ' s where the name_idx
parameter comes in . Returns the string requested or NULL if it
fails or can ' t complete the request for any reason . This doesn ' t
handle group names ( starting with ' @ ' ) or names starting with
' + ' or ' & ' . If they are encountered , they are skipped .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static char * unmap_unixname ( char * unix_user_name , int name_idx )
{
FILE * f ;
char * mapfile = lp_username_map ( ) ;
char * s ;
pstring buf ;
static pstring tok ;
if ( ! * unix_user_name ) return NULL ;
if ( ! * mapfile ) return NULL ;
f = sys_fopen ( mapfile , " r " ) ;
if ( ! f ) {
DEBUG ( 0 , ( " unmap_unixname: can't open username map %s \n " , mapfile ) ) ;
return NULL ;
}
DEBUG ( 5 , ( " unmap_unixname: scanning username map %s, index: %d \n " , mapfile , name_idx ) ) ;
while ( ( s = fgets_slash ( buf , sizeof ( buf ) , f ) ) ! = NULL ) {
char * unixname = s ;
char * dosname = strchr ( unixname , ' = ' ) ;
if ( ! dosname )
continue ;
* dosname + + = 0 ;
while ( isspace ( * unixname ) )
unixname + + ;
if ( ' ! ' = = * unixname ) {
unixname + + ;
while ( * unixname & & isspace ( * unixname ) )
unixname + + ;
}
if ( ! * unixname | | strchr ( " #; " , * unixname ) )
continue ;
if ( strncmp ( unixname , unix_user_name , strlen ( unix_user_name ) ) )
continue ;
/* We have matched the UNIX user name */
while ( next_token ( & dosname , tok , LIST_SEP , sizeof ( tok ) ) ) {
if ( ! strchr ( " @&+ " , * tok ) ) {
name_idx - - ;
if ( name_idx < 0 ) {
break ;
}
}
}
if ( name_idx > = 0 ) {
DEBUG ( 0 , ( " unmap_unixname: index too high - not that many DOS names \n " ) ) ;
fclose ( f ) ;
return NULL ;
} else {
fclose ( f ) ;
return tok ;
}
}
DEBUG ( 0 , ( " unmap_unixname: Couldn't find the UNIX user name \n " ) ) ;
fclose ( f ) ;
return NULL ;
}
/*******************************************************************
This function sets up a list of users taken from the list of
users that UNIX knows about , as well as all the user names that
Samba maps to a valid UNIX user name . ( This should work with
/ etc / passwd or NIS . )
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL get_passwd_entries ( SAM_USER_INFO_21 * pw_buf ,
int start_idx ,
int * total_entries , int * num_entries ,
int max_num_entries ,
uint16 acb_mask )
{
static struct passwd * pwd = NULL ;
static uint32 pw_rid ;
static BOOL orig_done = False ;
static int current_idx = 0 ;
static int mapped_idx = 0 ;
DEBUG ( 5 , ( " get_passwd_entries: retrieving a list of UNIX users \n " ) ) ;
( * num_entries ) = 0 ;
( * total_entries ) = 0 ;
if ( pw_buf = = NULL ) return False ;
if ( current_idx = = 0 ) {
setpwent ( ) ;
}
/* These two cases are inefficient, but should be called very rarely */
/* they are the cases where the starting index isn't picking up */
/* where we left off last time. It is efficient when it starts over */
/* at zero though. */
if ( start_idx > current_idx ) {
/* We aren't far enough; advance to start_idx */
while ( current_idx < start_idx ) {
char * unmap_name ;
if ( ! orig_done ) {
if ( ( pwd = getpwent ( ) ) = = NULL ) break ;
current_idx + + ;
orig_done = True ;
}
while ( ( ( unmap_name = unmap_unixname ( pwd - > pw_name , mapped_idx ) ) ! = NULL ) & &
( current_idx < start_idx ) ) {
current_idx + + ;
mapped_idx + + ;
}
if ( unmap_name = = NULL ) {
orig_done = False ;
mapped_idx = 0 ;
}
}
} else if ( start_idx < current_idx ) {
/* We are already too far; start over and advance to start_idx */
endpwent ( ) ;
setpwent ( ) ;
current_idx = 0 ;
mapped_idx = 0 ;
orig_done = False ;
while ( current_idx < start_idx ) {
char * unmap_name ;
if ( ! orig_done ) {
if ( ( pwd = getpwent ( ) ) = = NULL ) break ;
current_idx + + ;
orig_done = True ;
}
while ( ( ( unmap_name = unmap_unixname ( pwd - > pw_name , mapped_idx ) ) ! = NULL ) & &
( current_idx < start_idx ) ) {
current_idx + + ;
mapped_idx + + ;
}
if ( unmap_name = = NULL ) {
orig_done = False ;
mapped_idx = 0 ;
}
}
}
/* now current_idx == start_idx */
while ( ( * num_entries ) < max_num_entries ) {
int user_name_len ;
char * unmap_name ;
/* This does the original UNIX user itself */
if ( ! orig_done ) {
if ( ( pwd = getpwent ( ) ) = = NULL ) break ;
user_name_len = strlen ( pwd - > pw_name ) ;
pw_rid = pdb_uid_to_user_rid ( pwd - > pw_uid ) ;
init_unistr2 ( & ( pw_buf [ ( * num_entries ) ] . uni_user_name ) , pwd - > pw_name , user_name_len ) ;
init_uni_hdr ( & ( pw_buf [ ( * num_entries ) ] . hdr_user_name ) , user_name_len ) ;
pw_buf [ ( * num_entries ) ] . user_rid = pw_rid ;
memset ( ( char * ) pw_buf [ ( * num_entries ) ] . nt_pwd , ' \0 ' , 16 ) ;
pw_buf [ ( * num_entries ) ] . acb_info = ACB_NORMAL ;
DEBUG ( 5 , ( " get_passwd_entries: entry idx %d user %s, rid 0x%x \n " , ( * num_entries ) , pwd - > pw_name , pw_rid ) ) ;
( * num_entries ) + + ;
( * total_entries ) + + ;
current_idx + + ;
orig_done = True ;
}
/* This does all the user names that map to the UNIX user */
while ( ( ( unmap_name = unmap_unixname ( pwd - > pw_name , mapped_idx ) ) ! = NULL ) & &
( * num_entries < max_num_entries ) ) {
user_name_len = strlen ( unmap_name ) ;
init_unistr2 ( & ( pw_buf [ ( * num_entries ) ] . uni_user_name ) , unmap_name , user_name_len ) ;
init_uni_hdr ( & ( pw_buf [ ( * num_entries ) ] . hdr_user_name ) , user_name_len ) ;
pw_buf [ ( * num_entries ) ] . user_rid = pw_rid ;
memset ( ( char * ) pw_buf [ ( * num_entries ) ] . nt_pwd , ' \0 ' , 16 ) ;
pw_buf [ ( * num_entries ) ] . acb_info = ACB_NORMAL ;
DEBUG ( 5 , ( " get_passwd_entries: entry idx %d user %s, rid 0x%x \n " , ( * num_entries ) , pwd - > pw_name , pw_rid ) ) ;
( * num_entries ) + + ;
( * total_entries ) + + ;
current_idx + + ;
mapped_idx + + ;
}
if ( unmap_name = = NULL ) {
/* done with 'aliases', go on to next UNIX user */
orig_done = False ;
mapped_idx = 0 ;
}
}
if ( pwd = = NULL ) {
/* totally done, reset everything */
endpwent ( ) ;
current_idx = 0 ;
mapped_idx = 0 ;
}
return ( * num_entries ) > 0 ;
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
samr_reply_unknown_1
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void samr_reply_close_hnd ( SAMR_Q_CLOSE_HND * q_u ,
prs_struct * rdata )
{
SAMR_R_CLOSE_HND r_u ;
/* set up the SAMR unknown_1 response */
1999-12-13 16:27:58 +03:00
memset ( ( char * ) r_u . pol . data , ' \0 ' , POL_HND_SIZE ) ;
1998-03-12 00:11:04 +03:00
/* close the policy handle */
1999-12-13 16:27:58 +03:00
if ( close_lsa_policy_hnd ( & ( q_u - > pol ) ) )
1998-03-12 00:11:04 +03:00
{
r_u . status = 0 ;
}
else
{
r_u . status = 0xC0000000 | NT_STATUS_OBJECT_NAME_INVALID ;
}
DEBUG ( 5 , ( " samr_reply_close_hnd: %d \n " , __LINE__ ) ) ;
/* store the response in the SMB stream */
samr_io_r_close_hnd ( " " , & r_u , rdata , 0 ) ;
DEBUG ( 5 , ( " samr_reply_close_hnd: %d \n " , __LINE__ ) ) ;
}
/*******************************************************************
api_samr_close_hnd
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_close_hnd ( prs_struct * data , prs_struct * rdata )
1998-03-12 00:11:04 +03:00
{
SAMR_Q_CLOSE_HND q_u ;
1999-12-13 16:27:58 +03:00
/* grab the samr unknown 1 */
1998-03-12 00:11:04 +03:00
samr_io_q_close_hnd ( " " , & q_u , data , 0 ) ;
1999-12-13 16:27:58 +03:00
/* construct reply. always indicate success */
1998-03-12 00:11:04 +03:00
samr_reply_close_hnd ( & q_u , rdata ) ;
1999-12-13 16:27:58 +03:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
samr_reply_open_domain
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void samr_reply_open_domain ( SAMR_Q_OPEN_DOMAIN * q_u ,
prs_struct * rdata )
{
SAMR_R_OPEN_DOMAIN r_u ;
BOOL pol_open = False ;
r_u . status = 0x0 ;
/* find the connection policy handle. */
1999-12-13 16:27:58 +03:00
if ( r_u . status = = 0x0 & & ( find_lsa_policy_by_hnd ( & ( q_u - > connect_pol ) ) = = - 1 ) )
1998-03-12 00:11:04 +03:00
{
r_u . status = 0xC0000000 | NT_STATUS_INVALID_HANDLE ;
}
/* get a (unique) handle. open a policy on it. */
1999-12-13 16:27:58 +03:00
if ( r_u . status = = 0x0 & & ! ( pol_open = open_lsa_policy_hnd ( & ( r_u . domain_pol ) ) ) )
1998-03-12 00:11:04 +03:00
{
r_u . status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND ;
}
/* associate the domain SID with the (unique) handle. */
1999-12-13 16:27:58 +03:00
if ( r_u . status = = 0x0 & & ! set_lsa_policy_samr_sid ( & ( r_u . domain_pol ) , & ( q_u - > dom_sid . sid ) ) )
1998-03-12 00:11:04 +03:00
{
/* oh, whoops. don't know what error message to return, here */
r_u . status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND ;
}
if ( r_u . status ! = 0 & & pol_open )
{
1999-12-13 16:27:58 +03:00
close_lsa_policy_hnd ( & ( r_u . domain_pol ) ) ;
1998-03-12 00:11:04 +03:00
}
DEBUG ( 5 , ( " samr_open_domain: %d \n " , __LINE__ ) ) ;
/* store the response in the SMB stream */
samr_io_r_open_domain ( " " , & r_u , rdata , 0 ) ;
DEBUG ( 5 , ( " samr_open_domain: %d \n " , __LINE__ ) ) ;
}
/*******************************************************************
api_samr_open_domain
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_open_domain ( prs_struct * data , prs_struct * rdata )
1998-03-12 00:11:04 +03:00
{
SAMR_Q_OPEN_DOMAIN q_u ;
1999-12-13 16:27:58 +03:00
/* grab the samr open */
1998-03-12 00:11:04 +03:00
samr_io_q_open_domain ( " " , & q_u , data , 0 ) ;
1999-12-13 16:27:58 +03:00
/* construct reply. always indicate success */
1998-03-12 00:11:04 +03:00
samr_reply_open_domain ( & q_u , rdata ) ;
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
/*******************************************************************
samr_reply_unknown_2c
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void samr_reply_unknown_2c ( SAMR_Q_UNKNOWN_2C * q_u ,
prs_struct * rdata )
{
SAMR_R_UNKNOWN_2C r_u ;
uint32 status = 0x0 ;
/* find the policy handle. open a policy on it. */
1999-12-13 16:27:58 +03:00
if ( status = = 0x0 & & ( find_lsa_policy_by_hnd ( & ( q_u - > user_pol ) ) = = - 1 ) )
1998-10-22 01:11:16 +04:00
{
status = 0xC0000000 | NT_STATUS_INVALID_HANDLE ;
}
/* find the user's rid */
1999-12-13 16:27:58 +03:00
if ( ( status = = 0x0 ) & & ( get_lsa_policy_samr_rid ( & ( q_u - > user_pol ) ) = = 0xffffffff ) )
1998-10-22 01:11:16 +04:00
{
1999-12-13 16:27:58 +03:00
status = NT_STATUS_OBJECT_TYPE_MISMATCH ;
1998-10-22 01:11:16 +04:00
}
1999-12-13 16:27:58 +03:00
init_samr_r_unknown_2c ( & r_u , status ) ;
1998-10-22 01:11:16 +04:00
DEBUG ( 5 , ( " samr_unknown_2c: %d \n " , __LINE__ ) ) ;
/* store the response in the SMB stream */
samr_io_r_unknown_2c ( " " , & r_u , rdata , 0 ) ;
DEBUG ( 5 , ( " samr_unknown_2c: %d \n " , __LINE__ ) ) ;
}
/*******************************************************************
api_samr_unknown_2c
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_unknown_2c ( prs_struct * data , prs_struct * rdata )
1998-10-22 01:11:16 +04:00
{
SAMR_Q_UNKNOWN_2C q_u ;
1999-12-13 16:27:58 +03:00
/* grab the samr open */
1998-10-22 01:11:16 +04:00
samr_io_q_unknown_2c ( " " , & q_u , data , 0 ) ;
1999-12-13 16:27:58 +03:00
/* construct reply. always indicate success */
1998-10-22 01:11:16 +04:00
samr_reply_unknown_2c ( & q_u , rdata ) ;
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
/*******************************************************************
samr_reply_unknown_3
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void samr_reply_unknown_3 ( SAMR_Q_UNKNOWN_3 * q_u ,
prs_struct * rdata )
{
SAMR_R_UNKNOWN_3 r_u ;
DOM_SID3 sid [ MAX_SAM_SIDS ] ;
uint32 rid ;
uint32 status ;
status = 0x0 ;
/* find the policy handle. open a policy on it. */
1999-12-13 16:27:58 +03:00
if ( status = = 0x0 & & ( find_lsa_policy_by_hnd ( & ( q_u - > user_pol ) ) = = - 1 ) )
1998-03-12 00:11:04 +03:00
{
status = 0xC0000000 | NT_STATUS_INVALID_HANDLE ;
}
/* find the user's rid */
1999-12-13 16:27:58 +03:00
if ( status = = 0x0 & & ( rid = get_lsa_policy_samr_rid ( & ( q_u - > user_pol ) ) ) = = 0xffffffff )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
status = NT_STATUS_OBJECT_TYPE_MISMATCH ;
1998-03-12 00:11:04 +03:00
}
if ( status = = 0x0 )
{
1999-12-13 16:27:58 +03:00
DOM_SID user_sid ;
DOM_SID everyone_sid ;
1998-05-15 01:10:49 +04:00
1999-12-13 16:27:58 +03:00
user_sid = global_sam_sid ;
1998-08-22 06:54:21 +04:00
1999-12-13 16:27:58 +03:00
SMB_ASSERT_ARRAY ( user_sid . sub_auths , user_sid . num_auths + 1 ) ;
1998-08-22 06:54:21 +04:00
1998-10-22 01:11:16 +04:00
/*
* Add the user RID .
*/
1999-12-13 16:27:58 +03:00
user_sid . sub_auths [ user_sid . num_auths + + ] = rid ;
1998-10-22 01:11:16 +04:00
1999-12-13 16:27:58 +03:00
string_to_sid ( & everyone_sid , " S-1-1 " ) ;
/* maybe need another 1 or 2 (S-1-5-0x20-0x220 and S-1-5-20-0x224) */
/* these two are DOMAIN_ADMIN and DOMAIN_ACCT_OP group RIDs */
init_dom_sid3 ( & ( sid [ 0 ] ) , 0x035b , 0x0002 , & everyone_sid ) ;
init_dom_sid3 ( & ( sid [ 1 ] ) , 0x0044 , 0x0002 , & user_sid ) ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
init_samr_r_unknown_3 ( & r_u ,
1998-03-12 00:11:04 +03:00
0x0001 , 0x8004 ,
0x00000014 , 0x0002 , 0x0070 ,
2 , sid , status ) ;
DEBUG ( 5 , ( " samr_unknown_3: %d \n " , __LINE__ ) ) ;
/* store the response in the SMB stream */
samr_io_r_unknown_3 ( " " , & r_u , rdata , 0 ) ;
DEBUG ( 5 , ( " samr_unknown_3: %d \n " , __LINE__ ) ) ;
}
/*******************************************************************
api_samr_unknown_3
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_unknown_3 ( prs_struct * data , prs_struct * rdata )
1998-03-12 00:11:04 +03:00
{
SAMR_Q_UNKNOWN_3 q_u ;
1999-12-13 16:27:58 +03:00
/* grab the samr open */
1998-03-12 00:11:04 +03:00
samr_io_q_unknown_3 ( " " , & q_u , data , 0 ) ;
1999-12-13 16:27:58 +03:00
/* construct reply. always indicate success */
1998-03-12 00:11:04 +03:00
samr_reply_unknown_3 ( & q_u , rdata ) ;
1999-12-13 16:27:58 +03:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
samr_reply_enum_dom_users
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void samr_reply_enum_dom_users ( SAMR_Q_ENUM_DOM_USERS * q_u ,
prs_struct * rdata )
{
SAMR_R_ENUM_DOM_USERS r_e ;
SAM_USER_INFO_21 pass [ MAX_SAM_ENTRIES ] ;
int num_entries ;
int total_entries ;
r_e . status = 0x0 ;
1999-12-13 16:27:58 +03:00
r_e . total_num_entries = 0 ;
1998-03-12 00:11:04 +03:00
/* find the policy handle. open a policy on it. */
1999-12-13 16:27:58 +03:00
if ( r_e . status = = 0x0 & & ( find_lsa_policy_by_hnd ( & ( q_u - > pol ) ) = = - 1 ) )
1998-03-12 00:11:04 +03:00
{
r_e . status = 0xC0000000 | NT_STATUS_INVALID_HANDLE ;
}
DEBUG ( 5 , ( " samr_reply_enum_dom_users: %d \n " , __LINE__ ) ) ;
become_root ( True ) ;
1999-12-13 16:27:58 +03:00
get_sampwd_entries ( pass , 0 , & total_entries , & num_entries , MAX_SAM_ENTRIES , q_u - > acb_mask ) ;
1998-03-12 00:11:04 +03:00
unbecome_root ( True ) ;
1999-12-13 16:27:58 +03:00
init_samr_r_enum_dom_users ( & r_e , total_entries ,
q_u - > unknown_0 , num_entries ,
1998-03-12 00:11:04 +03:00
pass , r_e . status ) ;
/* store the response in the SMB stream */
samr_io_r_enum_dom_users ( " " , & r_e , rdata , 0 ) ;
DEBUG ( 5 , ( " samr_enum_dom_users: %d \n " , __LINE__ ) ) ;
}
/*******************************************************************
api_samr_enum_dom_users
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_enum_dom_users ( prs_struct * data , prs_struct * rdata )
1998-03-12 00:11:04 +03:00
{
SAMR_Q_ENUM_DOM_USERS q_e ;
1999-12-13 16:27:58 +03:00
/* grab the samr open */
1998-03-12 00:11:04 +03:00
samr_io_q_enum_dom_users ( " " , & q_e , data , 0 ) ;
1999-12-13 16:27:58 +03:00
/* construct reply. */
1998-03-12 00:11:04 +03:00
samr_reply_enum_dom_users ( & q_e , rdata ) ;
1999-12-13 16:27:58 +03:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
samr_reply_enum_dom_groups
- 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
static void samr_reply_enum_dom_groups ( SAMR_Q_ENUM_DOM_GROUPS * q_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
prs_struct * rdata )
{
1999-12-13 16:27:58 +03:00
SAMR_R_ENUM_DOM_GROUPS r_e ;
SAM_USER_INFO_21 pass [ MAX_SAM_ENTRIES ] ;
int num_entries ;
BOOL got_grps ;
char * dummy_group = " Domain Admins " ;
- 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
r_e . status = 0x0 ;
1999-12-13 16:27:58 +03:00
r_e . num_entries = 0 ;
- 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
/* find the policy handle. open a policy on it. */
1999-12-13 16:27:58 +03:00
if ( r_e . status = = 0x0 & & ( find_lsa_policy_by_hnd ( & ( q_u - > pol ) ) = = - 1 ) )
- 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
{
r_e . status = 0xC0000000 | NT_STATUS_INVALID_HANDLE ;
}
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_reply_enum_dom_groups: %d \n " , __LINE__ ) ) ;
- 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
got_grps = True ;
num_entries = 1 ;
init_unistr2 ( & ( pass [ 0 ] . uni_user_name ) , dummy_group , strlen ( dummy_group ) ) ;
pass [ 0 ] . user_rid = DOMAIN_GROUP_RID_ADMINS ;
- 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
if ( r_e . status = = 0 & & got_grps )
{
init_samr_r_enum_dom_groups ( & r_e , q_u - > start_idx , num_entries , pass , r_e . status ) ;
- 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 */
1999-12-13 16:27:58 +03:00
samr_io_r_enum_dom_groups ( " " , & r_e , rdata , 0 ) ;
DEBUG ( 5 , ( " samr_enum_dom_groups: %d \n " , __LINE__ ) ) ;
- 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
api_samr_enum_dom_groups
- 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
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_enum_dom_groups ( prs_struct * data , prs_struct * 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
{
1999-12-13 16:27:58 +03:00
SAMR_Q_ENUM_DOM_GROUPS q_e ;
/* grab the samr open */
samr_io_q_enum_dom_groups ( " " , & q_e , data , 0 ) ;
/* construct reply. */
samr_reply_enum_dom_groups ( & q_e , rdata ) ;
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
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
samr_reply_enum_dom_aliases
- 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
static void samr_reply_enum_dom_aliases ( SAMR_Q_ENUM_DOM_ALIASES * q_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
prs_struct * rdata )
{
1999-12-13 16:27:58 +03:00
SAMR_R_ENUM_DOM_ALIASES r_e ;
SAM_USER_INFO_21 pass [ MAX_SAM_ENTRIES ] ;
int num_entries = 0 ;
DOM_SID sid ;
fstring sid_str ;
fstring sam_sid_str ;
2000-03-21 21:33:08 +03:00
struct group * grp ;
- 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
r_e . status = 0x0 ;
1999-12-13 16:27:58 +03:00
r_e . num_entries = 0 ;
- 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
/* find the policy handle. open a policy on it. */
1999-12-13 16:27:58 +03:00
if ( r_e . status = = 0x0 & & ! get_lsa_policy_samr_sid ( & q_u - > pol , & sid ) )
- 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
{
r_e . status = 0xC0000000 | NT_STATUS_INVALID_HANDLE ;
}
1999-12-13 16:27:58 +03:00
sid_to_string ( sid_str , & sid ) ;
sid_to_string ( sam_sid_str , & global_sam_sid ) ;
- 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
DEBUG ( 5 , ( " samr_reply_enum_dom_aliases: sid %s \n " , sid_str ) ) ;
- 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
/* well-known aliases */
if ( strequal ( sid_str , " S-1-5-32 " ) )
{
char * name ;
while ( num_entries < MAX_SAM_ENTRIES & & ( ( name = builtin_alias_rids [ num_entries ] . name ) ! = NULL ) )
- 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
init_unistr2 ( & ( pass [ num_entries ] . uni_user_name ) , name , strlen ( name ) ) ;
pass [ num_entries ] . user_rid = builtin_alias_rids [ num_entries ] . rid ;
num_entries + + ;
- 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
else if ( strequal ( sid_str , sam_sid_str ) )
{
2000-03-21 21:33:08 +03:00
char * name ;
1999-12-13 16:27:58 +03:00
/* local aliases */
2000-03-21 21:33:08 +03:00
/* we return the UNIX groups here. This seems to be the right */
/* thing to do, since NT member servers return their local */
/* groups in the same situation. */
setgrent ( ) ;
while ( num_entries < MAX_SAM_ENTRIES & & ( ( grp = getgrent ( ) ) ! = NULL ) )
{
name = grp - > gr_name ;
init_unistr2 ( & ( pass [ num_entries ] . uni_user_name ) , name , strlen ( name ) ) ;
pass [ num_entries ] . user_rid = pdb_gid_to_group_rid ( grp - > gr_gid ) ;
num_entries + + ;
}
endgrent ( ) ;
1999-12-13 16:27:58 +03:00
}
init_samr_r_enum_dom_aliases ( & r_e , num_entries , pass , r_e . status ) ;
- 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 */
1999-12-13 16:27:58 +03:00
samr_io_r_enum_dom_aliases ( " " , & r_e , rdata , 0 ) ;
DEBUG ( 5 , ( " samr_enum_dom_aliases: %d \n " , __LINE__ ) ) ;
- 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
api_samr_enum_dom_aliases
- 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
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_enum_dom_aliases ( prs_struct * data , prs_struct * 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
{
1999-12-13 16:27:58 +03:00
SAMR_Q_ENUM_DOM_ALIASES q_e ;
/* grab the samr open */
samr_io_q_enum_dom_aliases ( " " , & q_e , data , 0 ) ;
/* construct reply. */
samr_reply_enum_dom_aliases ( & q_e , rdata ) ;
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
}
1999-12-13 16:27:58 +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
/*******************************************************************
1999-12-13 16:27:58 +03:00
samr_reply_query_dispinfo
- 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
static void samr_reply_query_dispinfo ( SAMR_Q_QUERY_DISPINFO * q_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
prs_struct * rdata )
{
1999-12-13 16:27:58 +03:00
SAMR_R_QUERY_DISPINFO r_e ;
SAM_INFO_CTR ctr ;
SAM_INFO_1 info1 ;
SAM_INFO_2 info2 ;
SAM_USER_INFO_21 pass [ MAX_SAM_ENTRIES ] ;
int num_entries = 0 ;
int total_entries = 0 ;
BOOL got_pwds ;
uint16 switch_level = 0x0 ;
ZERO_STRUCT ( r_e ) ;
- 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
r_e . status = 0x0 ;
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_reply_query_dispinfo: %d \n " , __LINE__ ) ) ;
- 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
/* find the policy handle. open a policy on it. */
1999-12-13 16:27:58 +03:00
if ( r_e . status = = 0x0 & & ( find_lsa_policy_by_hnd ( & ( q_u - > pol ) ) = = - 1 ) )
- 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
{
r_e . status = 0xC0000000 | NT_STATUS_INVALID_HANDLE ;
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_reply_query_dispinfo: invalid handle \n " ) ) ;
- 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
}
if ( r_e . status = = 0x0 )
{
1999-12-13 16:27:58 +03:00
become_root ( True ) ;
2000-03-22 22:03:12 +03:00
got_pwds = get_passwd_entries ( pass , q_u - > start_idx , & total_entries , & num_entries , MAX_SAM_ENTRIES , 0 ) ;
1999-12-13 16:27:58 +03:00
unbecome_root ( 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
1999-12-13 16:27:58 +03:00
switch ( q_u - > switch_level )
- 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
case 0x1 :
{
/* query disp info is for users */
switch_level = 0x1 ;
init_sam_info_1 ( & info1 , ACB_NORMAL ,
q_u - > start_idx , num_entries , pass ) ;
- 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
ctr . sam . info1 = & info1 ;
- 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
break ;
}
case 0x2 :
{
/* query disp info is for servers */
switch_level = 0x2 ;
init_sam_info_2 ( & info2 , ACB_WSTRUST ,
q_u - > start_idx , num_entries , pass ) ;
ctr . sam . info2 = & info2 ;
break ;
}
- 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
}
}
2000-03-21 21:33:08 +03:00
if ( r_e . status = = 0 )
1999-12-13 16:27:58 +03:00
{
init_samr_r_query_dispinfo ( & r_e , switch_level , & ctr , r_e . status ) ;
}
- 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 */
1999-12-13 16:27:58 +03:00
samr_io_r_query_dispinfo ( " " , & r_e , rdata , 0 ) ;
DEBUG ( 5 , ( " samr_query_dispinfo: %d \n " , __LINE__ ) ) ;
- 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
api_samr_query_dispinfo
- 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
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_query_dispinfo ( prs_struct * data , prs_struct * 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
{
1999-12-13 16:27:58 +03:00
SAMR_Q_QUERY_DISPINFO q_e ;
/* grab the samr open */
samr_io_q_query_dispinfo ( " " , & q_e , data , 0 ) ;
/* construct reply. */
samr_reply_query_dispinfo ( & q_e , rdata ) ;
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
}
1999-12-13 16:27:58 +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
/*******************************************************************
1999-12-13 16:27:58 +03:00
samr_reply_query_aliasinfo
- 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
static void samr_reply_query_aliasinfo ( SAMR_Q_QUERY_ALIASINFO * q_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
prs_struct * rdata )
{
1999-12-13 16:27:58 +03:00
SAMR_R_QUERY_ALIASINFO r_e ;
- 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
r_e . status = 0x0 ;
1999-12-13 16:27:58 +03:00
r_e . ptr = 0 ;
- 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
/* find the policy handle. open a policy on it. */
1999-12-13 16:27:58 +03:00
if ( r_e . status = = 0x0 & & ( find_lsa_policy_by_hnd ( & ( q_u - > pol ) ) = = - 1 ) )
- 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
{
r_e . status = 0xC0000000 | NT_STATUS_INVALID_HANDLE ;
}
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_reply_query_aliasinfo: %d \n " , __LINE__ ) ) ;
- 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
if ( r_e . status = = 0x0 )
{
1999-12-13 16:27:58 +03:00
if ( q_u - > switch_level ! = 3 )
- 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
r_e . status = NT_STATUS_INVALID_INFO_CLASS ;
- 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
init_samr_r_query_aliasinfo ( & r_e , q_u - > switch_level ,
2000-03-21 21:33:08 +03:00
" local UNIX group " ,
1999-12-13 16:27:58 +03:00
r_e . status ) ;
- 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 */
1999-12-13 16:27:58 +03:00
samr_io_r_query_aliasinfo ( " " , & r_e , rdata , 0 ) ;
DEBUG ( 5 , ( " samr_query_aliasinfo: %d \n " , __LINE__ ) ) ;
- 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
api_samr_query_aliasinfo
- 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
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_query_aliasinfo ( prs_struct * data , prs_struct * 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
{
1999-12-13 16:27:58 +03:00
SAMR_Q_QUERY_ALIASINFO q_e ;
/* grab the samr open */
samr_io_q_query_aliasinfo ( " " , & q_e , data , 0 ) ;
/* construct reply. */
samr_reply_query_aliasinfo ( & q_e , rdata ) ;
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
}
1999-12-13 16:27:58 +03:00
1999-11-16 02:46:27 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
samr_reply_lookup_ids
1999-11-16 02:46:27 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
static void samr_reply_lookup_ids ( SAMR_Q_LOOKUP_IDS * q_u ,
1999-11-16 02:46:27 +03:00
prs_struct * rdata )
{
1999-12-13 16:27:58 +03:00
uint32 rid [ MAX_SAM_ENTRIES ] ;
uint32 status = 0 ;
int num_rids = q_u - > num_sids1 ;
1999-11-16 02:46:27 +03:00
1999-12-13 16:27:58 +03:00
SAMR_R_LOOKUP_IDS r_u ;
1999-11-16 02:46:27 +03:00
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_lookup_ids: %d \n " , __LINE__ ) ) ;
1999-11-16 02:46:27 +03:00
1999-12-13 16:27:58 +03:00
if ( num_rids > MAX_SAM_ENTRIES )
1999-11-16 02:46:27 +03:00
{
1999-12-13 16:27:58 +03:00
num_rids = MAX_SAM_ENTRIES ;
DEBUG ( 5 , ( " samr_lookup_ids: truncating entries to %d \n " , num_rids ) ) ;
1999-11-16 02:46:27 +03:00
}
1999-12-13 16:27:58 +03:00
#if 0
int i ;
SMB_ASSERT_ARRAY ( q_u - > uni_user_name , num_rids ) ;
1999-11-16 02:46:27 +03:00
1999-12-13 16:27:58 +03:00
for ( i = 0 ; i < num_rids & & status = = 0 ; i + + )
1999-11-16 02:46:27 +03:00
{
1999-12-13 16:27:58 +03:00
struct sam_passwd * sam_pass ;
fstring user_name ;
1999-11-16 02:46:27 +03:00
1999-12-13 16:27:58 +03:00
fstrcpy ( user_name , unistrn2 ( q_u - > uni_user_name [ i ] . buffer ,
q_u - > uni_user_name [ i ] . uni_str_len ) ) ;
1999-11-16 02:46:27 +03:00
1999-12-13 16:27:58 +03:00
/* find the user account */
become_root ( True ) ;
sam_pass = get_smb21pwd_entry ( user_name , 0 ) ;
unbecome_root ( True ) ;
1999-11-16 02:46:27 +03:00
1999-12-13 16:27:58 +03:00
if ( sam_pass = = NULL )
{
status = 0xC0000000 | NT_STATUS_NO_SUCH_USER ;
rid [ i ] = 0 ;
}
else
{
rid [ i ] = sam_pass - > user_rid ;
}
1999-11-16 02:46:27 +03:00
}
1999-12-13 16:27:58 +03:00
# endif
1999-11-16 02:46:27 +03:00
1999-12-13 16:27:58 +03:00
num_rids = 1 ;
rid [ 0 ] = BUILTIN_ALIAS_RID_USERS ;
init_samr_r_lookup_ids ( & r_u , num_rids , rid , status ) ;
/* store the response in the SMB stream */
samr_io_r_lookup_ids ( " " , & r_u , rdata , 0 ) ;
DEBUG ( 5 , ( " samr_lookup_ids: %d \n " , __LINE__ ) ) ;
1999-11-16 02:46:27 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
api_samr_lookup_ids
1999-11-16 02:46:27 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_lookup_ids ( prs_struct * data , prs_struct * rdata )
1999-11-16 02:46:27 +03:00
{
1999-12-13 16:27:58 +03:00
SAMR_Q_LOOKUP_IDS q_u ;
1999-11-16 02:46:27 +03:00
1999-12-13 16:27:58 +03:00
/* grab the samr 0x10 */
samr_io_q_lookup_ids ( " " , & q_u , data , 0 ) ;
1999-11-16 02:46:27 +03:00
1999-12-13 16:27:58 +03:00
/* construct reply. always indicate success */
samr_reply_lookup_ids ( & q_u , rdata ) ;
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
/*******************************************************************
1999-12-13 16:27:58 +03:00
samr_reply_lookup_names
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
static BOOL samr_reply_lookup_names ( SAMR_Q_LOOKUP_NAMES * q_u ,
1998-03-12 00:11:04 +03:00
prs_struct * rdata )
{
1999-12-13 16:27:58 +03:00
uint32 rid [ MAX_SAM_ENTRIES ] ;
uint8 type [ MAX_SAM_ENTRIES ] ;
uint32 status = 0 ;
int i ;
int num_rids = q_u - > num_names1 ;
DOM_SID pol_sid ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
SAMR_R_LOOKUP_NAMES r_u ;
- group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.
- interactive debug detection
- re-added mem_man (andrew's memory management, detects memory corruption)
- american spellings of "initialise" replaced with english spelling of
"initialise".
- started on "lookup_name()" and "lookup_sid()" functions. proper ones.
- moved lots of functions around. created some modules of commonly used
code. e.g the password file locking code, which is used in groupfile.c
and aliasfile.c and smbpass.c
- moved RID_TYPE_MASK up another bit. this is really unfortunate, but
there is no other "fast" way to identify users from groups from aliases.
i do not believe that this code saves us anything (the multipliers)
and puts us at a disadvantage (reduces the useable rid space).
the designers of NT aren't silly: if they can get away with a user-
interface-speed LsaLookupNames / LsaLookupSids, then so can we. i
spoke with isaac at the cifs conference, the only time for example that
they do a security context check is on file create. certainly not on
individual file reads / writes, which would drastically hit their
performance and ours, too.
- renamed myworkgroup to global_sam_name, amongst other things, when used
in the rpc code. there is also a global_member_name, as we are always
responsible for a SAM database, the scope of which is limited by the role
of the machine (e.g if a member of a workgroup, your SAM is for _local_
logins only, and its name is the name of your server. you even still
have a SID. see LsaQueryInfoPolicy, levels 3 and 5).
- updated functionality of groupname.c to be able to cope with names
like DOMAIN\group and SERVER\alias. used this code to be able to
do aliases as well as groups. this code may actually be better
off being used in username mapping, too.
- created a connect to serverlist function in clientgen.c and used it
in password.c
- initialisation in server.c depends on the role of the server. well,
it does now.
- rpctorture. smbtorture. EXERCISE EXTREME CAUTION.
(This used to be commit 0d21e1e6090b933f396c764af535ca3388a562db)
1998-11-17 19:19:04 +03:00
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_lookup_names: %d \n " , __LINE__ ) ) ;
- group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.
- interactive debug detection
- re-added mem_man (andrew's memory management, detects memory corruption)
- american spellings of "initialise" replaced with english spelling of
"initialise".
- started on "lookup_name()" and "lookup_sid()" functions. proper ones.
- moved lots of functions around. created some modules of commonly used
code. e.g the password file locking code, which is used in groupfile.c
and aliasfile.c and smbpass.c
- moved RID_TYPE_MASK up another bit. this is really unfortunate, but
there is no other "fast" way to identify users from groups from aliases.
i do not believe that this code saves us anything (the multipliers)
and puts us at a disadvantage (reduces the useable rid space).
the designers of NT aren't silly: if they can get away with a user-
interface-speed LsaLookupNames / LsaLookupSids, then so can we. i
spoke with isaac at the cifs conference, the only time for example that
they do a security context check is on file create. certainly not on
individual file reads / writes, which would drastically hit their
performance and ours, too.
- renamed myworkgroup to global_sam_name, amongst other things, when used
in the rpc code. there is also a global_member_name, as we are always
responsible for a SAM database, the scope of which is limited by the role
of the machine (e.g if a member of a workgroup, your SAM is for _local_
logins only, and its name is the name of your server. you even still
have a SID. see LsaQueryInfoPolicy, levels 3 and 5).
- updated functionality of groupname.c to be able to cope with names
like DOMAIN\group and SERVER\alias. used this code to be able to
do aliases as well as groups. this code may actually be better
off being used in username mapping, too.
- created a connect to serverlist function in clientgen.c and used it
in password.c
- initialisation in server.c depends on the role of the server. well,
it does now.
- rpctorture. smbtorture. EXERCISE EXTREME CAUTION.
(This used to be commit 0d21e1e6090b933f396c764af535ca3388a562db)
1998-11-17 19:19:04 +03:00
1999-12-13 16:27:58 +03:00
ZERO_ARRAY ( rid ) ;
ZERO_ARRAY ( type ) ;
- group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.
- interactive debug detection
- re-added mem_man (andrew's memory management, detects memory corruption)
- american spellings of "initialise" replaced with english spelling of
"initialise".
- started on "lookup_name()" and "lookup_sid()" functions. proper ones.
- moved lots of functions around. created some modules of commonly used
code. e.g the password file locking code, which is used in groupfile.c
and aliasfile.c and smbpass.c
- moved RID_TYPE_MASK up another bit. this is really unfortunate, but
there is no other "fast" way to identify users from groups from aliases.
i do not believe that this code saves us anything (the multipliers)
and puts us at a disadvantage (reduces the useable rid space).
the designers of NT aren't silly: if they can get away with a user-
interface-speed LsaLookupNames / LsaLookupSids, then so can we. i
spoke with isaac at the cifs conference, the only time for example that
they do a security context check is on file create. certainly not on
individual file reads / writes, which would drastically hit their
performance and ours, too.
- renamed myworkgroup to global_sam_name, amongst other things, when used
in the rpc code. there is also a global_member_name, as we are always
responsible for a SAM database, the scope of which is limited by the role
of the machine (e.g if a member of a workgroup, your SAM is for _local_
logins only, and its name is the name of your server. you even still
have a SID. see LsaQueryInfoPolicy, levels 3 and 5).
- updated functionality of groupname.c to be able to cope with names
like DOMAIN\group and SERVER\alias. used this code to be able to
do aliases as well as groups. this code may actually be better
off being used in username mapping, too.
- created a connect to serverlist function in clientgen.c and used it
in password.c
- initialisation in server.c depends on the role of the server. well,
it does now.
- rpctorture. smbtorture. EXERCISE EXTREME CAUTION.
(This used to be commit 0d21e1e6090b933f396c764af535ca3388a562db)
1998-11-17 19:19:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! get_lsa_policy_samr_sid ( & q_u - > pol , & pol_sid ) ) {
status = 0xC0000000 | NT_STATUS_OBJECT_TYPE_MISMATCH ;
init_samr_r_lookup_names ( & r_u , 0 , rid , type , status ) ;
if ( ! samr_io_r_lookup_names ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " samr_reply_lookup_names: failed to marshall SAMR_R_LOOKUP_NAMES. \n " ) ) ;
return False ;
- group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.
- interactive debug detection
- re-added mem_man (andrew's memory management, detects memory corruption)
- american spellings of "initialise" replaced with english spelling of
"initialise".
- started on "lookup_name()" and "lookup_sid()" functions. proper ones.
- moved lots of functions around. created some modules of commonly used
code. e.g the password file locking code, which is used in groupfile.c
and aliasfile.c and smbpass.c
- moved RID_TYPE_MASK up another bit. this is really unfortunate, but
there is no other "fast" way to identify users from groups from aliases.
i do not believe that this code saves us anything (the multipliers)
and puts us at a disadvantage (reduces the useable rid space).
the designers of NT aren't silly: if they can get away with a user-
interface-speed LsaLookupNames / LsaLookupSids, then so can we. i
spoke with isaac at the cifs conference, the only time for example that
they do a security context check is on file create. certainly not on
individual file reads / writes, which would drastically hit their
performance and ours, too.
- renamed myworkgroup to global_sam_name, amongst other things, when used
in the rpc code. there is also a global_member_name, as we are always
responsible for a SAM database, the scope of which is limited by the role
of the machine (e.g if a member of a workgroup, your SAM is for _local_
logins only, and its name is the name of your server. you even still
have a SID. see LsaQueryInfoPolicy, levels 3 and 5).
- updated functionality of groupname.c to be able to cope with names
like DOMAIN\group and SERVER\alias. used this code to be able to
do aliases as well as groups. this code may actually be better
off being used in username mapping, too.
- created a connect to serverlist function in clientgen.c and used it
in password.c
- initialisation in server.c depends on the role of the server. well,
it does now.
- rpctorture. smbtorture. EXERCISE EXTREME CAUTION.
(This used to be commit 0d21e1e6090b933f396c764af535ca3388a562db)
1998-11-17 19:19:04 +03:00
}
1999-12-13 16:27:58 +03:00
return True ;
}
1998-11-29 23:03:33 +03:00
1999-12-13 16:27:58 +03:00
if ( num_rids > MAX_SAM_ENTRIES ) {
num_rids = MAX_SAM_ENTRIES ;
DEBUG ( 5 , ( " samr_lookup_names: truncating entries to %d \n " , num_rids ) ) ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
SMB_ASSERT_ARRAY ( q_u - > uni_name , num_rids ) ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
for ( i = 0 ; i < num_rids ; i + + ) {
fstring name ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
status = 0xC0000000 | NT_STATUS_NONE_MAPPED ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
rid [ i ] = 0xffffffff ;
type [ i ] = SID_NAME_UNKNOWN ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
fstrcpy ( name , dos_unistrn2 ( q_u - > uni_name [ i ] . buffer ,
q_u - > uni_name [ i ] . uni_str_len ) ) ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( sid_equal ( & pol_sid , & global_sam_sid ) ) {
DOM_SID sid ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( lookup_local_name ( global_myname , name , & sid , & type [ i ] ) ) {
sid_split_rid ( & sid , & rid [ i ] ) ;
status = 0 ;
}
}
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
init_samr_r_lookup_names ( & r_u , num_rids , rid , type , status ) ;
1998-03-12 00:11:04 +03:00
/* store the response in the SMB stream */
1999-12-13 16:27:58 +03:00
if ( ! samr_io_r_lookup_names ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " samr_reply_lookup_names: failed to marshall SAMR_R_LOOKUP_NAMES. \n " ) ) ;
return False ;
}
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_lookup_names: %d \n " , __LINE__ ) ) ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
api_samr_lookup_names
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_lookup_names ( prs_struct * data , prs_struct * rdata )
1998-10-22 01:11:16 +04:00
{
1999-12-13 16:27:58 +03:00
SAMR_Q_LOOKUP_NAMES q_u ;
1998-10-22 01:11:16 +04:00
1999-12-13 16:27:58 +03:00
memset ( & q_u , ' \0 ' , sizeof ( q_u ) ) ;
1998-10-22 01:11:16 +04:00
1999-12-13 16:27:58 +03:00
/* grab the samr lookup names */
if ( ! samr_io_q_lookup_names ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_lookup_names: failed to unmarshall SAMR_Q_LOOKUP_NAMES. \n " ) ) ;
1998-10-22 01:11:16 +04:00
return False ;
}
1999-12-13 16:27:58 +03:00
/* construct reply. always indicate success */
if ( ! samr_reply_lookup_names ( & q_u , rdata ) )
1998-03-12 00:11:04 +03:00
return False ;
return True ;
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
samr_reply_chgpasswd_user
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
static BOOL samr_reply_chgpasswd_user ( SAMR_Q_CHGPASSWD_USER * q_u ,
1998-03-12 00:11:04 +03:00
prs_struct * rdata )
{
1999-12-13 16:27:58 +03:00
SAMR_R_CHGPASSWD_USER r_u ;
1998-03-12 00:11:04 +03:00
uint32 status = 0x0 ;
1999-12-13 16:27:58 +03:00
fstring user_name ;
fstring wks ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
fstrcpy ( user_name , dos_unistrn2 ( q_u - > uni_user_name . buffer , q_u - > uni_user_name . uni_str_len ) ) ;
fstrcpy ( wks , dos_unistrn2 ( q_u - > uni_dest_host . buffer , q_u - > uni_dest_host . uni_str_len ) ) ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_chgpasswd_user: user: %s wks: %s \n " , user_name , wks ) ) ;
1998-09-25 00:02:56 +04:00
1999-12-13 16:27:58 +03:00
if ( ! pass_oem_change ( user_name ,
q_u - > lm_newpass . pass , q_u - > lm_oldhash . hash ,
q_u - > nt_newpass . pass , q_u - > nt_oldhash . hash ) )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
status = 0xC0000000 | NT_STATUS_WRONG_PASSWORD ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
init_samr_r_chgpasswd_user ( & r_u , status ) ;
1998-03-12 00:11:04 +03:00
/* store the response in the SMB stream */
1999-12-13 16:27:58 +03:00
if ( ! samr_io_r_chgpasswd_user ( " " , & r_u , rdata , 0 ) ) {
DEBUG ( 0 , ( " samr_reply_chgpasswd_user: Failed to marshall SAMR_R_CHGPASSWD_USER struct. \n " ) ) ;
1999-03-25 23:56:28 +03:00
return False ;
}
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_chgpasswd_user: %d \n " , __LINE__ ) ) ;
return True ;
1999-03-25 18:14:30 +03:00
}
1999-03-25 16:54:31 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
api_samr_chgpasswd_user
1999-03-25 16:54:31 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
2000-04-04 04:35:34 +04:00
static BOOL api_samr_chgpasswd_user ( prs_struct * data , prs_struct * rdata )
1999-03-25 16:54:31 +03:00
{
1999-12-13 16:27:58 +03:00
SAMR_Q_CHGPASSWD_USER q_u ;
/* unknown 38 command */
if ( ! samr_io_q_chgpasswd_user ( " " , & q_u , data , 0 ) ) {
DEBUG ( 0 , ( " api_samr_chgpasswd_user: samr_io_q_chgpasswd_user failed to parse RPC packet. \n " ) ) ;
1999-03-26 00:32:04 +03:00
return False ;
}
1999-12-13 16:27:58 +03:00
/* construct reply. */
if ( ! samr_reply_chgpasswd_user ( & q_u , rdata ) ) {
DEBUG ( 0 , ( " api_samr_chgpasswd_user: samr_reply_chgpasswd_user failed to create reply packet. \n " ) ) ;
1999-03-25 16:54:31 +03:00
return False ;
}
1999-03-26 00:32:04 +03:00
1999-12-13 16:27:58 +03:00
return True ;
1999-03-25 16:54:31 +03:00
}
1999-12-13 16:27:58 +03:00
1999-11-18 22:29:08 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
samr_reply_unknown_38
1999-11-18 22:29:08 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
static void samr_reply_unknown_38 ( SAMR_Q_UNKNOWN_38 * q_u ,
prs_struct * rdata )
1999-11-18 22:29:08 +03:00
{
1999-12-13 16:27:58 +03:00
SAMR_R_UNKNOWN_38 r_u ;
1999-11-18 22:29:08 +03:00
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_unknown_38: %d \n " , __LINE__ ) ) ;
1999-11-18 22:29:08 +03:00
1999-12-13 16:27:58 +03:00
init_samr_r_unknown_38 ( & 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 */
samr_io_r_unknown_38 ( " " , & r_u , rdata , 0 ) ;
1999-11-18 22:29:08 +03:00
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_unknown_38: %d \n " , __LINE__ ) ) ;
1999-11-18 22:29:08 +03:00
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
api_samr_unknown_38
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_unknown_38 ( prs_struct * data , prs_struct * rdata )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
SAMR_Q_UNKNOWN_38 q_u ;
/* unknown 38 command */
samr_io_q_unknown_38 ( " " , & q_u , data , 0 ) ;
/* construct reply. always indicate success */
samr_reply_unknown_38 ( & q_u , rdata ) ;
return True ;
1998-03-12 00:11:04 +03:00
}
1999-11-18 22:29:08 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
samr_reply_unknown_12
1999-11-18 22:29:08 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
static void samr_reply_unknown_12 ( SAMR_Q_UNKNOWN_12 * q_u ,
prs_struct * rdata )
1999-11-18 22:29:08 +03:00
{
1999-12-13 16:27:58 +03:00
fstring group_names [ MAX_SAM_ENTRIES ] ;
uint32 group_attrs [ MAX_SAM_ENTRIES ] ;
uint32 status = 0 ;
int num_gids = q_u - > num_gids1 ;
1999-11-18 22:29:08 +03:00
1999-12-13 16:27:58 +03:00
SAMR_R_UNKNOWN_12 r_u ;
1999-11-18 22:29:08 +03:00
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_unknown_12: %d \n " , __LINE__ ) ) ;
1999-11-18 22:29:08 +03:00
1999-12-13 16:27:58 +03:00
/* find the policy handle. open a policy on it. */
if ( status = = 0x0 & & ( find_lsa_policy_by_hnd ( & ( q_u - > pol ) ) = = - 1 ) )
1999-11-18 22:29:08 +03:00
{
status = 0xC0000000 | NT_STATUS_INVALID_HANDLE ;
}
if ( status = = 0x0 )
{
1999-12-13 16:27:58 +03:00
int i ;
if ( num_gids > MAX_SAM_ENTRIES )
1999-11-18 22:29:08 +03:00
{
1999-12-13 16:27:58 +03:00
num_gids = MAX_SAM_ENTRIES ;
DEBUG ( 5 , ( " samr_unknown_12: truncating entries to %d \n " , num_gids ) ) ;
}
1999-11-18 22:29:08 +03:00
1999-12-13 16:27:58 +03:00
for ( i = 0 ; i < num_gids & & status = = 0 ; i + + )
{
fstrcpy ( group_names [ i ] , " dummy group " ) ;
group_attrs [ i ] = 0x2 ;
1999-11-18 22:29:08 +03:00
}
}
1999-12-13 16:27:58 +03:00
init_samr_r_unknown_12 ( & r_u , num_gids , group_names , group_attrs , status ) ;
1999-11-18 22:29:08 +03:00
/* store the response in the SMB stream */
1999-12-13 16:27:58 +03:00
samr_io_r_unknown_12 ( " " , & r_u , rdata , 0 ) ;
1999-11-18 22:29:08 +03:00
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_unknown_12: %d \n " , __LINE__ ) ) ;
1999-11-18 22:29:08 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
api_samr_unknown_12
1999-11-18 22:29:08 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_unknown_12 ( prs_struct * data , prs_struct * rdata )
1999-11-18 22:29:08 +03:00
{
1999-12-13 16:27:58 +03:00
SAMR_Q_UNKNOWN_12 q_u ;
1999-11-18 22:29:08 +03:00
1999-12-13 16:27:58 +03:00
/* grab the samr lookup names */
samr_io_q_unknown_12 ( " " , & q_u , data , 0 ) ;
1999-11-18 22:29:08 +03:00
1999-12-13 16:27:58 +03:00
/* construct reply. always indicate success */
samr_reply_unknown_12 ( & q_u , rdata ) ;
return True ;
1999-11-18 22:29:08 +03:00
}
1999-03-25 16:54:31 +03:00
/*******************************************************************
1999-12-13 16:27:58 +03:00
samr_reply_open_user
1999-03-25 16:54:31 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
static void samr_reply_open_user ( SAMR_Q_OPEN_USER * q_u ,
prs_struct * rdata ,
int status )
1999-03-25 16:54:31 +03:00
{
1999-12-13 16:27:58 +03:00
SAMR_R_OPEN_USER r_u ;
struct sam_passwd * sam_pass ;
BOOL pol_open = False ;
1999-03-25 16:54:31 +03:00
1999-12-13 16:27:58 +03:00
/* set up the SAMR open_user response */
memset ( ( char * ) r_u . user_pol . data , ' \0 ' , POL_HND_SIZE ) ;
1999-03-25 16:54:31 +03:00
1999-12-13 16:27:58 +03:00
r_u . status = 0x0 ;
1999-03-25 16:54:31 +03:00
1999-12-13 16:27:58 +03:00
/* find the policy handle. open a policy on it. */
if ( r_u . status = = 0x0 & & ( find_lsa_policy_by_hnd ( & ( q_u - > domain_pol ) ) = = - 1 ) )
1999-03-25 16:54:31 +03:00
{
1999-12-13 16:27:58 +03:00
r_u . status = 0xC0000000 | NT_STATUS_INVALID_HANDLE ;
1999-03-25 16:54:31 +03:00
}
1999-12-13 16:27:58 +03:00
/* get a (unique) handle. open a policy on it. */
if ( r_u . status = = 0x0 & & ! ( pol_open = open_lsa_policy_hnd ( & ( r_u . user_pol ) ) ) )
1999-03-25 16:54:31 +03:00
{
1999-12-13 16:27:58 +03:00
r_u . status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND ;
1999-03-25 16:54:31 +03:00
}
1999-12-13 16:27:58 +03:00
become_root ( True ) ;
sam_pass = getsam21pwrid ( q_u - > user_rid ) ;
unbecome_root ( True ) ;
1999-03-25 16:54:31 +03:00
1999-12-13 16:27:58 +03:00
/* check that the RID exists in our domain. */
if ( r_u . status = = 0x0 & & sam_pass = = NULL )
1999-11-17 00:14:53 +03:00
{
1999-12-13 16:27:58 +03:00
r_u . status = 0xC0000000 | NT_STATUS_NO_SUCH_USER ;
1999-11-17 00:14:53 +03:00
}
1999-12-13 16:27:58 +03:00
/* associate the RID with the (unique) handle. */
if ( r_u . status = = 0x0 & & ! set_lsa_policy_samr_rid ( & ( r_u . user_pol ) , q_u - > user_rid ) )
1999-03-25 16:54:31 +03:00
{
1999-12-13 16:27:58 +03:00
/* oh, whoops. don't know what error message to return, here */
r_u . status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND ;
}
1999-03-25 16:54:31 +03:00
1999-12-13 16:27:58 +03:00
if ( r_u . status ! = 0 & & pol_open )
{
close_lsa_policy_hnd ( & ( r_u . user_pol ) ) ;
1999-03-25 16:54:31 +03:00
}
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_open_user: %d \n " , __LINE__ ) ) ;
1999-03-25 16:54:31 +03:00
/* store the response in the SMB stream */
1999-12-13 16:27:58 +03:00
samr_io_r_open_user ( " " , & r_u , rdata , 0 ) ;
1999-03-25 16:54:31 +03:00
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_open_user: %d \n " , __LINE__ ) ) ;
1999-03-25 16:54:31 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
api_samr_open_user
1999-03-25 16:54:31 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_open_user ( prs_struct * data , prs_struct * rdata )
1999-03-25 16:54:31 +03:00
{
1999-12-13 16:27:58 +03:00
SAMR_Q_OPEN_USER q_u ;
1999-03-25 16:54:31 +03:00
1999-12-13 16:27:58 +03:00
/* grab the samr unknown 22 */
samr_io_q_open_user ( " " , & q_u , data , 0 ) ;
1999-03-25 16:54:31 +03:00
1999-12-13 16:27:58 +03:00
/* construct reply. always indicate success */
samr_reply_open_user ( & q_u , rdata , 0x0 ) ;
return True ;
1999-03-25 16:54:31 +03:00
}
1999-12-13 16:27:58 +03:00
/*************************************************************************
get_user_info_10
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL get_user_info_10 ( SAM_USER_INFO_10 * id10 , uint32 user_rid )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
struct smb_passwd * smb_pass ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! pdb_rid_is_user ( user_rid ) )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
DEBUG ( 4 , ( " RID 0x%x is not a user RID \n " , user_rid ) ) ;
return False ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
become_root ( True ) ;
smb_pass = getsmbpwrid ( user_rid ) ;
unbecome_root ( True ) ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( smb_pass = = NULL )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
DEBUG ( 4 , ( " User 0x%x not found \n " , user_rid ) ) ;
return False ;
1998-03-12 00:11:04 +03:00
}
1999-12-13 16:27:58 +03:00
DEBUG ( 3 , ( " User:[%s] \n " , smb_pass - > smb_name ) ) ;
- group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.
- interactive debug detection
- re-added mem_man (andrew's memory management, detects memory corruption)
- american spellings of "initialise" replaced with english spelling of
"initialise".
- started on "lookup_name()" and "lookup_sid()" functions. proper ones.
- moved lots of functions around. created some modules of commonly used
code. e.g the password file locking code, which is used in groupfile.c
and aliasfile.c and smbpass.c
- moved RID_TYPE_MASK up another bit. this is really unfortunate, but
there is no other "fast" way to identify users from groups from aliases.
i do not believe that this code saves us anything (the multipliers)
and puts us at a disadvantage (reduces the useable rid space).
the designers of NT aren't silly: if they can get away with a user-
interface-speed LsaLookupNames / LsaLookupSids, then so can we. i
spoke with isaac at the cifs conference, the only time for example that
they do a security context check is on file create. certainly not on
individual file reads / writes, which would drastically hit their
performance and ours, too.
- renamed myworkgroup to global_sam_name, amongst other things, when used
in the rpc code. there is also a global_member_name, as we are always
responsible for a SAM database, the scope of which is limited by the role
of the machine (e.g if a member of a workgroup, your SAM is for _local_
logins only, and its name is the name of your server. you even still
have a SID. see LsaQueryInfoPolicy, levels 3 and 5).
- updated functionality of groupname.c to be able to cope with names
like DOMAIN\group and SERVER\alias. used this code to be able to
do aliases as well as groups. this code may actually be better
off being used in username mapping, too.
- created a connect to serverlist function in clientgen.c and used it
in password.c
- initialisation in server.c depends on the role of the server. well,
it does now.
- rpctorture. smbtorture. EXERCISE EXTREME CAUTION.
(This used to be commit 0d21e1e6090b933f396c764af535ca3388a562db)
1998-11-17 19:19:04 +03:00
1999-12-13 16:27:58 +03:00
init_sam_user_info10 ( id10 , smb_pass - > acct_ctrl ) ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
return True ;
}
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
/*************************************************************************
get_user_info_21
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static BOOL get_user_info_21 ( SAM_USER_INFO_21 * id21 , uint32 user_rid )
{
NTTIME dummy_time ;
struct sam_passwd * sam_pass ;
LOGON_HRS hrs ;
int i ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( ! pdb_rid_is_user ( user_rid ) )
1998-09-25 00:02:56 +04:00
{
1999-12-13 16:27:58 +03:00
DEBUG ( 4 , ( " RID 0x%x is not a user RID \n " , user_rid ) ) ;
return False ;
1998-09-25 00:02:56 +04:00
}
1999-12-13 16:27:58 +03:00
become_root ( True ) ;
sam_pass = getsam21pwrid ( user_rid ) ;
unbecome_root ( True ) ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
if ( sam_pass = = NULL )
{
DEBUG ( 4 , ( " User 0x%x not found \n " , user_rid ) ) ;
return False ;
}
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
DEBUG ( 3 , ( " User:[%s] \n " , sam_pass - > smb_name ) ) ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
dummy_time . low = 0xffffffff ;
dummy_time . high = 0x7fffffff ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " get_user_info_21 - TODO: convert unix times to NTTIMEs \n " ) ) ;
- 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
/* create a LOGON_HRS structure */
hrs . len = sam_pass - > hours_len ;
SMB_ASSERT_ARRAY ( hrs . hours , hrs . len ) ;
for ( i = 0 ; i < hrs . len ; i + + )
- 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
hrs . hours [ i ] = sam_pass - > hours [ i ] ;
- 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
init_sam_user_info21 ( id21 ,
- 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
& dummy_time , /* logon_time */
& dummy_time , /* logoff_time */
& dummy_time , /* kickoff_time */
& dummy_time , /* pass_last_set_time */
& dummy_time , /* pass_can_change_time */
& dummy_time , /* pass_must_change_time */
- 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
sam_pass - > smb_name , /* user_name */
sam_pass - > full_name , /* full_name */
sam_pass - > home_dir , /* home_dir */
sam_pass - > dir_drive , /* dir_drive */
sam_pass - > logon_script , /* logon_script */
sam_pass - > profile_path , /* profile_path */
sam_pass - > acct_desc , /* description */
sam_pass - > workstations , /* workstations user can log in from */
sam_pass - > unknown_str , /* don't know, yet */
sam_pass - > munged_dial , /* dialin info. contains dialin path and tel no */
- 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
sam_pass - > user_rid , /* RID user_id */
sam_pass - > group_rid , /* RID group_id */
sam_pass - > acct_ctrl ,
- 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
sam_pass - > unknown_3 , /* unknown_3 */
sam_pass - > logon_divs , /* divisions per week */
& hrs , /* logon hours */
sam_pass - > unknown_5 ,
sam_pass - > unknown_6 ) ;
- 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
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
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
samr_reply_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
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
static void samr_reply_query_userinfo ( SAMR_Q_QUERY_USERINFO * q_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
prs_struct * rdata )
{
1999-12-13 16:27:58 +03:00
SAMR_R_QUERY_USERINFO r_u ;
#if 0
SAM_USER_INFO_11 id11 ;
# endif
SAM_USER_INFO_10 id10 ;
SAM_USER_INFO_21 id21 ;
void * info = NULL ;
- 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
uint32 status = 0x0 ;
uint32 rid = 0x0 ;
- 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
DEBUG ( 5 , ( " samr_reply_query_userinfo: %d \n " , __LINE__ ) ) ;
- 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
/* search for the handle */
if ( status = = 0x0 & & ( find_lsa_policy_by_hnd ( & ( q_u - > pol ) ) = = - 1 ) )
- 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
status = NT_STATUS_INVALID_HANDLE ;
- 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
/* find the user's rid */
if ( status = = 0x0 & & ( rid = get_lsa_policy_samr_rid ( & ( q_u - > pol ) ) ) = = 0xffffffff )
- 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
status = NT_STATUS_OBJECT_TYPE_MISMATCH ;
- 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
DEBUG ( 5 , ( " samr_reply_query_userinfo: rid:0x%x \n " , rid ) ) ;
- 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
/* ok! user info levels (there are lots: see MSDEV help), off we go... */
- 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
if ( status = = 0x0 )
{
1999-12-13 16:27:58 +03:00
switch ( q_u - > switch_value )
{
case 0x10 :
{
info = ( void * ) & id10 ;
status = get_user_info_10 ( & id10 , rid ) ? 0 : NT_STATUS_NO_SUCH_USER ;
break ;
}
#if 0
/* whoops - got this wrong. i think. or don't understand what's happening. */
case 0x11 :
{
NTTIME expire ;
info = ( void * ) & id11 ;
expire . low = 0xffffffff ;
expire . high = 0x7fffffff ;
make_sam_user_info11 ( & id11 , & expire , " BROOKFIELDS$ " , 0x03ef , 0x201 , 0x0080 ) ;
break ;
}
# endif
case 21 :
{
info = ( void * ) & id21 ;
status = get_user_info_21 ( & id21 , rid ) ? 0 : NT_STATUS_NO_SUCH_USER ;
break ;
}
- 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
default :
{
status = NT_STATUS_INVALID_INFO_CLASS ;
- 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
break ;
}
}
- 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
init_samr_r_query_userinfo ( & r_u , q_u - > switch_value , info , status ) ;
- 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 */
1999-12-13 16:27:58 +03:00
samr_io_r_query_userinfo ( " " , & r_u , rdata , 0 ) ;
- 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
DEBUG ( 5 , ( " samr_reply_query_userinfo: %d \n " , __LINE__ ) ) ;
- 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
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
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_query_userinfo ( prs_struct * data , prs_struct * 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
{
1999-12-13 16:27:58 +03:00
SAMR_Q_QUERY_USERINFO q_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
1999-12-13 16:27:58 +03:00
/* grab the samr unknown 24 */
samr_io_q_query_userinfo ( " " , & q_u , data , 0 ) ;
- 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
/* construct reply. always indicate success */
samr_reply_query_userinfo ( & q_u , 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
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
}
1999-12-13 16:27:58 +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
/*******************************************************************
1999-12-13 16:27:58 +03:00
samr_reply_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
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
static void samr_reply_query_usergroups ( SAMR_Q_QUERY_USERGROUPS * q_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
prs_struct * rdata )
{
1999-12-13 16:27:58 +03:00
SAMR_R_QUERY_USERGROUPS 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
uint32 status = 0x0 ;
1999-12-13 16:27:58 +03:00
struct sam_passwd * sam_pass ;
DOM_GID * gids = NULL ;
int num_groups = 0 ;
uint32 rid ;
- 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
DEBUG ( 5 , ( " samr_query_usergroups: %d \n " , __LINE__ ) ) ;
- 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
/* find the policy handle. open a policy on it. */
1999-12-13 16:27:58 +03:00
if ( status = = 0x0 & & ( find_lsa_policy_by_hnd ( & ( q_u - > pol ) ) = = - 1 ) )
- 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
{
status = 0xC0000000 | NT_STATUS_INVALID_HANDLE ;
}
1999-12-13 16:27:58 +03:00
/* find the user's rid */
if ( status = = 0x0 & & ( rid = get_lsa_policy_samr_rid ( & ( q_u - > pol ) ) ) = = 0xffffffff )
- 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
status = NT_STATUS_OBJECT_TYPE_MISMATCH ;
- 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
}
if ( status = = 0x0 )
{
become_root ( True ) ;
1999-12-13 16:27:58 +03:00
sam_pass = getsam21pwrid ( rid ) ;
- 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
unbecome_root ( True ) ;
1999-12-13 16:27:58 +03:00
if ( sam_pass = = NULL )
{
status = 0xC0000000 | NT_STATUS_NO_SUCH_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
}
if ( status = = 0x0 )
{
1999-12-13 16:27:58 +03:00
pstring groups ;
get_domain_user_groups ( groups , sam_pass - > smb_name ) ;
gids = NULL ;
num_groups = make_dom_gids ( groups , & gids ) ;
- 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
/* construct the response. lkclXXXX: gids are not copied! */
init_samr_r_query_usergroups ( & r_u , num_groups , gids , status ) ;
- 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 */
1999-12-13 16:27:58 +03:00
samr_io_r_query_usergroups ( " " , & r_u , rdata , 0 ) ;
if ( gids )
{
free ( ( char * ) gids ) ;
}
- 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
DEBUG ( 5 , ( " samr_query_usergroups: %d \n " , __LINE__ ) ) ;
- 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
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
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_query_usergroups ( prs_struct * data , prs_struct * 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
{
1999-12-13 16:27:58 +03:00
SAMR_Q_QUERY_USERGROUPS q_u ;
/* grab the samr unknown 32 */
samr_io_q_query_usergroups ( " " , & q_u , data , 0 ) ;
/* construct reply. */
samr_reply_query_usergroups ( & q_u , rdata ) ;
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
}
1998-10-22 01:11:16 +04:00
/*******************************************************************
1998-10-22 02:36:26 +04:00
samr_reply_query_dom_info
1998-10-22 01:11:16 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1998-10-22 02:36:26 +04:00
static void samr_reply_query_dom_info ( SAMR_Q_QUERY_DOMAIN_INFO * q_u ,
1998-10-22 01:11:16 +04:00
prs_struct * rdata )
{
1998-10-22 02:36:26 +04:00
SAMR_R_QUERY_DOMAIN_INFO r_u ;
1998-10-22 01:11:16 +04:00
SAM_UNK_CTR ctr ;
uint16 switch_value = 0x0 ;
uint32 status = 0x0 ;
ZERO_STRUCT ( r_u ) ;
ZERO_STRUCT ( ctr ) ;
r_u . ctr = & ctr ;
1998-10-22 02:36:26 +04:00
DEBUG ( 5 , ( " samr_reply_query_dom_info: %d \n " , __LINE__ ) ) ;
1998-10-22 01:11:16 +04:00
/* find the policy handle. open a policy on it. */
1999-12-13 16:27:58 +03:00
if ( r_u . status = = 0x0 & & ( find_lsa_policy_by_hnd ( & ( q_u - > domain_pol ) ) = = - 1 ) )
1998-10-22 01:11:16 +04:00
{
r_u . status = 0xC0000000 | NT_STATUS_INVALID_HANDLE ;
1998-10-22 02:36:26 +04:00
DEBUG ( 5 , ( " samr_reply_query_dom_info: invalid handle \n " ) ) ;
1998-10-22 01:11:16 +04:00
}
if ( status = = 0x0 )
{
switch ( q_u - > switch_value )
{
case 0x02 :
{
switch_value = 0x2 ;
1999-12-13 16:27:58 +03:00
init_unk_info2 ( & ctr . info . inf2 , global_myworkgroup , global_myname ) ;
1999-03-25 16:54:31 +03:00
break ;
}
1998-10-22 01:11:16 +04:00
default :
{
status = 0xC0000000 | NT_STATUS_INVALID_INFO_CLASS ;
break ;
}
}
}
1999-12-13 16:27:58 +03:00
init_samr_r_query_dom_info ( & r_u , switch_value , & ctr , status ) ;
1998-10-22 01:11:16 +04:00
/* store the response in the SMB stream */
1998-10-22 02:36:26 +04:00
samr_io_r_query_dom_info ( " " , & r_u , rdata , 0 ) ;
1998-10-22 01:11:16 +04:00
1998-10-22 02:36:26 +04:00
DEBUG ( 5 , ( " samr_query_dom_info: %d \n " , __LINE__ ) ) ;
1998-10-22 01:11:16 +04:00
}
/*******************************************************************
1998-10-22 02:36:26 +04:00
api_samr_query_dom_info
1998-10-22 01:11:16 +04:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_query_dom_info ( prs_struct * data , prs_struct * rdata )
1998-10-22 01:11:16 +04:00
{
1998-10-22 02:36:26 +04:00
SAMR_Q_QUERY_DOMAIN_INFO q_e ;
1999-12-13 16:27:58 +03:00
/* grab the samr unknown 8 command */
1998-10-22 02:36:26 +04:00
samr_io_q_query_dom_info ( " " , & q_e , data , 0 ) ;
1999-12-13 16:27:58 +03:00
/* construct reply. */
1998-10-22 02:36:26 +04:00
samr_reply_query_dom_info ( & q_e , rdata ) ;
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
/*******************************************************************
1999-12-13 16:27:58 +03:00
samr_reply_unknown_32
1998-03-12 00:11:04 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
static void samr_reply_unknown_32 ( SAMR_Q_UNKNOWN_32 * q_u ,
prs_struct * rdata ,
int status )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
int i ;
SAMR_R_UNKNOWN_32 r_u ;
1998-03-12 00:11:04 +03:00
1999-12-13 16:27:58 +03:00
/* set up the SAMR unknown_32 response */
memset ( ( char * ) r_u . pol . data , ' \0 ' , POL_HND_SIZE ) ;
if ( status = = 0 )
1998-03-12 00:11:04 +03:00
{
1999-12-13 16:27:58 +03:00
for ( i = 4 ; i < POL_HND_SIZE ; i + + )
1999-03-25 16:54:31 +03:00
{
1999-12-13 16:27:58 +03:00
r_u . pol . data [ i ] = i + 1 ;
1999-03-25 16:54:31 +03:00
}
}
1999-12-13 16:27:58 +03:00
init_dom_rid4 ( & ( r_u . rid4 ) , 0x0030 , 0 , 0 ) ;
r_u . status = status ;
1999-03-25 16:54:31 +03:00
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_unknown_32: %d \n " , __LINE__ ) ) ;
1999-03-25 16:54:31 +03:00
/* store the response in the SMB stream */
1999-12-13 16:27:58 +03:00
samr_io_r_unknown_32 ( " " , & r_u , rdata , 0 ) ;
1999-03-25 16:54:31 +03:00
1999-12-13 16:27:58 +03:00
DEBUG ( 5 , ( " samr_unknown_32: %d \n " , __LINE__ ) ) ;
1999-03-25 16:54:31 +03:00
}
/*******************************************************************
1999-12-13 16:27:58 +03:00
api_samr_unknown_32
1999-03-25 16:54:31 +03:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_unknown_32 ( prs_struct * data , prs_struct * rdata )
1999-03-25 16:54:31 +03:00
{
1999-12-13 16:27:58 +03:00
uint32 status = 0 ;
struct sam_passwd * sam_pass ;
fstring mach_acct ;
SAMR_Q_UNKNOWN_32 q_u ;
1999-03-25 16:54:31 +03:00
/* grab the samr unknown 32 */
1999-12-13 16:27:58 +03:00
samr_io_q_unknown_32 ( " " , & q_u , data , 0 ) ;
/* find the machine account: tell the caller if it exists.
lkclXXXX i have * no * idea if this is a problem or not
or even if you are supposed to construct a different
reply if the account already exists . . .
*/
fstrcpy ( mach_acct , dos_unistrn2 ( q_u . uni_mach_acct . buffer ,
q_u . uni_mach_acct . uni_str_len ) ) ;
become_root ( True ) ;
sam_pass = getsam21pwnam ( mach_acct ) ;
unbecome_root ( True ) ;
if ( sam_pass ! = NULL )
{
/* machine account exists: say so */
status = 0xC0000000 | NT_STATUS_USER_EXISTS ;
}
else
{
/* this could cause trouble... */
DEBUG ( 0 , ( " trouble! \n " ) ) ;
status = 0 ;
}
1999-03-25 16:54:31 +03:00
1998-03-12 00:11:04 +03:00
/* construct reply. */
1999-12-13 16:27:58 +03:00
samr_reply_unknown_32 ( & q_u , rdata , status ) ;
return True ;
1998-03-12 00:11:04 +03:00
}
1998-10-15 09:47:29 +04:00
/*******************************************************************
samr_reply_connect_anon
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void samr_reply_connect_anon ( SAMR_Q_CONNECT_ANON * q_u ,
prs_struct * rdata )
{
SAMR_R_CONNECT_ANON r_u ;
BOOL pol_open = False ;
/* set up the SAMR connect_anon response */
r_u . status = 0x0 ;
/* get a (unique) handle. open a policy on it. */
1999-12-13 16:27:58 +03:00
if ( r_u . status = = 0x0 & & ! ( pol_open = open_lsa_policy_hnd ( & ( r_u . connect_pol ) ) ) )
1998-10-15 09:47:29 +04:00
{
r_u . status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND ;
}
/* associate the domain SID with the (unique) handle. */
1999-12-13 16:27:58 +03:00
if ( r_u . status = = 0x0 & & ! set_lsa_policy_samr_pol_status ( & ( r_u . connect_pol ) , q_u - > unknown_0 ) )
1998-10-15 09:47:29 +04:00
{
/* oh, whoops. don't know what error message to return, here */
r_u . status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND ;
}
if ( r_u . status ! = 0 & & pol_open )
{
1999-12-13 16:27:58 +03:00
close_lsa_policy_hnd ( & ( r_u . connect_pol ) ) ;
1998-10-15 09:47:29 +04:00
}
DEBUG ( 5 , ( " samr_connect_anon: %d \n " , __LINE__ ) ) ;
/* store the response in the SMB stream */
samr_io_r_connect_anon ( " " , & r_u , rdata , 0 ) ;
DEBUG ( 5 , ( " samr_connect_anon: %d \n " , __LINE__ ) ) ;
}
/*******************************************************************
api_samr_connect_anon
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_connect_anon ( prs_struct * data , prs_struct * rdata )
1998-10-15 09:47:29 +04:00
{
SAMR_Q_CONNECT_ANON q_u ;
1999-12-13 16:27:58 +03:00
/* grab the samr open policy */
1998-10-15 09:47:29 +04:00
samr_io_q_connect_anon ( " " , & q_u , data , 0 ) ;
1999-12-13 16:27:58 +03:00
/* construct reply. always indicate success */
1998-10-15 09:47:29 +04:00
samr_reply_connect_anon ( & q_u , rdata ) ;
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
/*******************************************************************
samr_reply_connect
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void samr_reply_connect ( SAMR_Q_CONNECT * q_u ,
prs_struct * rdata )
{
SAMR_R_CONNECT r_u ;
BOOL pol_open = False ;
/* set up the SAMR connect response */
r_u . status = 0x0 ;
/* get a (unique) handle. open a policy on it. */
1999-12-13 16:27:58 +03:00
if ( r_u . status = = 0x0 & & ! ( pol_open = open_lsa_policy_hnd ( & ( r_u . connect_pol ) ) ) )
1998-03-12 00:11:04 +03:00
{
r_u . status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND ;
}
/* associate the domain SID with the (unique) handle. */
1999-12-13 16:27:58 +03:00
if ( r_u . status = = 0x0 & & ! set_lsa_policy_samr_pol_status ( & ( r_u . connect_pol ) , q_u - > unknown_0 ) )
1998-03-12 00:11:04 +03:00
{
/* oh, whoops. don't know what error message to return, here */
r_u . status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND ;
}
if ( r_u . status ! = 0 & & pol_open )
{
1999-12-13 16:27:58 +03:00
close_lsa_policy_hnd ( & ( r_u . connect_pol ) ) ;
1998-03-12 00:11:04 +03:00
}
DEBUG ( 5 , ( " samr_connect: %d \n " , __LINE__ ) ) ;
/* store the response in the SMB stream */
samr_io_r_connect ( " " , & r_u , rdata , 0 ) ;
DEBUG ( 5 , ( " samr_connect: %d \n " , __LINE__ ) ) ;
}
/*******************************************************************
api_samr_connect
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_connect ( prs_struct * data , prs_struct * rdata )
1998-03-12 00:11:04 +03:00
{
SAMR_Q_CONNECT q_u ;
1999-12-13 16:27:58 +03:00
/* grab the samr open policy */
1998-03-12 00:11:04 +03:00
samr_io_q_connect ( " " , & q_u , data , 0 ) ;
1999-12-13 16:27:58 +03:00
/* construct reply. always indicate success */
1998-03-12 00:11:04 +03:00
samr_reply_connect ( & q_u , rdata ) ;
1999-12-13 16:27:58 +03:00
return True ;
1998-03-12 00:11:04 +03:00
}
/*******************************************************************
samr_reply_open_alias
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void samr_reply_open_alias ( SAMR_Q_OPEN_ALIAS * q_u ,
prs_struct * rdata )
{
SAMR_R_OPEN_ALIAS r_u ;
BOOL pol_open = False ;
/* set up the SAMR open_alias response */
r_u . status = 0x0 ;
/* get a (unique) handle. open a policy on it. */
1999-12-13 16:27:58 +03:00
if ( r_u . status = = 0x0 & & ! ( pol_open = open_lsa_policy_hnd ( & ( r_u . pol ) ) ) )
1998-03-12 00:11:04 +03:00
{
r_u . status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND ;
}
/* associate a RID with the (unique) handle. */
1999-12-13 16:27:58 +03:00
if ( r_u . status = = 0x0 & & ! set_lsa_policy_samr_rid ( & ( r_u . pol ) , q_u - > rid_alias ) )
1998-12-01 22:10:44 +03:00
{
/* oh, whoops. don't know what error message to return, here */
r_u . status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND ;
}
1998-03-12 00:11:04 +03:00
if ( r_u . status ! = 0 & & pol_open )
{
1999-12-13 16:27:58 +03:00
close_lsa_policy_hnd ( & ( r_u . pol ) ) ;
1998-03-12 00:11:04 +03:00
}
DEBUG ( 5 , ( " samr_open_alias: %d \n " , __LINE__ ) ) ;
/* store the response in the SMB stream */
samr_io_r_open_alias ( " " , & r_u , rdata , 0 ) ;
DEBUG ( 5 , ( " samr_open_alias: %d \n " , __LINE__ ) ) ;
}
/*******************************************************************
api_samr_open_alias
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2000-04-04 04:35:34 +04:00
static BOOL api_samr_open_alias ( prs_struct * data , prs_struct * rdata )
1998-03-12 00:11:04 +03:00
{
SAMR_Q_OPEN_ALIAS q_u ;
1999-02-24 04:52:30 +03:00
1999-12-13 16:27:58 +03:00
/* grab the samr open policy */
samr_io_q_open_alias ( " " , & q_u , data , 0 ) ;
1999-02-24 04:52:30 +03:00
1999-12-13 16:27:58 +03:00
/* construct reply. always indicate success */
samr_reply_open_alias ( & q_u , rdata ) ;
1999-02-24 04:52:30 +03:00
1999-12-13 16:27:58 +03:00
return True ;
1999-02-24 04:52:30 +03:00
}
1998-03-12 00:11:04 +03:00
/*******************************************************************
array of \ PIPE \ samr operations
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static struct api_struct api_samr_cmds [ ] =
{
{ " SAMR_CLOSE_HND " , SAMR_CLOSE_HND , api_samr_close_hnd } ,
{ " SAMR_CONNECT " , SAMR_CONNECT , api_samr_connect } ,
1998-10-15 09:47:29 +04:00
{ " SAMR_CONNECT_ANON " , SAMR_CONNECT_ANON , api_samr_connect_anon } ,
1998-03-12 00:11:04 +03:00
{ " 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 } ,
1999-12-13 16:27:58 +03:00
{ " SAMR_LOOKUP_IDS " , SAMR_LOOKUP_IDS , api_samr_lookup_ids } ,
1998-03-12 00:11:04 +03:00
{ " 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 } ,
1999-12-13 16:27:58 +03:00
{ " SAMR_QUERY_DOMAIN_INFO " , SAMR_QUERY_DOMAIN_INFO , api_samr_query_dom_info } ,
1998-03-12 00:11:04 +03:00
{ " SAMR_QUERY_USERGROUPS " , SAMR_QUERY_USERGROUPS , api_samr_query_usergroups } ,
{ " SAMR_QUERY_DISPINFO " , SAMR_QUERY_DISPINFO , api_samr_query_dispinfo } ,
{ " SAMR_QUERY_ALIASINFO " , SAMR_QUERY_ALIASINFO , api_samr_query_aliasinfo } ,
1999-12-13 16:27:58 +03:00
{ " SAMR_0x32 " , 0x32 , api_samr_unknown_32 } ,
{ " SAMR_UNKNOWN_12 " , SAMR_UNKNOWN_12 , api_samr_unknown_12 } ,
{ " SAMR_UNKNOWN_38 " , SAMR_UNKNOWN_38 , api_samr_unknown_38 } ,
1998-10-17 03:40:59 +04:00
{ " SAMR_CHGPASSWD_USER " , SAMR_CHGPASSWD_USER , api_samr_chgpasswd_user } ,
1998-03-12 00:11:04 +03:00
{ " SAMR_OPEN_ALIAS " , SAMR_OPEN_ALIAS , api_samr_open_alias } ,
{ " SAMR_OPEN_DOMAIN " , SAMR_OPEN_DOMAIN , api_samr_open_domain } ,
1999-12-13 16:27:58 +03:00
{ " SAMR_UNKNOWN_3 " , SAMR_UNKNOWN_3 , api_samr_unknown_3 } ,
{ " SAMR_UNKNOWN_2C " , SAMR_UNKNOWN_2C , api_samr_unknown_2c } ,
1998-10-02 22:45:07 +04:00
{ NULL , 0 , NULL }
1998-03-12 00:11:04 +03:00
} ;
/*******************************************************************
receives a samr pipe and responds .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1999-12-13 16:27:58 +03:00
BOOL api_samr_rpc ( pipes_struct * p , prs_struct * data )
1998-03-12 00:11:04 +03:00
{
return api_rpcTNP ( p , " api_samr_rpc " , api_samr_cmds , data ) ;
}