From 7b7651b5f89b167a9d54caae0e397d82b37345f6 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Tue, 15 Nov 2016 22:50:22 +0000 Subject: [PATCH] fix startop -multiple git-svn-id: file:///root/webif/svn/pkg/webif/trunk@3343 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- webif/cgi-bin/status.jim | 2 +- webif/lib/system.class | 11 +++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index b8c6bed..7e51325 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.3.2-15 +Version: 1.3.2-16 Architecture: mipsel Maintainer: af123@hpkg.tv Depends: tcpfix,webif-channelicons(>=1.1.24),lighttpd(>=1.4.39-1),jim(>=0.76-2),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.3),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.9),webif-charts(>=1.2-1),stripts(>=1.2.5-3),tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.95) diff --git a/webif/cgi-bin/status.jim b/webif/cgi-bin/status.jim index 790587e..6d941a2 100755 --- a/webif/cgi-bin/status.jim +++ b/webif/cgi-bin/status.jim @@ -145,7 +145,7 @@ foreach opfile [glob -nocomplain -directory /tmp -tails -- ".bgop.*"] { # Check that the lock is still held if {![system checkop $op]} { - debug "$op/$file/$oppid - process not found." + debug "$op - $file - $oppid - process not found." file delete "/tmp/$opfile" } else { set ops($file) $op diff --git a/webif/lib/system.class b/webif/lib/system.class index 8c07474..6eb4c08 100644 --- a/webif/lib/system.class +++ b/webif/lib/system.class @@ -743,10 +743,11 @@ proc {system has} {comp} { return 0 } -set ::system::ops {} - +# Note that {system checkop} can be called from processes other than that +# which started the operation. Hence no visilibty into the ::system::ops +# dictionary. proc {system checkop} {op} { - if {![regexp -nocase -- {^[a-z0-9]+$} $op]} { return 0 } + if {![regexp -nocase -- {^[.a-z0-9]+$} $op]} { return 0 } if {[catch {set fp [open "/tmp/.bgop.$op" "a"]}]} { return 0 } @@ -759,6 +760,8 @@ proc {system checkop} {op} { return $ret } +set ::system::ops {} + proc {system startop} {args op file} { if {![regexp -nocase -- {^[a-z0-9]+$} $op]} { return 0 } if {"-multiple" in $args} { @@ -784,7 +787,7 @@ proc {system startop} {args op file} { } proc {system endop} {op} { - if {![regexp -nocase -- {^[a-z0-9]+$} $op]} { return 0 } + if {![regexp -nocase -- {^[.a-z0-9]+$} $op]} { return 0 } if {[dict exists $::system::ops $op]} { catch { set fp $::system::ops($op)