mirror of
https://github.com/samba-team/samba.git
synced 2025-03-08 04:58:40 +03:00
- initialising mach_passwd_file locks to zero (prev. uninit.)
- cleanup - #defined report to sprintf as it's #defined to another function in other uses of cmd_lsarpc.c (This used to be commit 8fb2ff247a2fe0ec5ce0c232d8a3da9774f7e6ae)
This commit is contained in:
parent
856a3e2740
commit
ddf33698b5
@ -24,6 +24,8 @@
|
||||
#ifndef _RPCCLIENT_H
|
||||
#define _RPCCLIENT_H
|
||||
|
||||
#define report fprintf
|
||||
|
||||
struct tar_client_info
|
||||
{
|
||||
int blocksize;
|
||||
|
@ -22,8 +22,8 @@
|
||||
extern int DEBUGLEVEL;
|
||||
|
||||
BOOL global_machine_password_needs_changing = False;
|
||||
static int mach_passwd_lock_depth;
|
||||
static FILE *mach_passwd_fp;
|
||||
static int mach_passwd_lock_depth = 0;
|
||||
static FILE *mach_passwd_fp = NULL;
|
||||
|
||||
/************************************************************************
|
||||
Routine to get the name for a trust account file.
|
||||
|
@ -264,7 +264,7 @@ BOOL lsa_lookup_names(struct cli_state *cli, uint16 fnum,
|
||||
if (p && r_l.status != 0)
|
||||
{
|
||||
/* report error code */
|
||||
DEBUG(0,("LSA_LOOKUP_NAMES: %s\n", get_nt_error_msg(r_l.status)));
|
||||
DEBUG(1,("LSA_LOOKUP_NAMES: %s\n", get_nt_error_msg(r_l.status)));
|
||||
p = False;
|
||||
}
|
||||
|
||||
@ -390,10 +390,10 @@ BOOL lsa_lookup_sids(struct cli_state *cli, uint16 fnum,
|
||||
lsa_io_r_lookup_sids("", &r_l, &rbuf, 0);
|
||||
p = rbuf.offset != 0;
|
||||
|
||||
if (p && r_l.status != 0)
|
||||
if (p && r_l.status != 0 && r_l.status != 0x107)
|
||||
{
|
||||
/* report error code */
|
||||
DEBUG(0,("LSA_LOOKUP_SIDS: %s\n", get_nt_error_msg(r_l.status)));
|
||||
DEBUG(1,("LSA_LOOKUP_SIDS: %s\n", get_nt_error_msg(r_l.status)));
|
||||
p = False;
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ BOOL do_srv_net_srv_sess_enum(struct cli_state *cli, uint16 fnum,
|
||||
if (p && r_o.status != 0)
|
||||
{
|
||||
/* report error code */
|
||||
DEBUG(0,("SRV_R_NET_SRV_GET_INFO: %s\n", get_nt_error_msg(r_o.status)));
|
||||
DEBUG(0,("SRV_R_NET_SRV_SESS_ENUM: %s\n", get_nt_error_msg(r_o.status)));
|
||||
p = 0;
|
||||
}
|
||||
|
||||
|
@ -493,7 +493,7 @@ void make_q_query_secret(LSA_Q_QUERY_SECRET *q_q, POLICY_HND *pol)
|
||||
{
|
||||
if (q_q == NULL) return;
|
||||
|
||||
DEBUG(5,("make_q_query_secret"));
|
||||
DEBUG(5,("make_q_query_secret\n"));
|
||||
|
||||
memcpy(&(q_q->pol), pol, sizeof(q_q->pol));
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifdef SYSLOG
|
||||
#undef SYSLOG
|
||||
#endif
|
||||
@ -33,11 +32,10 @@ extern int DEBUGLEVEL;
|
||||
|
||||
#define DEBUG_TESTING
|
||||
|
||||
extern struct cli_state *smb_cli;
|
||||
extern int smb_tidx;
|
||||
|
||||
extern FILE* out_hnd;
|
||||
|
||||
extern struct cli_state *smb_cli;
|
||||
extern int smb_tidx;
|
||||
|
||||
/****************************************************************************
|
||||
nt lsa query
|
||||
@ -93,25 +91,25 @@ void cmd_lsa_query_info(struct client_info *info)
|
||||
fstring sid;
|
||||
DEBUG(5,("cmd_lsa_query_info: query succeeded\n"));
|
||||
|
||||
fprintf(out_hnd, "LSA Query Info Policy\n");
|
||||
report(out_hnd, "LSA Query Info Policy\n");
|
||||
|
||||
if (info->dom.level3_dom[0] != 0)
|
||||
{
|
||||
sid_to_string(sid, &info->dom.level3_sid);
|
||||
fprintf(out_hnd, "Domain Member - Domain: %s SID: %s\n",
|
||||
report(out_hnd, "Domain Member - Domain: %s SID: %s\n",
|
||||
info->dom.level3_dom, sid);
|
||||
domain_something = True;
|
||||
}
|
||||
if (info->dom.level5_dom[0] != 0)
|
||||
{
|
||||
sid_to_string(sid, &info->dom.level5_sid);
|
||||
fprintf(out_hnd, "Domain Controller - Domain: %s SID: %s\n",
|
||||
report(out_hnd, "Domain Controller - Domain: %s SID: %s\n",
|
||||
info->dom.level5_dom, sid);
|
||||
domain_something = True;
|
||||
}
|
||||
if (!domain_something)
|
||||
{
|
||||
fprintf(out_hnd, "%s is not a Domain Member or Controller\n",
|
||||
report(out_hnd, "%s is not a Domain Member or Controller\n",
|
||||
info->dest_host);
|
||||
}
|
||||
}
|
||||
@ -154,7 +152,7 @@ void cmd_lsa_lookup_names(struct client_info *info)
|
||||
|
||||
if (num_names == 0)
|
||||
{
|
||||
fprintf(out_hnd, "lookupnames <name> [<name> ...]\n");
|
||||
report(out_hnd, "lookupnames <name> [<name> ...]\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -188,11 +186,11 @@ void cmd_lsa_lookup_names(struct client_info *info)
|
||||
|
||||
if (sids != NULL)
|
||||
{
|
||||
fprintf(out_hnd,"Lookup Names:\n");
|
||||
report(out_hnd, "Lookup Names:\n");
|
||||
for (i = 0; i < num_sids; i++)
|
||||
{
|
||||
sid_to_string(temp, &sids[i]);
|
||||
fprintf(out_hnd, "SID: %s -> %s\n", names[i], temp);
|
||||
report(out_hnd, "SID: %s -> %s\n", names[i], temp);
|
||||
#if 0
|
||||
if (sids[i] != NULL)
|
||||
{
|
||||
@ -248,7 +246,7 @@ void cmd_lsa_lookup_sids(struct client_info *info)
|
||||
|
||||
if (sid_name[0] == 0)
|
||||
{
|
||||
fprintf(out_hnd, "please use lsaquery first or specify a complete SID\n");
|
||||
report(out_hnd, "please use lsaquery first or specify a complete SID\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -262,7 +260,7 @@ void cmd_lsa_lookup_sids(struct client_info *info)
|
||||
|
||||
if (num_sids == 0)
|
||||
{
|
||||
fprintf(out_hnd, "lookupsid RID or SID\n");
|
||||
report(out_hnd, "lookupsid RID or SID\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -295,11 +293,11 @@ void cmd_lsa_lookup_sids(struct client_info *info)
|
||||
}
|
||||
if (names != NULL)
|
||||
{
|
||||
fprintf(out_hnd,"Lookup SIDS:\n");
|
||||
report(out_hnd, "Lookup SIDS:\n");
|
||||
for (i = 0; i < num_names; i++)
|
||||
{
|
||||
sid_to_string(temp, sids[i]);
|
||||
fprintf(out_hnd, "SID: %s -> %s\n", temp, names[i]);
|
||||
report(out_hnd, "SID: %s -> %s\n", temp, names[i]);
|
||||
if (names[i] != NULL)
|
||||
{
|
||||
free(names[i]);
|
||||
@ -329,7 +327,7 @@ void cmd_lsa_query_secret(struct client_info *info)
|
||||
|
||||
if (!next_token(NULL, secret_name, NULL, sizeof(secret_name)))
|
||||
{
|
||||
fprintf(out_hnd, "querysecret <secret name>\n");
|
||||
report(out_hnd, "querysecret <secret name>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -350,7 +348,7 @@ void cmd_lsa_query_secret(struct client_info *info)
|
||||
/* lookup domain controller; receive a policy handle */
|
||||
res1 = res ? lsa_open_secret(smb_cli, nt_pipe_fnum,
|
||||
&info->dom.lsa_info_pol,
|
||||
secret_name, 0x20003, &hnd_secret) : False;
|
||||
secret_name, 0xf003f, &hnd_secret) : False;
|
||||
|
||||
res2 = res1 ? lsa_query_secret(smb_cli, nt_pipe_fnum,
|
||||
&hnd_secret, &enc_secret, &last_update) : False;
|
||||
@ -364,18 +362,18 @@ void cmd_lsa_query_secret(struct client_info *info)
|
||||
|
||||
if (res2 && nt_decrypt_string2(&secret, &enc_secret, smb_cli->pwd.smb_nt_pwd))
|
||||
{
|
||||
fprintf(out_hnd, "\tValue : ");
|
||||
report(out_hnd, "\tValue : ");
|
||||
for (i = 0; i < secret.str_str_len; i++)
|
||||
{
|
||||
fprintf(out_hnd, "%02X", secret.buffer[i]);
|
||||
report(out_hnd, "%02X", secret.buffer[i]);
|
||||
}
|
||||
|
||||
fprintf(out_hnd, "\n\tLast Updated: %s\n\n",
|
||||
report(out_hnd, "\n\tLast Updated: %s\n\n",
|
||||
http_timestring(nt_time_to_unix(&last_update)));
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(out_hnd, "LSA Query Secret: failed\n");
|
||||
report(out_hnd, "LSA Query Secret: failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -778,7 +778,6 @@ void smbd_process(void)
|
||||
{
|
||||
extern fstring remote_machine;
|
||||
extern fstring local_machine;
|
||||
char *s;
|
||||
|
||||
fstrcpy(remote_machine, dns_to_netbios_name(client_name(Client)));
|
||||
fstrcpy(local_machine, global_myname);
|
||||
|
Loading…
x
Reference in New Issue
Block a user