summaryrefslogtreecommitdiff
path: root/source3/utils/pdbedit.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2001-12-27 06:38:04 +0000
committerGerald Carter <jerry@samba.org>2001-12-27 06:38:04 +0000
commit04aff47c716a51a1039b44a81d6ff19eeaa09017 (patch)
treee2fc04ef3089c003baa711d55cd89310b824d44b /source3/utils/pdbedit.c
parentb6bbc39204a4676922099ab78b6c48009266d1bb (diff)
downloadsamba-04aff47c716a51a1039b44a81d6ff19eeaa09017.tar.gz
samba-04aff47c716a51a1039b44a81d6ff19eeaa09017.tar.bz2
samba-04aff47c716a51a1039b44a81d6ff19eeaa09017.zip
moving SAM_ACCOUNT to include a bit field for initialized
members (such as uid and gid). This way we will be able to keep ourselves from writing out default smb.conf settings when the admin doesn't want to, That part is not done yet. Tested compiles with ldap/tdb/smbpasswd. Tested connection with smbpasswd backend. oh...and smbpasswd doesn'y automatically expire accounts after 21 days from the last password change either now. Just ifdef'd out that code in build_sam_account(). Will merge updates into 2.2 as they are necessary. jerry (This used to be commit f0d43791157d8f04a13a07d029f203ad4384d317)
Diffstat (limited to 'source3/utils/pdbedit.c')
-rw-r--r--source3/utils/pdbedit.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index 73423e0bee..ce241934a1 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -74,17 +74,17 @@ static void usage(void)
static int print_sam_info (SAM_ACCOUNT *sam_pwent, BOOL verbosity, BOOL smbpwdstyle)
{
- uid_t *puid;
- gid_t *pgid;
+ uid_t uid;
+ gid_t gid;
/* TODO: chaeck if entry is a user or a workstation */
if (!sam_pwent) return -1;
if (verbosity) {
printf ("username: %s\n", pdb_get_username(sam_pwent));
- if ((puid = pdb_get_uid(sam_pwent)) && (pgid = pdb_get_gid(sam_pwent))) {
- printf ("user ID/Group: %d/%d\n", (unsigned int)*puid,
- (unsigned int)*pgid);
+ if ((uid = pdb_get_uid(sam_pwent)) && (gid = pdb_get_gid(sam_pwent))) {
+ printf ("user ID/Group: %d/%d\n", (unsigned int)uid,
+ (unsigned int)gid);
}
printf ("user RID/GRID: %u/%u\n", (unsigned int)sam_pwent->user_rid,
(unsigned int)sam_pwent->group_rid);
@@ -94,7 +94,7 @@ static int print_sam_info (SAM_ACCOUNT *sam_pwent, BOOL verbosity, BOOL smbpwdst
printf ("Logon Script: %s\n", pdb_get_logon_script(sam_pwent));
printf ("Profile Path: %s\n", pdb_get_profile_path(sam_pwent));
} else if (smbpwdstyle) {
- if ((puid = pdb_get_uid(sam_pwent))) {
+ if ((uid = pdb_get_uid(sam_pwent))) {
char lm_passwd[33];
char nt_passwd[33];
pdb_sethexpwd(lm_passwd,
@@ -106,7 +106,7 @@ static int print_sam_info (SAM_ACCOUNT *sam_pwent, BOOL verbosity, BOOL smbpwdst
printf("%s:%d:%s:%s:%s:LCT-%08X:\n",
pdb_get_username(sam_pwent),
- (unsigned int)*puid,
+ (unsigned int)uid,
lm_passwd,
nt_passwd,
pdb_encode_acct_ctrl(pdb_get_acct_ctrl(sam_pwent),NEW_PW_FORMAT_SPACE_PADDED_LEN),
@@ -115,8 +115,8 @@ static int print_sam_info (SAM_ACCOUNT *sam_pwent, BOOL verbosity, BOOL smbpwdst
fprintf(stderr, "Can't output in smbpasswd format, no uid on this record.\n");
}
} else {
- if ((puid = pdb_get_uid(sam_pwent))) {
- printf ("%s:%d:%s\n", pdb_get_username(sam_pwent), *puid, pdb_get_fullname(sam_pwent));
+ if ((uid = pdb_get_uid(sam_pwent))) {
+ printf ("%s:%d:%s\n", pdb_get_username(sam_pwent), uid, pdb_get_fullname(sam_pwent));
} else {
printf ("%s:(null):%s\n", pdb_get_username(sam_pwent), pdb_get_fullname(sam_pwent));
}