aboutsummaryrefslogtreecommitdiffstats
path: root/lv
Commit message (Expand)AuthorAgeFilesLines
* added redirections in many languages for en/about/constitutionFilip Komar2012-07-221-0/+1
* added redirections in many languages for timeline, calendar, thank-you and do...Filip Komar2012-07-225-0/+5
* remove obsolete faqRomain d'Alverny2012-05-241-68/+0
* symlinks for /mapRomain d'Alverny2012-05-221-0/+1
* add symlinksRomain d'Alverny2012-05-222-0/+2
* new community section/pagesRomain d'Alverny2012-05-111-0/+1
* symlinks to 2Romain d'Alverny2011-11-251-0/+1
* fixing wiki linksOliver Burger2011-11-151-1/+1
* symlinks to aboutRomain d'Alverny2011-06-231-0/+1
* remove/replaceRomain d'Alverny2011-06-011-0/+1
* remove/replaceRomain d'Alverny2011-06-011-250/+0
* add the twitter 'follow us' buttonDamien Lallement2011-06-011-2/+4
* support symlinksRomain d'Alverny2011-05-311-0/+1
* moving things aroundRomain d'Alverny2011-05-311-0/+1
* symlinks to contribute pageRomain d'Alverny2011-05-231-0/+1
* merged php files in contribute, removed LOCALE/contribute dirs for replacing ...Oliver Burger2011-05-231-19/+0
* cleaned up structure of contribute pagesOliver Burger2011-05-221-135/+2
* added contribute page including internationalisationOliver Burger2011-05-221-0/+152
* show on all pagesRomain d'Alverny2011-04-201-0/+1
* title fixRomain d'Alverny2011-03-301-1/+1
* header changeRomain d'Alverny2011-03-302-2/+2
* donate links update in faqRomain d'Alverny2011-01-181-1/+1
* new layout for all locales, modulo localization to improve on eachRomain d'Alverny2010-11-301-57/+61
* (no commit message)Romain d'Alverny2010-10-142-11/+114
* first import of mageia www v0Romain d'Alverny2010-10-072-0/+312
pt">= "/tmp/interactive_http_r"; if ($q->param('state') eq 'new') { force_exit_dead_prog(); mkfifo($pipe_r); mkfifo($pipe_w); spawn_server($q->param('prog')); first_step(); } elsif ($q->param('state') eq 'next_step') { next_step(); } else { error("booh..."); } sub read_ { local *F; open F, "<$pipe_r" or error("Failed to connect to the prog"); my $t; print $t while sysread F, $t, 1; } sub write_ { local *F; open F, ">$pipe_w" or die; my $q = CGI->new; $q->save(\*F); } sub first_step { read_() } sub next_step { write_(); read_() } sub force_exit_dead_prog { -p $pipe_w or return; { local *F; sysopen F, $pipe_w, 1 | c::O_NONBLOCK() or return; syswrite F, "force_exit_dead_prog=1\n"; } my $cnt = 10; while (-p $pipe_w) { sleep 1; $cnt-- or error("Dead prog failed to exit"); } } 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; open STDIN, "</dev/zero"; open STDOUT, ">/dev/null"; #tmp/log"; open STDERR, ">&STDOUT"; c::setsid(); exec $prog or die "prog $prog not found\n"; } sub error { my $msg = join '', @_; print $q->header(), $q->start_html(); print $q->h1(_("Error")), @_; print $q->end_html(), "\n"; exit 0; } sub mkfifo { my ($f) = @_; -p $f and return; unlink $f; syscall_('mknod', $f, c::S_IFIFO() | 0600, 0) or die "mkfifo failed"; chmod 0666, $f; }