diff options
author | Luke Leighton <lkcl@samba.org> | 1999-03-25 21:32:04 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-03-25 21:32:04 +0000 |
commit | 068e77c86104c5cae2edc4418797e656d617e182 (patch) | |
tree | 7cf362e13c44a7a972314164992c443c3e654ddd /source3/passdb | |
parent | 754be76bde565cb855877071e4454930bea65aae (diff) | |
download | samba-068e77c86104c5cae2edc4418797e656d617e182.tar.gz samba-068e77c86104c5cae2edc4418797e656d617e182.tar.bz2 samba-068e77c86104c5cae2edc4418797e656d617e182.zip |
"User Manager" - create user + change password now work.
next problem: user group adding not supported so an "access denied"
message is reported instead of "ok" when a new user is created.
(This used to be commit f5f61bd477b4910cb90675c926381342c30a5b16)
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/sampassdb.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/source3/passdb/sampassdb.c b/source3/passdb/sampassdb.c index 13474eda78..e8a92d778d 100644 --- a/source3/passdb/sampassdb.c +++ b/source3/passdb/sampassdb.c @@ -342,6 +342,48 @@ struct sam_disp_info *pwdb_sam_to_dispinfo(struct sam_passwd *user) return &disp_info; } +static void select_name(fstring string, char **name, const UNISTR2 *from) +{ + if (from->buffer != 0) + { + unistr2_to_ascii(string, from, sizeof(string)); + *name = string; + } +} + +/************************************************************* + copies a sam passwd. + **************************************************************/ +void copy_id23_to_sam_passwd(struct sam_passwd *to, const SAM_USER_INFO_23 *from) +{ + static fstring nt_name; + static fstring full_name; + static fstring home_dir; + static fstring dir_drive; + static fstring logon_script; + static fstring profile_path; + static fstring acct_desc; + static fstring workstations; + static fstring unknown_str; + static fstring munged_dial; + + if (from == NULL || to == NULL) return; + + memcpy(to, from, sizeof(*from)); + + select_name(nt_name , &to->nt_name , &from->uni_user_name ); + select_name(full_name , &to->full_name , &from->uni_full_name ); + select_name(home_dir , &to->home_dir , &from->uni_home_dir ); + select_name(dir_drive , &to->dir_drive , &from->uni_dir_drive ); + select_name(logon_script, &to->logon_script, &from->uni_logon_script); + select_name(profile_path, &to->profile_path, &from->uni_profile_path); + select_name(acct_desc , &to->acct_desc , &from->uni_acct_desc ); + select_name(workstations, &to->workstations, &from->uni_workstations); + select_name(unknown_str , &to->unknown_str , &from->uni_unknown_str ); + select_name(munged_dial , &to->munged_dial , &from->uni_munged_dial ); +} + + /************************************************************* copies a sam passwd. **************************************************************/ |