From: WWW daemon apache Date: Thu, 22 Aug 2013 14:32:21 +0000 (+0200) Subject: changed pathes for compatibility with Apache and Httpi X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=d8f806432f76106a54eeedf70a8ba04f564e1f08;p=daqtools.git changed pathes for compatibility with Apache and Httpi --- diff --git a/web/htdocs/tools/pwr/build_index.pl b/web/htdocs/tools/pwr/build_index.pl index 76327bb..e0a10db 100755 --- a/web/htdocs/tools/pwr/build_index.pl +++ b/web/htdocs/tools/pwr/build_index.pl @@ -1,11 +1,17 @@ #!/usr/bin/perl -w use Cwd; -#print "Content-type: text/html\n\n"; +print "Content-type: text/html\n\n"; my $pwd = &Cwd::cwd(); +my $file = "pwr.conf"; +if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { + $file = "htdocs/tools/pwr/".$file; + } -open(LESEN,"htdocs/tools/pwr/pwr.conf") + + +open(LESEN,$file) or die "Fehler beim oeffnen von : $!\n"; while(defined(my $i = )) { diff --git a/web/htdocs/tools/pwr/pwr.conf b/web/htdocs/tools/pwr/pwr.conf index 504f78f..0e8e681 100644 --- a/web/htdocs/tools/pwr/pwr.conf +++ b/web/htdocs/tools/pwr/pwr.conf @@ -1,6 +1,3 @@ //PWRSPLY:/path/to/device:speed:Name:Type:Channels //type can be HMP, PSP, PST -PWRSPLY:/dev/ttyUSB0:38400:HMP4030:HMP:3 -PWRSPLY:/dev/ttyUSB1:2400:PSP-405:PSP:1 -#PWRSPLY:/dev/ttyUSB0:9600:PST3202:PST:3 - +PWRSPLY:/dev/ttyUSB0:115200:HMP4030:HMP:3 diff --git a/web/htdocs/tools/pwr/pwr.pl b/web/htdocs/tools/pwr/pwr.pl index bf13e3e..ac0f4eb 100755 --- a/web/htdocs/tools/pwr/pwr.pl +++ b/web/htdocs/tools/pwr/pwr.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -#print "Content-type: text/html\n\n"; +print "Content-type: text/html\n\n"; use strict; @@ -177,7 +177,7 @@ sub receive_answer_HMP { } } else { - usleep(50000); + usleep(40000); } } return $ret; diff --git a/web/htdocs/tools/pwr/read_conf.pl b/web/htdocs/tools/pwr/read_conf.pl index 4293854..3b9f5a0 100755 --- a/web/htdocs/tools/pwr/read_conf.pl +++ b/web/htdocs/tools/pwr/read_conf.pl @@ -1,12 +1,17 @@ #!/usr/bin/perl -w -#print "Content-type: text/html\r\n\r\n"; +print "Content-type: text/html\r\n\r\n"; use Cwd; my $pwd = &Cwd::cwd(); +my $file = "pwr.conf"; +if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { + $file = "htdocs/tools/pwr/".$file; + } -open(LESEN,"htdocs/tools/pwr/pwr.conf") + +open(LESEN,$file) or print "Fehler beim oeffnen von : $!\n"; while(defined(my $i = )) { diff --git a/web/htdocs/tools/pwr/save_conf.pl b/web/htdocs/tools/pwr/save_conf.pl index 51d324c..3834987 100755 --- a/web/htdocs/tools/pwr/save_conf.pl +++ b/web/htdocs/tools/pwr/save_conf.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -w - +print "Content-type: text/html\r\n\r\n"; my $envstring = $ENV{'QUERY_STRING'}; $envstring =~ s/%20/ /g; @@ -7,7 +7,13 @@ $envstring =~ s/&/\n/g; ##$envstring =~ s/&/\n/g; -open(SCHREIBEN,">htdocs/tools/pwr/pwr.conf") +my $file = "pwr.conf"; +if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { + $file = "htdocs/tools/pwr/".$file; + } + + +open(SCHREIBEN,">$file") or print "Fehler beim oeffnen von : $!\n"; print SCHREIBEN $envstring; diff --git a/web/httpi b/web/httpi index 6c52d69..1a26aeb 100755 --- a/web/httpi +++ b/web/httpi @@ -431,7 +431,7 @@ exit; sub nsecmodel { &log; ($x,$x,$x,$x,$uid,$gid) = stat(S); - (!$uid || !$gid || $uid < 1000) && + (!$uid || !$gid || $uid < 10) && die "resource is root-owned, secured or not stat-able\n"; if (!$<) { ($) = "$gid $gid") || die "can't set egid to $gid";