summaryrefslogtreecommitdiff
path: root/pinyweb/cgi-bin/piny/newrepo.cgi
diff options
context:
space:
mode:
authorJulian Blake Kongslie <jblake@omgwallhack.org>2011-01-09 16:16:52 -0800
committerJulian Blake Kongslie <jblake@omgwallhack.org>2011-01-09 16:16:52 -0800
commite1ffec68d09d9fce74e9c05d159edca5222cdeab (patch)
tree72c14bb53e15b77fc8f4c1e7047b54caa945d050 /pinyweb/cgi-bin/piny/newrepo.cgi
parent37027f54f3583e167dfca4b304cdc0f392465fd2 (diff)
parent0603e84c9af78b5e6d76db66d45934819e9f6d3b (diff)
downloadpiny-code-e1ffec68d09d9fce74e9c05d159edca5222cdeab.tar.gz
piny-code-e1ffec68d09d9fce74e9c05d159edca5222cdeab.zip
Merge branch 'master' of ssh://piny/srv/git/piny-code
Diffstat (limited to 'pinyweb/cgi-bin/piny/newrepo.cgi')
-rwxr-xr-xpinyweb/cgi-bin/piny/newrepo.cgi29
1 files changed, 29 insertions, 0 deletions
diff --git a/pinyweb/cgi-bin/piny/newrepo.cgi b/pinyweb/cgi-bin/piny/newrepo.cgi
new file mode 100755
index 0000000..450fa82
--- /dev/null
+++ b/pinyweb/cgi-bin/piny/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( <OUT> ) {
+ print;
+ };
+} else {
+ print 'Missing parameters.';
+};