From 068e77c86104c5cae2edc4418797e656d617e182 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 25 Mar 1999 21:32:04 +0000 Subject: "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) --- source3/passdb/sampassdb.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'source3/passdb') 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. **************************************************************/ -- cgit