From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robin Roevens To: development@lists.ipfire.org Subject: Re: [PATCH 2/2] services.cgi: Fix status/actions on services with name != addon name Date: Tue, 04 Oct 2022 12:33:17 +0200 Message-ID: <50e62161be8c54ca80c2cb711be1a2686545b281.camel@sicho.home> In-Reply-To: <4F62A266-DE4B-4E35-BC4B-7F12F9DDD391@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2700735734127927705==" List-Id: --===============2700735734127927705== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Michael Tremer schreef op di 04-10-2022 om 10:51 [+0100]: > Hello, >=20 > I am going to start with the second patch, because that is going to > be shorter :) >=20 > > On 3 Oct 2022, at 16:27, Robin Roevens > > wrote: > >=20 > > * addonctrl's new functionality to control explicit addon services > > was > > =C2=A0implemented. > > * Change 'Addon' column header to 'Addon Service' to be clear that > > =C2=A0it's not addons but services listed here. > > * Services not matching the name of the addon now display the addon > > =C2=A0name between parentheses, so the user knows where the service > > comes > > =C2=A0from. > > * When no valid runlevel symlink is found by addonctrl for a > > service, > > =C2=A0the 'enable on boot' checkbox is replaced by a small exclamation > > point > > =C2=A0with alt-text "No valid runlevel symlink was found for the > > initscript of > > =C2=A0this service." to inform user why a service can't be enabled. > > * Added German and Dutch translation for above message. > >=20 > > Fixes: Bug#12935 > > Signed-off-by: Robin Roevens > > --- > > html/cgi-bin/services.cgi | 103 +++++++++++++++-------------------- > > --- > > langs/de/cgi-bin/de.pl=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0 1 + > > langs/en/cgi-bin/en.pl=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0 1 + > > langs/nl/cgi-bin/nl.pl=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0 1 + > > 4 files changed, 42 insertions(+), 64 deletions(-) > >=20 > > diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi > > index 29926ecc3..e91da884b 100644 > > --- a/html/cgi-bin/services.cgi > > +++ b/html/cgi-bin/services.cgi > > @@ -142,14 +142,14 @@ END > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my $paramstr=3D$ENV{QUERY= _STRING}; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my @param=3Dsplit(/!/, $p= aramstr); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if ($param[1] ne ''){ > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0&General::system("/usr/local/bin/addonctrl", > > "$param[0]", "$param[1]"); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0&General::system("/usr/local/bin/addonctrl", > > "$param[0]", "$param[1]", "$param[2]"); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} >=20 > Although this has been like this before, I am strongly against > passing anything from the request to the setuid binary. >=20 > This will open us up for any shell command injections and so on. I > would prefer to check the second argument to be at least on some kind > of list as there are only a few keywords allowed (start, stop, > restart, =E2=80=A6) and the other parameters should only contain ASCII > letters, numbers and maybe dash and underscore. Nothing else should > be passed through here. Good point. I was thinking this regexp: /[^a-zA-Z_0-9\-\.]/ or should I not include a '.'? I don't think there currently are any addons or initscripts that contain a '.', but it could be in the future?=20 Regards Robin >=20 > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0print < >
> > > > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > > @@ -170,33 +170,35 @@ END > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0foreach my $pak (keys %pa= klist) { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0my %metadata =3D &Pakfire::getmetadata($pak, > > "installed"); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0my $service; > > + > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0if ("$metadata{'Services'}") { > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0foreach my = $service (split(/ /, > > "$metadata{'Services'}")) { > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2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0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0print "= "; > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0$col=3D"bgc= olor=3D'$color{'color20'}'"; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0# Add addon name to displayname of > > service if servicename differs from addon > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my $displayname =3D ($pak ne > > $service) ? "$service ($pak)" : $service; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0print " "; > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my $status =3D > > isautorun($pak,$service,$col); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0print "$status "; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0print ""; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0print " "; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my $status =3D > > isrunningaddon($pak,$service,$col); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A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C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0my $status =3D isautorun($_,$col); > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0print "$status "; > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0print ""; > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0print " "; > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0my $status =3D isrunningaddon($_,$col); > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0$status =3D~ s/\=1B\[[0-1]\;[0-9]+m//g; > > - > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0chomp($status); > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0print "$status"; > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0print ""; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0print "
Addon<= /b>Addon $L= ang::tr{service}B= oot > colspan=3D2>$Lang::tr{'action'}$= Lang::tr{'status'}
> width=3D'31%'>$displayname > width=3D'8%'> > alt=3D'$Lang::tr{'start'}' title=3D'$Lang::tr{'start'}' > > src=3D'/images/go-up.png' border=3D'0' /> > width=3D'8%'> > alt=3D'$Lang::tr{'stop'}' title=3D'$Lang::tr{'stop'}' src=3D'/images/go- > > down.png' border=3D'0' />
$_ > href=3D'services.cgi?$_!start'>3D'$Lang::tr{'start'}' > title=3D'$Lang::tr{'start'}' src=3D'/images/go-up.png' border=3D'0' > > /> > href=3D'services.cgi?$_!stop'>3D'$Lang::tr{'stop'}' > title=3D'$Lang::tr{'stop'}' src=3D'/images/go-down.png' border=3D'0' > > />
\n"; > > @@ -215,51 +217,24 @@ END > > } > >=20 > > sub isautorun (@) { > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my ($cmd, $col) =3D @_; > > - > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0# Init directory. > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my $initdir =3D "/etc/rc.d/rc3= .d/"; > > - > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my $status =3D ""; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my ($pak, $service, $col) =3D = @_; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my @testcmd =3D > > &General::system_output("/usr/local/bin/addonctrl", "$pak", "boot- > > status", "$service"); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my $testcmd =3D @testcmd[0]; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my $status =3D " > alt=3D'$Lang::tr{'service boot setting unavailable'}' > > title=3D'$Lang::tr{'service boot setting unavailable'}' > > src=3D'/images/dialog-warning.png' border=3D'0' width=3D'16' height=3D'16' > > />"; > >=20 > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0# Check if autorun for the giv= en cmd is enabled. > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if ( &find_init("$cmd", "$init= dir") ) { > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0# Check if autorun for the giv= en service is enabled. > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if ( $testcmd =3D~ /enabled\ o= n\ boot/ ) { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0# Adjust status. > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0$status =3D " > href=3D'services.cgi?$_!disable'>3D'$Lang::tr{'deactivate'}' > title=3D'$Lang::tr{'deactivate'}' src=3D'/images/on.gif' border=3D'0' > > width=3D'16' height=3D'16' />"; > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} else { > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0$status =3D " > href=3D'services.cgi?$pak!disable!$service'> > alt=3D'$Lang::tr{'deactivate'}' title=3D'$Lang::tr{'deactivate'}' > > src=3D'/images/on.gif' border=3D'0' width=3D'16' height=3D'16' > > />"; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} elsif ( $testcmd =3D~ /disab= led\ on\ boot/ ) { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0# Adjust status. > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0$status =3D " > href=3D'services.cgi?$_!enable'>3D'$Lang::tr{'activate'}' > title=3D'$Lang::tr{'activate'}' src=3D'/images/off.gif' border=3D'0' > > width=3D'16' height=3D'16' />"; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0$status =3D " > href=3D'services.cgi?$pak!enable!$service'> > alt=3D'$Lang::tr{'activate'}' title=3D'$Lang::tr{'activate'}' > > src=3D'/images/off.gif' border=3D'0' width=3D'16' height=3D'16' > > />"; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0# Return the status. > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return $status; > > } > >=20 > > -sub find_init (@) { > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my ($cmd, $dir) =3D @_; > > - > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0# Open given init directory. > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0opendir (INITDIR, "$dir") || d= ie "Cannot opendir $dir: $!"; > > - > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0# Read-in init files from dire= ctory. > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my @inits =3D readdir(INITDIR); > > - > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0# Close directory handle. > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0closedir(INITDIR); > > - > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0# Loop through the directory. > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0foreach my $init (@inits) { > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0# Check if the current processed file belongs to > > the given command. > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0if ($init =3D~ /S\d+\d+$cmd\z/) { > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0# Found, re= turn "1" - True. > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return "1"; > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0} > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > > - > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0# Nothing found, return nothin= g. > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return; > > -} > > - > > sub isrunning (@) { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my ($cmd, $col) =3D @_; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my $status =3D " > bgcolor=3D'${Header::colourred}'> > color=3D'white'>$Lang::tr{'stopped'} > colspan=3D'2' $col>"; > > @@ -313,7 +288,7 @@ sub isrunning (@) { > > } > >=20 > > sub isrunningaddon (@) { > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my ($cmd, $col) =3D @_; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my ($pak, $service, $col) =3D = @_; > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my $status =3D " > bgcolor=3D'${Header::colourred}'> > color=3D'white'>$Lang::tr{'stopped'} > colspan=3D'2' $col>"; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my $pid =3D ''; > > @@ -321,7 +296,7 @@ sub isrunningaddon (@) { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my $exename; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my @memory; > >=20 > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my @testcmd =3D > > &General::system_output("/usr/local/bin/addonctrl", "$cmd", > > "status"); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my @testcmd =3D > > &General::system_output("/usr/local/bin/addonctrl", "$pak", > > "status", "$service"); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0my $testcmd =3D @testcmd[= 0]; > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if ( $testcmd =3D~ /is\ r= unning/ && $testcmd !~ /is\ not\ > > running/){ > > diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl > > index 798abcffc..db7d117b0 100644 > > --- a/langs/de/cgi-bin/de.pl > > +++ b/langs/de/cgi-bin/de.pl > > @@ -2251,6 +2251,7 @@ > > 'server string' =3D> 'Server String', > > 'service' =3D> 'Dienst', > > 'service added' =3D> 'Benutzerdefinierter Netzwerkdienst wurde > > hinzugef=C3=BCgt', > > +'service boot setting unavailable' =3D> 'F=C3=BCr das Initscript dieses > > Dienstes wurde kein g=C3=BCltiger Runlevel-Symlink gefunden.', > > 'service name' =3D> 'Name des Dienstes:', > > 'service removed' =3D> 'Benutzerdefinierter Netzwerkdienst wurde > > entfernt', > > 'service updated' =3D> 'Benutzerdefinierter Netzwerkdienst wurde > > aktualisiert', > > diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl > > index f770e7cd9..60dca5be4 100644 > > --- a/langs/en/cgi-bin/en.pl > > +++ b/langs/en/cgi-bin/en.pl > > @@ -2306,6 +2306,7 @@ > > 'server string' =3D> 'Server String', > > 'service' =3D> 'Service', > > 'service added' =3D> 'Custom network service added', > > +'service boot setting unavailable' =3D> 'No valid runlevel symlink > > was found for the initscript of this service.', > > 'service name' =3D> 'Service name:', > > 'service removed' =3D> 'Custom network service removed', > > 'service updated' =3D> 'Custom network service updated', > > diff --git a/langs/nl/cgi-bin/nl.pl b/langs/nl/cgi-bin/nl.pl > > index 49dabec99..4fd6955cc 100644 > > --- a/langs/nl/cgi-bin/nl.pl > > +++ b/langs/nl/cgi-bin/nl.pl > > @@ -1899,6 +1899,7 @@ > > 'server string' =3D> 'Server String', > > 'service' =3D> 'Dienst', > > 'service added' =3D> 'Aangepaste netwerkdienst toegevoegd', > > +'service boot setting unavailable' =3D> 'Er werd voor het initscript > > van deze service geen geldige runlevel symlink gevonden.', > > 'service name' =3D> 'Dienstennaam:', > > 'service removed' =3D> 'Aangepaste netwerkdienst verwijderd', > > 'service updated' =3D> 'Aangepaste netwerkdienst bijgewerkt', > > --=20 > > 2.37.3 > >=20 > >=20 > > --=20 > > Dit bericht is gescanned op virussen en andere gevaarlijke > > inhoud door MailScanner en lijkt schoon te zijn. > >=20 >=20 >=20 --=20 Dit bericht is gescanned op virussen en andere gevaarlijke inhoud door MailScanner en lijkt schoon te zijn. --===============2700735734127927705==--