summaryrefslogtreecommitdiff
path: root/source3/utils/net_sam.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/utils/net_sam.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/utils/net_sam.c')
-rw-r--r--source3/utils/net_sam.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c
index ba3ec5c57f..ae0aef5960 100644
--- a/source3/utils/net_sam.c
+++ b/source3/utils/net_sam.c
@@ -27,10 +27,10 @@
*/
static int net_sam_userset(int argc, const char **argv, const char *field,
- BOOL (*fn)(SAM_ACCOUNT *, const char *,
+ BOOL (*fn)(struct samu *, const char *,
enum pdb_value_state))
{
- SAM_ACCOUNT *sam_acct = NULL;
+ struct samu *sam_acct = NULL;
DOM_SID sid;
enum SID_NAME_USE type;
const char *dom, *name;
@@ -76,7 +76,7 @@ static int net_sam_userset(int argc, const char **argv, const char *field,
return -1;
}
- pdb_free_sam(&sam_acct);
+ TALLOC_FREE(sam_acct);
d_printf("Updated %s for %s\\%s to %s\n", field, dom, name, argv[1]);
return 0;
@@ -125,7 +125,7 @@ static int net_sam_set_workstations(int argc, const char **argv)
static int net_sam_set_userflag(int argc, const char **argv, const char *field,
uint16 flag)
{
- SAM_ACCOUNT *sam_acct = NULL;
+ struct samu *sam_acct = NULL;
DOM_SID sid;
enum SID_NAME_USE type;
const char *dom, *name;
@@ -178,7 +178,7 @@ static int net_sam_set_userflag(int argc, const char **argv, const char *field,
return -1;
}
- pdb_free_sam(&sam_acct);
+ TALLOC_FREE(sam_acct);
d_fprintf(stderr, "Updated flag %s for %s\\%s to %s\n", field, dom,
name, argv[1]);
@@ -210,10 +210,10 @@ static int net_sam_set_pwnoexp(int argc, const char **argv)
*/
static int net_sam_set_time(int argc, const char **argv, const char *field,
- BOOL (*fn)(SAM_ACCOUNT *, time_t,
+ BOOL (*fn)(struct samu *, time_t,
enum pdb_value_state))
{
- SAM_ACCOUNT *sam_acct = NULL;
+ struct samu *sam_acct = NULL;
DOM_SID sid;
enum SID_NAME_USE type;
const char *dom, *name;
@@ -276,7 +276,7 @@ static int net_sam_set_time(int argc, const char **argv, const char *field,
return -1;
}
- pdb_free_sam(&sam_acct);
+ TALLOC_FREE(sam_acct);
d_printf("Updated %s for %s\\%s to %s\n", field, dom, name, argv[1]);
return 0;