Added more security checks to mbpasswd

This commit is contained in:
Michiel Broek
2005-08-27 12:06:48 +00:00
parent efccc2e9fa
commit b79e9b07bc
9 changed files with 259 additions and 222 deletions

View File

@@ -194,14 +194,13 @@ void Chg_Password()
}
}
Syslog('+', "%s/bin/mbpasswd -n %s ******", getenv("MBSE_ROOT"), exitinfo.Name);
Syslog('+', "%s/bin/mbpasswd %s ******", getenv("MBSE_ROOT"), exitinfo.Name);
sprintf(temp1, "%s/bin/mbpasswd", getenv("MBSE_ROOT"));
memset(args, 0, sizeof(args));
args[0] = temp1;
args[1] = (char *)"-n";
args[2] = exitinfo.Name;
args[3] = temp2;
args[4] = NULL;
args[1] = exitinfo.Name;
args[2] = temp2;
args[3] = NULL;
if (execute(args, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") != 0) {
WriteError("Failed to set new Unix password");

View File

@@ -723,10 +723,9 @@ char *NameCreate(char *Name, char *Comment, char *Password)
sprintf(progname, "%s/bin/mbpasswd", getenv("MBSE_ROOT"));
memset(args, 0, sizeof(args));
args[0] = progname;
args[1] = (char *)"-f";
args[2] = Name;
args[3] = Password;
args[4] = NULL;
args[1] = Name;
args[2] = Password;
args[3] = NULL;
if ((err = execute(args, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null"))) {
WriteError("Failed to set unix password");