summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/pdbedit.c36
-rw-r--r--source3/utils/smbpasswd.c8
2 files changed, 22 insertions, 22 deletions
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index d0629fa258..ce5195a810 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -128,12 +128,12 @@ static int print_user_info (char *username, BOOL verbosity, BOOL smbpwdstyle)
if (ret==False) {
fprintf (stderr, "Username not found!\n");
- pdb_free_sam(sam_pwent);
+ pdb_free_sam(&sam_pwent);
return -1;
}
ret=print_sam_info (sam_pwent, verbosity, smbpwdstyle);
- pdb_free_sam(sam_pwent);
+ pdb_free_sam(&sam_pwent);
return ret;
}
@@ -151,7 +151,7 @@ static int print_users_list (BOOL verbosity, BOOL smbpwdstyle)
ret = pdb_setsampwent(False);
if (ret && errno == ENOENT) {
fprintf (stderr,"Password database not found!\n");
- pdb_free_sam(sam_pwent);
+ pdb_free_sam(&sam_pwent);
exit(1);
}
@@ -163,7 +163,7 @@ static int print_users_list (BOOL verbosity, BOOL smbpwdstyle)
}
pdb_endsampwent ();
- pdb_free_sam(sam_pwent);
+ pdb_free_sam(&sam_pwent);
return 0;
}
@@ -181,7 +181,7 @@ static int set_user_info (char *username, char *fullname, char *homedir, char *d
ret = pdb_getsampwnam (sam_pwent, username);
if (ret==False) {
fprintf (stderr, "Username not found!\n");
- pdb_free_sam(sam_pwent);
+ pdb_free_sam(&sam_pwent);
return -1;
}
@@ -200,10 +200,10 @@ static int set_user_info (char *username, char *fullname, char *homedir, char *d
print_user_info (username, True, False);
else {
fprintf (stderr, "Unable to modify entry!\n");
- pdb_free_sam(sam_pwent);
+ pdb_free_sam(&sam_pwent);
return -1;
}
- pdb_free_sam(sam_pwent);
+ pdb_free_sam(&sam_pwent);
return 0;
}
@@ -222,7 +222,7 @@ static int new_user (char *username, char *fullname, char *homedir, char *drive,
if (!(pwd = sys_getpwnam(username))) {
fprintf (stderr, "User %s does not exist in system passwd!\n", username);
- pdb_free_sam (sam_pwent);
+ pdb_free_sam (&sam_pwent);
return -1;
}
@@ -230,7 +230,7 @@ static int new_user (char *username, char *fullname, char *homedir, char *drive,
password2 = getpass("retype new password:");
if (strcmp (password1, password2)) {
fprintf (stderr, "Passwords does not match!\n");
- pdb_free_sam (sam_pwent);
+ pdb_free_sam (&sam_pwent);
return -1;
}
@@ -260,10 +260,10 @@ static int new_user (char *username, char *fullname, char *homedir, char *drive,
print_user_info (username, True, False);
} else {
fprintf (stderr, "Unable to add user! (does it alredy exist?)\n");
- pdb_free_sam (sam_pwent);
+ pdb_free_sam (&sam_pwent);
return -1;
}
- pdb_free_sam (sam_pwent);
+ pdb_free_sam (&sam_pwent);
return 0;
}
@@ -297,7 +297,7 @@ static int new_machine (char *machinename)
for (uid=BASE_MACHINE_UID; uid<=MAX_MACHINE_UID; uid++) {
pdb_init_sam (&sam_trust);
if (pdb_getsampwuid (sam_trust, uid)) {
- pdb_free_sam (sam_trust);
+ pdb_free_sam (&sam_trust);
} else {
break;
}
@@ -305,7 +305,7 @@ static int new_machine (char *machinename)
if (uid>MAX_MACHINE_UID) {
fprintf (stderr, "No more free UIDs available to Machine accounts!\n");
- pdb_free_sam(sam_pwent);
+ pdb_free_sam(&sam_pwent);
return -1;
}
@@ -319,10 +319,10 @@ static int new_machine (char *machinename)
print_user_info (name, True, False);
} else {
fprintf (stderr, "Unable to add machine! (does it already exist?)\n");
- pdb_free_sam (sam_pwent);
+ pdb_free_sam (&sam_pwent);
return -1;
}
- pdb_free_sam (sam_pwent);
+ pdb_free_sam (&sam_pwent);
return 0;
}
@@ -383,7 +383,7 @@ static int import_users (char *filename)
fgets(linebuf, 256, fp);
if (ferror(fp)) {
fprintf (stderr, "%s\n", strerror (ferror (fp)));
- pdb_free_sam(sam_pwent);
+ pdb_free_sam(&sam_pwent);
return -1;
}
if ((linebuf_len = strlen(linebuf)) == 0) {
@@ -401,7 +401,7 @@ static int import_users (char *filename)
linebuf[linebuf_len] = '\0';
if ((linebuf[0] == 0) && feof(fp)) {
/*end of file!!*/
- pdb_free_sam(sam_pwent);
+ pdb_free_sam(&sam_pwent);
return 0;
}
line++;
@@ -558,7 +558,7 @@ static int import_users (char *filename)
pdb_reset_sam (sam_pwent);
}
printf ("%d lines read.\n%d entryes imported\n", line, good);
- pdb_free_sam(sam_pwent);
+ pdb_free_sam(&sam_pwent);
return 0;
}
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index 14b10c1700..168547c712 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -524,7 +524,7 @@ static BOOL password_change(const char *remote_machine, char *user_name,
return False;
}
ret = remote_password_change(remote_machine, user_name,
- old_passwd, new_passwd, err_str, sizeof(err_str));
+ old_passwd, new_passwd, err_str, sizeof(err_str));
if(*err_str)
fprintf(stderr, err_str);
return ret;
@@ -707,7 +707,7 @@ static int process_root(int argc, char *argv[])
usage();
}
- if (!user_name[0] && (pwd = sys_getpwuid(0))) {
+ if (!user_name[0] && (pwd = sys_getpwuid(geteuid()))) {
fstrcpy(user_name, pwd->pw_name);
}
@@ -768,7 +768,7 @@ static int process_root(int argc, char *argv[])
if((sampass != False) && (pdb_get_lanman_passwd(sampass) != NULL)) {
new_passwd = xstrdup("XXXX"); /* Don't care. */
}
- pdb_free_sam(sampass);
+ pdb_free_sam(&sampass);
}
if(!new_passwd)
@@ -799,7 +799,7 @@ static int process_root(int argc, char *argv[])
if((ret != False) && (pdb_get_acct_ctrl(sampass) & ACB_PWNOTREQ) )
printf(" User has no password flag set.");
printf("\n");
- pdb_free_sam(sampass);
+ pdb_free_sam(&sampass);
}
done: