summaryrefslogtreecommitdiff
path: root/source3/utils/pdbedit.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/pdbedit.c')
-rw-r--r--source3/utils/pdbedit.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index c229d100ca..2b356095c5 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -231,10 +231,7 @@ static int print_users_list (struct pdb_context *in, BOOL verbosity, BOOL smbpwd
Set User Info
**********************************************************/
-static int set_user_info (struct pdb_context *in, const char *username,
- const char *fullname, const char *homedir,
- const char *drive, const char *script,
- const char *profile)
+static int set_user_info (struct pdb_context *in, char *username, char *fullname, char *homedir, char *drive, char *script, char *profile)
{
SAM_ACCOUNT *sam_pwent=NULL;
BOOL ret;
@@ -273,7 +270,7 @@ static int set_user_info (struct pdb_context *in, const char *username,
/*********************************************************
Add New User
**********************************************************/
-static int new_user (struct pdb_context *in, const char *username, const char *fullname, const char *homedir, const char *drive, const char *script, const char *profile)
+static int new_user (struct pdb_context *in, char *username, char *fullname, char *homedir, char *drive, char *script, char *profile)
{
SAM_ACCOUNT *sam_pwent=NULL;
struct passwd *pwd = NULL;
@@ -342,27 +339,26 @@ static int new_user (struct pdb_context *in, const char *username, const char *f
Add New Machine
**********************************************************/
-static int new_machine (struct pdb_context *in, const char *machine_in)
+static int new_machine (struct pdb_context *in, char *machinename)
{
SAM_ACCOUNT *sam_pwent=NULL;
- fstring machinename;
char name[16];
+ char *password = NULL;
if (!NT_STATUS_IS_OK(pdb_init_sam (&sam_pwent))) {
return -1;
}
- fstrcpy(machinename, machine_in);
-
if (machinename[strlen (machinename) -1] == '$')
machinename[strlen (machinename) -1] = '\0';
- strlower_m(machinename);
-
safe_strcpy (name, machinename, 16);
safe_strcat (name, "$", 16);
-
- pdb_set_plaintext_passwd (sam_pwent, machinename);
+
+ string_set (&password, machinename);
+ strlower_m(password);
+
+ pdb_set_plaintext_passwd (sam_pwent, password);
pdb_set_username (sam_pwent, name, PDB_CHANGED);
@@ -385,7 +381,7 @@ static int new_machine (struct pdb_context *in, const char *machine_in)
Delete user entry
**********************************************************/
-static int delete_user_entry (struct pdb_context *in, const char *username)
+static int delete_user_entry (struct pdb_context *in, char *username)
{
SAM_ACCOUNT *samaccount = NULL;
@@ -405,7 +401,7 @@ static int delete_user_entry (struct pdb_context *in, const char *username)
Delete machine entry
**********************************************************/
-static int delete_machine_entry (struct pdb_context *in, const char *machinename)
+static int delete_machine_entry (struct pdb_context *in, char *machinename)
{
char name[16];
SAM_ACCOUNT *samaccount = NULL;
@@ -442,7 +438,7 @@ int main (int argc, char **argv)
uint32 setparms, checkparms;
int opt;
static char *full_name = NULL;
- static const char *user_name = NULL;
+ static char *user_name = NULL;
static char *home_dir = NULL;
static char *home_drive = NULL;
static char *backend = NULL;
@@ -506,9 +502,6 @@ int main (int argc, char **argv)
exit(1);
}
- if(lp_modules())
- smb_load_modules(lp_modules());
-
if (!init_names())
exit(1);