Skip to content

Commit

Permalink
Fix preg_match regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazamazine committed Nov 4, 2021
1 parent 73f5332 commit dd0e4a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/usr/share/alternc/panel/class/m_nss.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function local_user_exists($login)
global $msg;
// Check username in /etc/passwd
if($sys_passwd_file = file_get_contents("/etc/passwd")) {
preg_match_all("/$login/", $sys_passwd_file, $out);
preg_match_all("/^$login:/m", $sys_passwd_file, $out);
$res_array = $out[0];
if(!empty($res_array)) {
$msg->raise("ERROR", "nss", "A user $login exists on the system");
Expand Down

0 comments on commit dd0e4a7

Please sign in to comment.