#!/usr/bin/perl $| = 1; use warnings; use CGI; use IPC::Open2; $q = CGI->new; print( "Content-type: text/plain\n\n"); if( $q->param('n') && $q->param('d') ) { unless( open2( OUT, IN, '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'newrepo', '--batch', $q->param('n') ) ) { print 'could not execute newrepo'; die; }; # make things flushier select( (select(IN), $| = 1)[0] ); select( (select(OUT), $| = 1)[0] ); print( IN $q->param('d') . "\n" ); close( IN ); while( ) { print; }; } else { print 'Missing parameters.'; };