From d702bce20b740b53d4743f777ab75f135267819d Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Mon, 24 May 2021 19:38:21 +0200 Subject: [PATCH] pakfire.cgi: Check for locked pakfire before trying to perform operations. Fixes #12621. Signed-off-by: Stefan Schantl Signed-off-by: Michael Tremer --- html/cgi-bin/pakfire.cgi | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index a9e12d23c1..faaeb4222c 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -54,7 +54,7 @@ sub refreshpage{&Header::openbox( 'Waiting', 1, "/dev/null &"); system("/bin/sleep 1"); -} elsif ($cgiparams{'ACTION'} eq 'upgrade') { +} elsif (($cgiparams{'ACTION'} eq 'upgrade') && (!-e $Pakfire::lockfile)) { my $command = "/usr/local/bin/pakfire upgrade -y --no-colors &>/dev/null &"; system("$command"); system("/bin/sleep 1"); @@ -176,9 +176,7 @@ if ($errormessage) { &Header::closebox(); } -my $return = `pidof pakfire`; -chomp($return); -if ($return) { +if (-e $Pakfire::lockfile) { &Header::openbox( 'Waiting', 1, "" ); print < -- 2.39.5