From 30c4c04c2f584857633ce7605555dcfb37a3e1af Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 7 May 2001 14:04:46 +0000 Subject: Patch from Simo: o sed 's/pdb_clear_sam/pdb_free_sam/g' o add pdb_reset_sam() o password changing should be ok now as well. (This used to be commit 96d0e7c3301ad990f6c83b9c216720cb32661fb5) --- source3/utils/pdbedit.c | 15 ++++++++------- source3/utils/smbpasswd.c | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c index da57dbd8c8..ef62fe32df 100644 --- a/source3/utils/pdbedit.c +++ b/source3/utils/pdbedit.c @@ -122,12 +122,12 @@ static int print_user_info (char *username, BOOL verbosity, BOOL smbpwdstyle) if (ret==False) { fprintf (stderr, "Username not found!\n"); - pdb_clear_sam(sam_pwent); + pdb_free_sam(sam_pwent); return -1; } ret=print_sam_info (sam_pwent, verbosity, smbpwdstyle); - pdb_clear_sam(sam_pwent); + pdb_free_sam(sam_pwent); return ret; } @@ -145,7 +145,7 @@ static int print_users_list (BOOL verbosity, BOOL smbpwdstyle) ret = pdb_setsampwent(False); if (ret && errno == ENOENT) { fprintf (stderr,"Password database not found!\n"); - pdb_clear_sam(sam_pwent); + pdb_free_sam(sam_pwent); exit(1); } @@ -153,10 +153,11 @@ static int print_users_list (BOOL verbosity, BOOL smbpwdstyle) { if (verbosity) printf ("---------------\n"); print_sam_info (sam_pwent, verbosity, smbpwdstyle); + pdb_reset_sam(sam_pwent); } pdb_endsampwent (); - pdb_clear_sam(sam_pwent); + pdb_free_sam(sam_pwent); return 0; } @@ -174,7 +175,7 @@ static int set_user_info (char *username, char *fullname, char *homedir, char *d if (ret==False) { fprintf (stderr, "Username not found!\n"); - pdb_clear_sam(sam_pwent); + pdb_free_sam(sam_pwent); return -1; } @@ -188,10 +189,10 @@ static int set_user_info (char *username, char *fullname, char *homedir, char *d else { fprintf (stderr, "Unable to modify entry!\n"); - pdb_clear_sam(sam_pwent); + pdb_free_sam(sam_pwent); return -1; } - pdb_clear_sam(sam_pwent); + pdb_free_sam(sam_pwent); return 0; } diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index 2131ea0d8f..00a7d3c1c1 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -420,7 +420,7 @@ static int process_root(int argc, char *argv[]) if((sampass != False) && (pdb_get_lanman_passwd(sampass) != NULL)) { new_passwd = xstrdup("XXXX"); /* Don't care. */ } - pdb_clear_sam(sampass); + pdb_free_sam(sampass); } if(!new_passwd) @@ -451,7 +451,7 @@ static int process_root(int argc, char *argv[]) if((ret != False) && (pdb_get_acct_ctrl(sampass) & ACB_PWNOTREQ) ) printf(" User has no password flag set."); printf("\n"); - pdb_clear_sam(sampass); + pdb_free_sam(sampass); } done: -- cgit