summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-09-06 09:10:26 +0000
committerTim Potter <tpot@samba.org>2001-09-06 09:10:26 +0000
commit65e35d5d4bf2a35fde52d1fb795c84764009acad (patch)
treead42f02edccab85e0ccd49ece7e8fba347a0d6e1 /source3/utils
parent5661d1c82f03b2254b681e135b20991da334d27f (diff)
downloadsamba-65e35d5d4bf2a35fde52d1fb795c84764009acad.tar.gz
samba-65e35d5d4bf2a35fde52d1fb795c84764009acad.tar.bz2
samba-65e35d5d4bf2a35fde52d1fb795c84764009acad.zip
Started a cleanup of smbpasswd related stuff. I've created a new file
lib/smbpasswd.c which will contain routines related to manipulating smbpasswd entries. - renamed and moved pdb_{get,set}hexpwd() functions - renamed and moved pdb_{decode,encode}acct_ctrl() functions - started hiding references to the cruftalicious NEW_PW_FORMAT_SPACE_PADDED_LEN constant - started gradual rename of references to acct_ctrl to acb_info which is the nomenclature used in MSDN and header files There's still more work to be done. Currently there are several places where smbpasswd entries are iterated etc. Ideally this should all happen through the passdb system. (This used to be commit 4a01e240305fb6fead973beef4937a016b15d744)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/pdbedit.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index 1068446905..f09fd4f773 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -89,16 +89,20 @@ static int print_sam_info (SAM_ACCOUNT *sam_pwent, BOOL verbosity, BOOL smbpwdst
{
char lm_passwd[33];
char nt_passwd[33];
- pdb_sethexpwd(lm_passwd, pdb_get_lanman_passwd(sam_pwent), pdb_get_acct_ctrl(sam_pwent));
- pdb_sethexpwd(nt_passwd, pdb_get_nt_passwd(sam_pwent), pdb_get_acct_ctrl(sam_pwent));
+ smbpasswd_sethexpwd(lm_passwd,
+ pdb_get_lanman_passwd(sam_pwent),
+ pdb_get_acct_ctrl(sam_pwent));
+ smbpasswd_sethexpwd(nt_passwd,
+ pdb_get_nt_passwd(sam_pwent),
+ pdb_get_acct_ctrl(sam_pwent));
- printf ("%s:%d:%s:%s:%s:LCT-%08x:\n",
- pdb_get_username(sam_pwent),
- pdb_get_uid(sam_pwent),
- lm_passwd,
- nt_passwd,
- pdb_encode_acct_ctrl(pdb_get_acct_ctrl(sam_pwent),NEW_PW_FORMAT_SPACE_PADDED_LEN),
- (uint32)pdb_get_pass_last_set_time(sam_pwent));
+ printf("%s:%d:%s:%s:%s:LCT-%08x:\n",
+ pdb_get_username(sam_pwent),
+ pdb_get_uid(sam_pwent),
+ lm_passwd,
+ nt_passwd,
+ smbpasswd_encode_acb_info(pdb_get_acct_ctrl(sam_pwent)),
+ (uint32)pdb_get_pass_last_set_time(sam_pwent));
}
else
{
@@ -452,7 +456,7 @@ static int import_users (char *filename)
}
else
{
- if (!pdb_gethexpwd((char *)p, smbpwd))
+ if (!smbpasswd_gethexpwd((char *)p, smbpwd))
{
fprintf (stderr, "Error: malformed Lanman password entry at line %d (non hex chars)\n", line);
continue;
@@ -466,7 +470,7 @@ static int import_users (char *filename)
{
if (*p != '*' && *p != 'X')
{
- if (pdb_gethexpwd((char *)p,smbntpwd))
+ if (smbpasswd_gethexpwd((char *)p,smbntpwd))
{
sam_pwent.nt_pw = smbntpwd;
}
@@ -480,7 +484,7 @@ static int import_users (char *filename)
{
unsigned char *end_p = (unsigned char *)strchr_m((char *)p, ']');
- sam_pwent.acct_ctrl = pdb_decode_acct_ctrl((char*)p);
+ sam_pwent.acct_ctrl = smbpasswd_decode_acb_info((char*)p);
if(sam_pwent.acct_ctrl == 0) sam_pwent.acct_ctrl = ACB_NORMAL;
/* Get last change time */