From eca4eeb42e0959986f9ec9c9163826343cb607f5 Mon Sep 17 00:00:00 2001 From: gashapwn Date: Sat, 28 Nov 2020 20:55:28 +0000 Subject: [PATCH] provision.pl adjusted /etc/passwd regex to exclude newlines --- perl-script/provision.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-script/provision.pl b/perl-script/provision.pl index aa187b6..6db75e2 100644 --- a/perl-script/provision.pl +++ b/perl-script/provision.pl @@ -26,7 +26,7 @@ if($pwuid ne "root"){ # Check /etc/passwd for the username created during # installation -if( ($admin_un) = `tail /etc/passwd | grep -v "nobody:"` =~ /([^:]+):[^:]+:[0-9]{4,}/){ +if( ($admin_un) = `tail /etc/passwd | grep -v "nobody:"` =~ /([^:\n]+):[^:]+:[0-9]{4,}/){ printf("admin user will be set to %s\n", $admin_un); }else{ die "create a non-root user & set user passsword before running this script."