#include "includes.h"
extern pstring global_myname;
+extern BOOL AllowDebugChange;
/*
* Next two lines needed for SunOS and don't
if (verbosity) {
printf ("username: %s\n", pdb_get_username(sam_pwent));
- 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);
+ if (IS_SAM_UNIX_USER(sam_pwent)) {
+ uid = pdb_get_uid(sam_pwent);
+ gid = pdb_get_gid(sam_pwent);
+ printf ("user ID/Group: %d/%d\n", uid, gid);
}
- printf ("user RID/GRID: %u/%u\n", (unsigned int)sam_pwent->user_rid,
- (unsigned int)sam_pwent->group_rid);
+ printf ("user RID/GRID: %u/%u\n", (unsigned int)pdb_get_user_rid(sam_pwent),
+ (unsigned int)pdb_get_group_rid(sam_pwent));
printf ("Full Name: %s\n", pdb_get_fullname(sam_pwent));
printf ("Home Directory: %s\n", pdb_get_homedir(sam_pwent));
printf ("HomeDir Drive: %s\n", pdb_get_dirdrive(sam_pwent));
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 ((uid = pdb_get_uid(sam_pwent))) {
+ if (IS_SAM_UNIX_USER(sam_pwent)) {
char lm_passwd[33];
char nt_passwd[33];
+
+ uid = pdb_get_uid(sam_pwent);
pdb_sethexpwd(lm_passwd,
pdb_get_lanman_passwd(sam_pwent),
pdb_get_acct_ctrl(sam_pwent));
printf("%s:%d:%s:%s:%s:LCT-%08X:\n",
pdb_get_username(sam_pwent),
- (unsigned int)uid,
+ uid,
lm_passwd,
nt_passwd,
pdb_encode_acct_ctrl(pdb_get_acct_ctrl(sam_pwent),NEW_PW_FORMAT_SPACE_PADDED_LEN),
fprintf(stderr, "Can't output in smbpasswd format, no uid on this record.\n");
}
} else {
- if ((uid = pdb_get_uid(sam_pwent))) {
- printf ("%s:%d:%s\n", pdb_get_username(sam_pwent), uid, pdb_get_fullname(sam_pwent));
+ if (IS_SAM_UNIX_USER(sam_pwent)) {
+ printf ("%s:%d:%s\n", pdb_get_username(sam_pwent), pdb_get_uid(sam_pwent),
+ pdb_get_fullname(sam_pwent));
} else {
printf ("%s:(null):%s\n", pdb_get_username(sam_pwent), pdb_get_fullname(sam_pwent));
}
if (fullname)
pdb_set_fullname(sam_pwent, fullname);
if (homedir)
- pdb_set_homedir(sam_pwent, homedir);
+ pdb_set_homedir(sam_pwent, homedir, True);
if (drive)
- pdb_set_dir_drive(sam_pwent,drive);
+ pdb_set_dir_drive(sam_pwent,drive, True);
if (script)
- pdb_set_logon_script(sam_pwent, script);
+ pdb_set_logon_script(sam_pwent, script, True);
if (profile)
- pdb_set_profile_path (sam_pwent, profile);
+ pdb_set_profile_path (sam_pwent, profile, True);
if (pdb_update_sam_account (sam_pwent, True))
print_user_info (username, True, False);
if (fullname)
pdb_set_fullname(sam_pwent, fullname);
if (homedir)
- pdb_set_homedir (sam_pwent, homedir);
+ pdb_set_homedir (sam_pwent, homedir, True);
if (drive)
- pdb_set_dir_drive (sam_pwent, drive);
+ pdb_set_dir_drive (sam_pwent, drive, True);
if (script)
- pdb_set_logon_script(sam_pwent, script);
+ pdb_set_logon_script(sam_pwent, script, True);
if (profile)
- pdb_set_profile_path (sam_pwent, profile);
+ pdb_set_profile_path (sam_pwent, profile, True);
pdb_set_acct_ctrl (sam_pwent, ACB_NORMAL);
return False;
}
- if (!pdb_init_sam_pw(&sam_pwent, pwd)) {
+ if (!NT_STATUS_IS_OK(pdb_init_sam_pw(&sam_pwent, pwd))) {
fprintf(stderr, "Failed initialise SAM_ACCOUNT for user %s.\n", user_name);
return False;
}
exit(1);
}
+ DEBUGLEVEL = 1;
+ AllowDebugChange = False;
+
if (!lp_load(dyn_CONFIGFILE,True,False,False)) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n",
dyn_CONFIGFILE);