From 56fa7965d82f66e5e4608d53e6781e8441ad16b9 Mon Sep 17 00:00:00 2001 From: "jrayhawk+piny.be@omgwallhack.org" Date: Sun, 9 Jan 2011 21:09:14 -0800 Subject: Move cgi-bin resources into cgi-bin/piny/ and cgi-bin/piny/auth --- pinyweb/cgi-bin/auth/newrepo.cgi | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 pinyweb/cgi-bin/auth/newrepo.cgi (limited to 'pinyweb/cgi-bin/auth/newrepo.cgi') diff --git a/pinyweb/cgi-bin/auth/newrepo.cgi b/pinyweb/cgi-bin/auth/newrepo.cgi new file mode 100755 index 0000000..450fa82 --- /dev/null +++ b/pinyweb/cgi-bin/auth/newrepo.cgi @@ -0,0 +1,29 @@ +#!/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', $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.'; +}; -- cgit v1.2.3