1998-09-25 21:01:52 +00:00
/*
Unix SMB / Netbios implementation .
Version 1.9 .
NT Domain Authentication SMB / MSRPC client
Copyright ( C ) Andrew Tridgell 1994 - 1997
Copyright ( C ) Luke Kenneth Casson Leighton 1996 - 1997
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 .
*/
# ifdef SYSLOG
# undef SYSLOG
# endif
# include "includes.h"
# include "nterr.h"
extern int DEBUGLEVEL ;
# define DEBUG_TESTING
extern struct cli_state * smb_cli ;
extern FILE * out_hnd ;
/****************************************************************************
experimental SAM encryted rpc test connection
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void cmd_sam_test ( struct client_info * info )
{
fstring srv_name ;
fstring domain ;
1998-09-25 22:20:05 +00:00
fstring sid ;
1998-09-25 21:01:52 +00:00
BOOL res = True ;
fstrcpy ( sid , info - > dom . level5_sid ) ;
fstrcpy ( domain , info - > dom . level5_dom ) ;
if ( strlen ( sid ) = = 0 )
{
fprintf ( out_hnd , " please use 'lsaquery' first, to ascertain the SID \n " ) ;
return ;
}
1998-09-25 22:20:05 +00:00
fstrcpy ( srv_name , " \\ \\ " ) ;
fstrcat ( srv_name , info - > myhostname ) ;
1998-09-25 21:01:52 +00:00
strupper ( srv_name ) ;
fprintf ( out_hnd , " SAM Encryption Test \n " ) ;
/* open SAMR session. */
1998-09-25 22:20:05 +00:00
res = res ? cli_nt_session_open ( smb_cli , PIPE_SAMR , True ) : False ;
1998-09-25 21:01:52 +00:00
/* close the session */
1998-09-25 22:20:05 +00:00
cli_nt_session_close ( smb_cli ) ;
1998-09-25 21:01:52 +00:00
if ( res )
{
DEBUG ( 5 , ( " cmd_sam_test: succeeded \n " ) ) ;
}
else
{
DEBUG ( 5 , ( " cmd_sam_test: failed \n " ) ) ;
}
}
/****************************************************************************
experimental SAM users enum .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void cmd_sam_enum_users ( struct client_info * info )
{
fstring srv_name ;
fstring domain ;
1998-09-25 22:20:05 +00:00
fstring sid ;
DOM_SID sid1 ;
1998-09-25 21:01:52 +00:00
int user_idx ;
BOOL res = True ;
BOOL request_user_info = False ;
BOOL request_group_info = False ;
uint16 num_entries = 0 ;
uint16 unk_0 = 0x0 ;
uint16 acb_mask = 0 ;
uint16 unk_1 = 0x0 ;
uint32 admin_rid = 0x304 ; /* absolutely no idea. */
fstring tmp ;
fstrcpy ( sid , info - > dom . level5_sid ) ;
fstrcpy ( domain , info - > dom . level5_dom ) ;
if ( strlen ( sid ) = = 0 )
{
fprintf ( out_hnd , " please use 'lsaquery' first, to ascertain the SID \n " ) ;
return ;
}
1998-09-25 22:20:05 +00:00
make_dom_sid ( & sid1 , sid ) ;
fstrcpy ( srv_name , " \\ \\ " ) ;
fstrcat ( srv_name , info - > dest_host ) ;
1998-09-25 21:01:52 +00:00
strupper ( srv_name ) ;
/* a bad way to do token parsing... */
1998-09-25 22:20:05 +00:00
if ( next_token ( NULL , tmp , NULL , sizeof ( tmp ) ) )
1998-09-25 21:01:52 +00:00
{
request_user_info | = strequal ( tmp , " -u " ) ;
request_group_info | = strequal ( tmp , " -g " ) ;
}
1998-09-25 22:20:05 +00:00
if ( next_token ( NULL , tmp , NULL , sizeof ( tmp ) ) )
1998-09-25 21:01:52 +00:00
{
request_user_info | = strequal ( tmp , " -u " ) ;
request_group_info | = strequal ( tmp , " -g " ) ;
}
# ifdef DEBUG_TESTING
1998-09-25 22:20:05 +00:00
if ( next_token ( NULL , tmp , NULL , sizeof ( tmp ) ) )
1998-09-25 21:01:52 +00:00
{
num_entries = strtoul ( tmp , ( char * * ) NULL , 16 ) ;
}
1998-09-25 22:20:05 +00:00
if ( next_token ( NULL , tmp , NULL , sizeof ( tmp ) ) )
1998-09-25 21:01:52 +00:00
{
unk_0 = strtoul ( tmp , ( char * * ) NULL , 16 ) ;
}
1998-09-25 22:20:05 +00:00
if ( next_token ( NULL , tmp , NULL , sizeof ( tmp ) ) )
1998-09-25 21:01:52 +00:00
{
acb_mask = strtoul ( tmp , ( char * * ) NULL , 16 ) ;
}
1998-09-25 22:20:05 +00:00
if ( next_token ( NULL , tmp , NULL , sizeof ( tmp ) ) )
1998-09-25 21:01:52 +00:00
{
unk_1 = strtoul ( tmp , ( char * * ) NULL , 16 ) ;
}
# endif
fprintf ( out_hnd , " SAM Enumerate Users \n " ) ;
fprintf ( out_hnd , " From: %s To: %s Domain: %s SID: %s \n " ,
info - > myhostname , srv_name , domain , sid ) ;
# ifdef DEBUG_TESTING
DEBUG ( 5 , ( " Number of entries:%d unk_0:%04x acb_mask:%04x unk_1:%04x \n " ,
num_entries , unk_0 , acb_mask , unk_1 ) ) ;
# endif
/* open SAMR session. negotiate credentials */
1998-09-25 22:20:05 +00:00
res = res ? cli_nt_session_open ( smb_cli , PIPE_SAMR , False ) : False ;
1998-09-25 21:01:52 +00:00
/* establish a connection. */
1998-09-25 22:20:05 +00:00
res = res ? do_samr_connect ( smb_cli ,
1998-09-25 21:01:52 +00:00
srv_name , 0x00000020 ,
& info - > dom . samr_pol_connect ) : False ;
/* connect to the domain */
1998-09-25 22:20:05 +00:00
res = res ? do_samr_open_domain ( smb_cli ,
& info - > dom . samr_pol_connect , admin_rid , & sid1 ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ) : False ;
/* read some users */
1998-09-25 22:20:05 +00:00
res = res ? do_samr_enum_dom_users ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ,
num_entries , unk_0 , acb_mask , unk_1 , 0xffff ,
1998-09-25 23:14:20 +00:00
& info - > dom . sam , & info - > dom . num_sam_entries ) : False ;
1998-09-25 21:01:52 +00:00
if ( res & & info - > dom . num_sam_entries = = 0 )
{
fprintf ( out_hnd , " No users \n " ) ;
}
if ( request_user_info | | request_group_info )
{
/* query all the users */
user_idx = 0 ;
while ( res & & user_idx < info - > dom . num_sam_entries )
{
uint32 user_rid = info - > dom . sam [ user_idx ] . smb_userid ;
SAM_USER_INFO_21 usr ;
fprintf ( out_hnd , " User RID: %8x User Name: %s \n " ,
user_rid ,
info - > dom . sam [ user_idx ] . acct_name ) ;
if ( request_user_info )
{
/* send user info query, level 0x15 */
1998-09-25 22:20:05 +00:00
if ( get_samr_query_userinfo ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ,
0x15 , user_rid , & usr ) )
{
1998-09-25 22:20:05 +00:00
display_sam_user_info_21 ( out_hnd , ACTION_HEADER , & usr ) ;
display_sam_user_info_21 ( out_hnd , ACTION_ENUMERATE , & usr ) ;
display_sam_user_info_21 ( out_hnd , ACTION_FOOTER , & usr ) ;
1998-09-25 21:01:52 +00:00
}
}
if ( request_group_info )
{
uint32 num_groups ;
DOM_GID gid [ LSA_MAX_GROUPS ] ;
/* send user group query */
1998-09-25 22:20:05 +00:00
if ( get_samr_query_usergroups ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ,
user_rid , & num_groups , gid ) )
{
1998-09-25 22:20:05 +00:00
display_group_rid_info ( out_hnd , ACTION_HEADER , num_groups , gid ) ;
display_group_rid_info ( out_hnd , ACTION_ENUMERATE , num_groups , gid ) ;
display_group_rid_info ( out_hnd , ACTION_FOOTER , num_groups , gid ) ;
1998-09-25 21:01:52 +00:00
}
}
user_idx + + ;
}
}
1998-09-25 22:20:05 +00:00
res = res ? do_samr_close ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_connect ) : False ;
1998-09-25 22:20:05 +00:00
res = res ? do_samr_close ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ) : False ;
/* close the session */
1998-09-25 22:20:05 +00:00
cli_nt_session_close ( smb_cli ) ;
1998-09-25 21:01:52 +00:00
1998-09-25 23:14:20 +00:00
if ( info - > dom . sam ! = NULL )
{
free ( info - > dom . sam ) ;
}
1998-09-25 21:01:52 +00:00
if ( res )
{
DEBUG ( 5 , ( " cmd_sam_enum_users: succeeded \n " ) ) ;
}
else
{
DEBUG ( 5 , ( " cmd_sam_enum_users: failed \n " ) ) ;
}
}
/****************************************************************************
experimental SAM user query .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void cmd_sam_query_user ( struct client_info * info )
{
fstring srv_name ;
fstring domain ;
1998-09-25 22:20:05 +00:00
fstring sid ;
DOM_SID sid1 ;
1998-09-25 21:01:52 +00:00
int user_idx ;
BOOL res = True ;
uint32 admin_rid = 0x304 ; /* absolutely no idea. */
fstring rid_str ;
fstring info_str ;
uint32 user_rid = 0 ;
uint32 info_level = 0x15 ;
SAM_USER_INFO_21 usr ;
fstrcpy ( sid , info - > dom . level5_sid ) ;
fstrcpy ( domain , info - > dom . level5_dom ) ;
if ( strlen ( sid ) = = 0 )
{
fprintf ( out_hnd , " please use 'lsaquery' first, to ascertain the SID \n " ) ;
return ;
}
1998-09-25 22:20:05 +00:00
make_dom_sid ( & sid1 , sid ) ;
fstrcpy ( srv_name , " \\ \\ " ) ;
fstrcat ( srv_name , info - > dest_host ) ;
1998-09-25 21:01:52 +00:00
strupper ( srv_name ) ;
1998-09-25 22:20:05 +00:00
if ( next_token ( NULL , rid_str , NULL , sizeof ( rid_str ) ) & &
next_token ( NULL , info_str , NULL , sizeof ( info_str ) ) )
1998-09-25 21:01:52 +00:00
{
user_rid = strtoul ( rid_str , ( char * * ) NULL , 16 ) ;
info_level = strtoul ( info_str , ( char * * ) NULL , 10 ) ;
}
fprintf ( out_hnd , " SAM Query User: rid %x info level %d \n " ,
user_rid , info_level ) ;
fprintf ( out_hnd , " From: %s To: %s Domain: %s SID: %s \n " ,
info - > myhostname , srv_name , domain , sid ) ;
/* open SAMR session. negotiate credentials */
1998-09-25 22:20:05 +00:00
res = res ? cli_nt_session_open ( smb_cli , PIPE_SAMR , False ) : False ;
1998-09-25 21:01:52 +00:00
/* establish a connection. */
1998-09-25 22:20:05 +00:00
res = res ? do_samr_connect ( smb_cli ,
1998-09-25 21:01:52 +00:00
srv_name , 0x00000020 ,
& info - > dom . samr_pol_connect ) : False ;
/* connect to the domain */
1998-09-25 22:20:05 +00:00
res = res ? do_samr_open_domain ( smb_cli ,
& info - > dom . samr_pol_connect , admin_rid , & sid1 ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ) : False ;
fprintf ( out_hnd , " User RID: %8x User Name: %s \n " ,
user_rid ,
info - > dom . sam [ user_idx ] . acct_name ) ;
/* send user info query, level */
1998-09-25 22:20:05 +00:00
if ( get_samr_query_userinfo ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ,
info_level , user_rid , & usr ) )
{
if ( info_level = = 0x15 )
{
1998-09-25 22:20:05 +00:00
display_sam_user_info_21 ( out_hnd , ACTION_HEADER , & usr ) ;
display_sam_user_info_21 ( out_hnd , ACTION_ENUMERATE , & usr ) ;
display_sam_user_info_21 ( out_hnd , ACTION_FOOTER , & usr ) ;
1998-09-25 21:01:52 +00:00
}
}
1998-09-25 22:20:05 +00:00
res = res ? do_samr_close ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_connect ) : False ;
1998-09-25 22:20:05 +00:00
res = res ? do_samr_close ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ) : False ;
/* close the session */
1998-09-25 22:20:05 +00:00
cli_nt_session_close ( smb_cli ) ;
1998-09-25 21:01:52 +00:00
if ( res )
{
DEBUG ( 5 , ( " cmd_sam_query_user: succeeded \n " ) ) ;
}
else
{
DEBUG ( 5 , ( " cmd_sam_query_user: failed \n " ) ) ;
}
}
/****************************************************************************
experimental SAM groups query .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void cmd_sam_query_groups ( struct client_info * info )
{
fstring srv_name ;
fstring domain ;
1998-09-25 22:20:05 +00:00
fstring sid ;
DOM_SID sid1 ;
1998-09-25 21:01:52 +00:00
BOOL res = True ;
fstring info_str ;
uint32 switch_value = 2 ;
uint32 admin_rid = 0x304 ; /* absolutely no idea. */
fstrcpy ( sid , info - > dom . level5_sid ) ;
fstrcpy ( domain , info - > dom . level5_dom ) ;
if ( strlen ( sid ) = = 0 )
{
fprintf ( out_hnd , " please use 'lsaquery' first, to ascertain the SID \n " ) ;
return ;
}
1998-09-25 22:20:05 +00:00
make_dom_sid ( & sid1 , sid ) ;
fstrcpy ( srv_name , " \\ \\ " ) ;
fstrcat ( srv_name , info - > dest_host ) ;
1998-09-25 21:01:52 +00:00
strupper ( srv_name ) ;
1998-09-25 22:20:05 +00:00
if ( next_token ( NULL , info_str , NULL , sizeof ( info_str ) ) )
1998-09-25 21:01:52 +00:00
{
switch_value = strtoul ( info_str , ( char * * ) NULL , 10 ) ;
}
fprintf ( out_hnd , " SAM Query Groups: info level %d \n " , switch_value ) ;
fprintf ( out_hnd , " From: %s To: %s Domain: %s SID: %s \n " ,
info - > myhostname , srv_name , domain , sid ) ;
/* open SAMR session. negotiate credentials */
1998-09-25 22:20:05 +00:00
res = res ? cli_nt_session_open ( smb_cli , PIPE_SAMR , False ) : False ;
1998-09-25 21:01:52 +00:00
/* establish a connection. */
1998-09-25 22:20:05 +00:00
res = res ? do_samr_connect ( smb_cli ,
1998-09-25 21:01:52 +00:00
srv_name , 0x00000020 ,
& info - > dom . samr_pol_connect ) : False ;
/* connect to the domain */
1998-09-25 22:20:05 +00:00
res = res ? do_samr_open_domain ( smb_cli ,
& info - > dom . samr_pol_connect , admin_rid , & sid1 ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ) : False ;
/* send a samr 0x8 command */
1998-09-25 22:20:05 +00:00
res = res ? do_samr_unknown_8 ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain , switch_value ) : False ;
1998-09-25 22:20:05 +00:00
res = res ? do_samr_close ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_connect ) : False ;
1998-09-25 22:20:05 +00:00
res = res ? do_samr_close ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ) : False ;
/* close the session */
1998-09-25 22:20:05 +00:00
cli_nt_session_close ( smb_cli ) ;
1998-09-25 21:01:52 +00:00
if ( res )
{
DEBUG ( 5 , ( " cmd_sam_query_groups: succeeded \n " ) ) ;
}
else
{
DEBUG ( 5 , ( " cmd_sam_query_groups: failed \n " ) ) ;
}
}
/****************************************************************************
experimental SAM aliases query .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void cmd_sam_enum_aliases ( struct client_info * info )
{
fstring srv_name ;
fstring domain ;
1998-09-25 22:20:05 +00:00
fstring sid ;
DOM_SID sid1 ;
1998-09-25 21:01:52 +00:00
BOOL res = True ;
BOOL request_user_info = False ;
BOOL request_alias_info = False ;
uint32 admin_rid = 0x304 ; /* absolutely no idea. */
fstring tmp ;
uint32 num_aliases = 3 ;
uint32 alias_rid [ 3 ] = { DOMAIN_GROUP_RID_ADMINS , DOMAIN_GROUP_RID_USERS , DOMAIN_GROUP_RID_GUESTS } ;
fstring alias_names [ 3 ] ;
uint32 num_als_usrs [ 3 ] ;
fstrcpy ( sid , info - > dom . level5_sid ) ;
fstrcpy ( domain , info - > dom . level5_dom ) ;
if ( strlen ( sid ) = = 0 )
{
fprintf ( out_hnd , " please use 'lsaquery' first, to ascertain the SID \n " ) ;
return ;
}
1998-09-25 22:20:05 +00:00
make_dom_sid ( & sid1 , sid ) ;
fstrcpy ( srv_name , " \\ \\ " ) ;
fstrcat ( srv_name , info - > dest_host ) ;
1998-09-25 21:01:52 +00:00
strupper ( srv_name ) ;
/* a bad way to do token parsing... */
1998-09-25 22:20:05 +00:00
if ( next_token ( NULL , tmp , NULL , sizeof ( tmp ) ) )
1998-09-25 21:01:52 +00:00
{
request_user_info | = strequal ( tmp , " -u " ) ;
request_alias_info | = strequal ( tmp , " -g " ) ;
}
1998-09-25 22:20:05 +00:00
if ( next_token ( NULL , tmp , NULL , sizeof ( tmp ) ) )
1998-09-25 21:01:52 +00:00
{
request_user_info | = strequal ( tmp , " -u " ) ;
request_alias_info | = strequal ( tmp , " -g " ) ;
}
fprintf ( out_hnd , " SAM Enumerate Aliases \n " ) ;
fprintf ( out_hnd , " From: %s To: %s Domain: %s SID: %s \n " ,
info - > myhostname , srv_name , domain , sid ) ;
/* open SAMR session. negotiate credentials */
1998-09-25 22:20:05 +00:00
res = res ? cli_nt_session_open ( smb_cli , PIPE_SAMR , False ) : False ;
1998-09-25 21:01:52 +00:00
/* establish a connection. */
1998-09-25 22:20:05 +00:00
res = res ? do_samr_connect ( smb_cli ,
1998-09-25 21:01:52 +00:00
srv_name , 0x00000020 ,
& info - > dom . samr_pol_connect ) : False ;
/* connect to the domain */
1998-09-25 22:20:05 +00:00
res = res ? do_samr_open_domain ( smb_cli ,
& info - > dom . samr_pol_connect , admin_rid , & sid1 ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ) : False ;
/* send a query on the aliase */
1998-09-25 22:20:05 +00:00
res = res ? do_samr_query_unknown_12 ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain , admin_rid , num_aliases , alias_rid ,
& num_aliases , alias_names , num_als_usrs ) : False ;
if ( res )
{
1998-09-25 22:20:05 +00:00
display_alias_name_info ( out_hnd , ACTION_HEADER , num_aliases , alias_names , num_als_usrs ) ;
display_alias_name_info ( out_hnd , ACTION_ENUMERATE , num_aliases , alias_names , num_als_usrs ) ;
display_alias_name_info ( out_hnd , ACTION_FOOTER , num_aliases , alias_names , num_als_usrs ) ;
1998-09-25 21:01:52 +00:00
}
#if 0
/* read some users */
1998-09-25 22:20:05 +00:00
res = res ? do_samr_enum_dom_users ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ,
num_entries , unk_0 , acb_mask , unk_1 , 0xffff ,
info - > dom . sam , & info - > dom . num_sam_entries ) : False ;
if ( res & & info - > dom . num_sam_entries = = 0 )
{
fprintf ( out_hnd , " No users \n " ) ;
}
if ( request_user_info | | request_alias_info )
{
/* query all the users */
user_idx = 0 ;
while ( res & & user_idx < info - > dom . num_sam_entries )
{
uint32 user_rid = info - > dom . sam [ user_idx ] . smb_userid ;
SAM_USER_INFO_21 usr ;
fprintf ( out_hnd , " User RID: %8x User Name: %s \n " ,
user_rid ,
info - > dom . sam [ user_idx ] . acct_name ) ;
if ( request_user_info )
{
/* send user info query, level 0x15 */
1998-09-25 22:20:05 +00:00
if ( get_samr_query_userinfo ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ,
0x15 , user_rid , & usr ) )
{
1998-09-25 22:20:05 +00:00
display_sam_user_info_21 ( out_hnd , ACTION_HEADER , & usr ) ;
display_sam_user_info_21 ( out_hnd , ACTION_ENUMERATE , & usr ) ;
display_sam_user_info_21 ( out_hnd , ACTION_FOOTER , & usr ) ;
1998-09-25 21:01:52 +00:00
}
}
if ( request_alias_info )
{
uint32 num_aliases ;
DOM_GID gid [ LSA_MAX_GROUPS ] ;
/* send user aliase query */
1998-09-25 22:20:05 +00:00
if ( get_samr_query_useraliases ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ,
user_rid , & num_aliases , gid ) )
{
1998-09-25 22:20:05 +00:00
display_alias_info ( out_hnd , ACTION_HEADER , num_aliases , gid ) ;
display_alias_info ( out_hnd , ACTION_ENUMERATE , num_aliases , gid ) ;
display_alias_info ( out_hnd , ACTION_FOOTER , num_aliases , gid ) ;
1998-09-25 21:01:52 +00:00
}
}
user_idx + + ;
}
}
# endif
1998-09-25 22:20:05 +00:00
res = res ? do_samr_close ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_connect ) : False ;
1998-09-25 22:20:05 +00:00
res = res ? do_samr_close ( smb_cli ,
1998-09-25 21:01:52 +00:00
& info - > dom . samr_pol_open_domain ) : False ;
/* close the session */
1998-09-25 22:20:05 +00:00
cli_nt_session_close ( smb_cli ) ;
1998-09-25 21:01:52 +00:00
if ( res )
{
DEBUG ( 5 , ( " cmd_sam_enum_users: succeeded \n " ) ) ;
}
else
{
DEBUG ( 5 , ( " cmd_sam_enum_users: failed \n " ) ) ;
}
}