summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_netlog_nt.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-02-20 20:09:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:10:15 -0500
commit2203bed32c84c63737f402accf73452efb76b483 (patch)
tree76259a35b1137cfa89547b80b2b93eb0eedf5bcf /source3/rpc_server/srv_netlog_nt.c
parent69b2669b559c009d17f621cbc7c6937eafc56af6 (diff)
downloadsamba-2203bed32c84c63737f402accf73452efb76b483.tar.gz
samba-2203bed32c84c63737f402accf73452efb76b483.tar.bz2
samba-2203bed32c84c63737f402accf73452efb76b483.zip
r13576: This is the beginnings of moving the SAM_ACCOUNT data structure
to make full use of the new talloc() interface. Discussed with Volker and Jeremy. * remove the internal mem_ctx and simply use the talloc() structure as the context. * replace the internal free_fn() with a talloc_destructor() function * remove the unnecessary private nested structure * rename SAM_ACCOUNT to 'struct samu' to indicate the current an upcoming changes. Groups will most likely be replaced with a 'struct samg' in the future. Note that there are now passbd API changes. And for the most part, the wrapper functions remain the same. While this code has been tested on tdb and ldap based Samba PDC's as well as Samba member servers, there are probably still some bugs. The code also needs more testing under valgrind to ensure it's not leaking memory. But it's a start...... (This used to be commit 19b7593972480540283c5bf02c02e5ecd8d2c3f0)
Diffstat (limited to 'source3/rpc_server/srv_netlog_nt.c')
-rw-r--r--source3/rpc_server/srv_netlog_nt.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index 737729a4ce..ea0685f41b 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -206,7 +206,7 @@ static void init_net_r_srv_pwset(NET_R_SRV_PWSET *r_s,
static BOOL get_md4pw(char *md4pw, char *mach_acct)
{
- SAM_ACCOUNT *sampass = NULL;
+ struct samu *sampass = NULL;
const uint8 *pass;
BOOL ret;
uint32 acct_ctrl;
@@ -239,7 +239,7 @@ static BOOL get_md4pw(char *md4pw, char *mach_acct)
if (ret==False) {
DEBUG(0,("get_md4pw: Workstation %s: no account in domain\n", mach_acct));
- pdb_free_sam(&sampass);
+ TALLOC_FREE(sampass);
return False;
}
@@ -251,12 +251,12 @@ static BOOL get_md4pw(char *md4pw, char *mach_acct)
((pass=pdb_get_nt_passwd(sampass)) != NULL)) {
memcpy(md4pw, pass, 16);
dump_data(5, md4pw, 16);
- pdb_free_sam(&sampass);
+ TALLOC_FREE(sampass);
return True;
}
DEBUG(0,("get_md4pw: Workstation %s: no account in domain\n", mach_acct));
- pdb_free_sam(&sampass);
+ TALLOC_FREE(sampass);
return False;
}
@@ -462,7 +462,7 @@ NTSTATUS _net_srv_pwset(pipes_struct *p, NET_Q_SRV_PWSET *q_u, NET_R_SRV_PWSET *
{
NTSTATUS status = NT_STATUS_ACCESS_DENIED;
fstring remote_machine;
- SAM_ACCOUNT *sampass=NULL;
+ struct samu *sampass=NULL;
BOOL ret = False;
unsigned char pwd[16];
int i;
@@ -529,12 +529,12 @@ NTSTATUS _net_srv_pwset(pipes_struct *p, NET_Q_SRV_PWSET *q_u, NET_R_SRV_PWSET *
&& (acct_ctrl & ACB_WSTRUST ||
acct_ctrl & ACB_SVRTRUST ||
acct_ctrl & ACB_DOMTRUST))) {
- pdb_free_sam(&sampass);
+ TALLOC_FREE(sampass);
return NT_STATUS_NO_SUCH_USER;
}
if (pdb_get_acct_ctrl(sampass) & ACB_DISABLED) {
- pdb_free_sam(&sampass);
+ TALLOC_FREE(sampass);
return NT_STATUS_ACCOUNT_DISABLED;
}
@@ -557,17 +557,17 @@ NTSTATUS _net_srv_pwset(pipes_struct *p, NET_Q_SRV_PWSET *q_u, NET_R_SRV_PWSET *
/* LM password should be NULL for machines */
if (!pdb_set_lanman_passwd(sampass, NULL, PDB_CHANGED)) {
- pdb_free_sam(&sampass);
+ TALLOC_FREE(sampass);
return NT_STATUS_NO_MEMORY;
}
if (!pdb_set_nt_passwd(sampass, pwd, PDB_CHANGED)) {
- pdb_free_sam(&sampass);
+ TALLOC_FREE(sampass);
return NT_STATUS_NO_MEMORY;
}
if (!pdb_set_pass_changed_now(sampass)) {
- pdb_free_sam(&sampass);
+ TALLOC_FREE(sampass);
/* Not quite sure what this one qualifies as, but this will do */
return NT_STATUS_UNSUCCESSFUL;
}
@@ -580,7 +580,7 @@ NTSTATUS _net_srv_pwset(pipes_struct *p, NET_Q_SRV_PWSET *q_u, NET_R_SRV_PWSET *
/* set up the LSA Server Password Set response */
init_net_r_srv_pwset(r_u, &cred_out, status);
- pdb_free_sam(&sampass);
+ TALLOC_FREE(sampass);
return r_u->status;
}
@@ -696,7 +696,7 @@ static NTSTATUS _net_sam_logon_internal(pipes_struct *p,
fstring nt_username, nt_domain, nt_workstation;
auth_usersupplied_info *user_info = NULL;
auth_serversupplied_info *server_info = NULL;
- SAM_ACCOUNT *sampw;
+ struct samu *sampw;
struct auth_context *auth_context = NULL;
if ( (lp_server_schannel() == True) && (p->auth.auth_type != PIPE_AUTH_TYPE_SCHANNEL) ) {