Fix Context-Type. Simplify CGI script to reduce potential security vulnerabilities and handle different locales. Remove unused template files from debian/* Index: debian/control =================================================================== --- debian/control (Revision 21852) +++ debian/control (Arbeitskopie) @@ -6,7 +6,7 @@ Package: univention-showload Architecture: all -Depends: bc, httpd +Depends: httpd Description: UCS - load balancing server This package contain the UCS load balancing server. . Index: debian/preinst =================================================================== --- debian/preinst (Revision 21852) +++ debian/preinst (Arbeitskopie) @@ -1,73 +0,0 @@ -#! /bin/sh -# -# Univention Showload -# preinst script -# -# Copyright 2004-2010 Univention GmbH -# -# http://www.univention.de/ -# -# All rights reserved. -# -# The source code of this program is made available -# under the terms of the GNU Affero General Public License version 3 -# (GNU AGPL V3) as published by the Free Software Foundation. -# -# Binary versions of this program provided by Univention to you as -# well as other copyrighted, protected or trademarked materials like -# Logos, graphics, fonts, specific documentations and configurations, -# cryptographic keys etc. are subject to a license agreement between -# you and Univention and not subject to the GNU AGPL V3. -# -# In the case you use this program under the terms of the GNU AGPL V3, -# the program is provided in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public -# License with the Debian GNU/Linux or Univention distribution in file -# /usr/share/common-licenses/AGPL-3; if not, see -# . -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `install' -# * `install' -# * `upgrade' -# * `abort-upgrade' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - install|upgrade) -# if [ "$1" = "upgrade" ] -# then -# start-stop-daemon --stop --quiet --oknodo \ -# --pidfile /var/run/univention-showload.pid \ -# --exec /usr/sbin/univention-showload 2>/dev/null || true -# fi - ;; - - abort-upgrade) - ;; - - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - Index: debian/changelog =================================================================== --- debian/changelog (Revision 21852) +++ debian/changelog (Arbeitskopie) @@ -1,3 +1,9 @@ +univention-showload (4.0.1-1) unstable; urgency=low + + * Rewrite CGI-script. + + -- Philipp Hahn Thu, 24 Mar 2011 10:58:56 +0100 + univention-showload (4.0.0-2) unstable; urgency=low * added GNU APGL V3 header (Bug #9620) Index: debian/conffiles =================================================================== --- debian/conffiles (Revision 21852) +++ debian/conffiles (Arbeitskopie) @@ -1 +0,0 @@ - Index: debian/docs =================================================================== --- debian/docs (Revision 21852) +++ debian/docs (Arbeitskopie) @@ -1 +0,0 @@ - Index: debian/rules =================================================================== --- debian/rules (Revision 21852) +++ debian/rules (Arbeitskopie) @@ -30,26 +30,10 @@ # /usr/share/common-licenses/AGPL-3; if not, see # . +build: -configure: configure-stamp -configure-stamp: - dh_testdir - - touch configure-stamp - - -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - - touch build-stamp - clean: dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - dh_clean install: build @@ -57,10 +41,8 @@ dh_testroot dh_clean -k dh_installdirs - cp univention-showload.cgi $(CURDIR)/debian/univention-showload/usr/lib/cgi-bin - # Build architecture-independent files here. binary-indep: build install @@ -76,4 +58,4 @@ dh_builddeb binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure +.PHONY: build clean binary-indep binary-arch binary install Index: univention-showload.cgi =================================================================== --- univention-showload.cgi (Revision 21852) +++ univention-showload.cgi (Arbeitskopie) @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Univention Showload # showload cgi script # @@ -29,8 +29,4 @@ # /usr/share/common-licenses/AGPL-3; if not, see # . -loadavg="`echo \`cat /proc/loadavg |awk '{print $3}'\`*100 | bc | cut -f1 -d"."`" - -echo "Content-type: text/html"; echo -echo "LOAD:$loadavg" - +LC_ALL=C exec awk '{printf "Content-Type: text/plain\n\nLOAD:%d\n", $3*100}' /proc/loadavg