From 2b8ae0c0c8ac84f7828e7df44b70b7a7f68087db Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 17 Aug 2001 23:23:21 +0000 Subject: restrict the progs callable to a few one. --- perl-install/standalone/interactive_http/Makefile | 8 ++++++-- perl-install/standalone/interactive_http/interactive_http.cgi | 3 +++ perl-install/standalone/interactive_http/miniserv.init | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/interactive_http/Makefile b/perl-install/standalone/interactive_http/Makefile index ca6a1bc37..d790226e5 100644 --- a/perl-install/standalone/interactive_http/Makefile +++ b/perl-install/standalone/interactive_http/Makefile @@ -3,11 +3,15 @@ FNAME=$(NAME)/drakxtools_http PREFIX= DATADIR=$(PREFIX)/usr/share -all: +all: index.html + +index.html: index.html.pl + perl $^ > $@ install: install -D miniserv.init $(PREFIX)/etc/init.d/drakxtools_http - install -D -m 644 miniserv.conf $(PREFIX)/etc/drakxtools_http.conf + install -D -m 644 authorised_progs $(PREFIX)/etc/drakxtools_http/authorised_progs + install -D -m 644 miniserv.conf $(PREFIX)/etc/drakxtools_http/conf install -D -m 644 miniserv.pam $(PREFIX)/etc/pam.d/miniserv install -D -m 644 miniserv.logrotate $(PREFIX)/etc/logrotate.d/drakxtools_http diff --git a/perl-install/standalone/interactive_http/interactive_http.cgi b/perl-install/standalone/interactive_http/interactive_http.cgi index cb184300a..48dd06fb8 100755 --- a/perl-install/standalone/interactive_http/interactive_http.cgi +++ b/perl-install/standalone/interactive_http/interactive_http.cgi @@ -62,6 +62,9 @@ sub force_exit_dead_prog { sub spawn_server { my ($prog) = @_; + my @authorised_progs = map { chomp($_) } cat_('/etc/drakxtools_http/authorised_progs'); + member($prog, @authorised_progs) or error("You tried to call a non-authorised program"); + fork and return; $ENV{INTERACTIVE_HTTP} = $script_name; diff --git a/perl-install/standalone/interactive_http/miniserv.init b/perl-install/standalone/interactive_http/miniserv.init index 39c724dc7..e7673083c 100644 --- a/perl-install/standalone/interactive_http/miniserv.init +++ b/perl-install/standalone/interactive_http/miniserv.init @@ -8,7 +8,7 @@ server=/usr/share/libDrakX/$name/miniserv.pl case "$1" in 'start') echo -n "Starting $name: " - perl $server /etc/$name.conf + perl $server /etc/$name/conf touch /var/lock/subsys/drakxtools_http echo $name ;; -- cgit v1.2.1