mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Prevent the GUI from adding a user that already exists in /etc/passwd (root, operator, daemon, etc)
This commit is contained in:
parent
2708e3997d
commit
8339ab6d69
@ -215,6 +215,14 @@ if (isAllowedPage("system_usermanager")) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
$system_users = explode("\n", file_get_contents("/etc/passwd"));
|
||||
foreach ($system_users as $s_user) {
|
||||
$ent = explode(":", $s_user);
|
||||
if ($ent[0] == $_POST['usernamefld']) {
|
||||
$input_errors[] = gettext("That username already exists or is reserved by the system.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user