From 3e9efc02288fd4cd386f825adf9017d6117e6383 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Thu, 30 Dec 2010 21:27:02 -0800 Subject: Some minor reorg. --- pinyweb/cgi-bin/newrepo.cgi | 29 +++++++++++++++++++++++++++++ pinyweb/cgi-bin/newuser.cgi | 29 +++++++++++++++++++++++++++++ pinyweb/cgi-bin/piny-newuser.cgi | 29 ----------------------------- pinyweb/cgi-bin/piny/newrepo.cgi | 29 ----------------------------- 4 files changed, 58 insertions(+), 58 deletions(-) create mode 100755 pinyweb/cgi-bin/newrepo.cgi create mode 100755 pinyweb/cgi-bin/newuser.cgi delete mode 100644 pinyweb/cgi-bin/piny-newuser.cgi delete mode 100755 pinyweb/cgi-bin/piny/newrepo.cgi (limited to 'pinyweb/cgi-bin') diff --git a/pinyweb/cgi-bin/newrepo.cgi b/pinyweb/cgi-bin/newrepo.cgi new file mode 100755 index 0000000..450fa82 --- /dev/null +++ b/pinyweb/cgi-bin/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.'; +}; diff --git a/pinyweb/cgi-bin/newuser.cgi b/pinyweb/cgi-bin/newuser.cgi new file mode 100755 index 0000000..002d2be --- /dev/null +++ b/pinyweb/cgi-bin/newuser.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('a') && $q->param('p') ) { + unless( open2( OUT, IN, '/usr/bin/sudo', '/usr/sbin/newuser', '--batch', $q->param('a'), $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('p') . "\n" ); + close( IN ); + while( ) { + print; + }; +} else { + print 'Missing parameters.'; +}; diff --git a/pinyweb/cgi-bin/piny-newuser.cgi b/pinyweb/cgi-bin/piny-newuser.cgi deleted file mode 100644 index 002d2be..0000000 --- a/pinyweb/cgi-bin/piny-newuser.cgi +++ /dev/null @@ -1,29 +0,0 @@ -#!/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('a') && $q->param('p') ) { - unless( open2( OUT, IN, '/usr/bin/sudo', '/usr/sbin/newuser', '--batch', $q->param('a'), $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('p') . "\n" ); - close( IN ); - while( ) { - print; - }; -} else { - print 'Missing parameters.'; -}; diff --git a/pinyweb/cgi-bin/piny/newrepo.cgi b/pinyweb/cgi-bin/piny/newrepo.cgi deleted file mode 100755 index 450fa82..0000000 --- a/pinyweb/cgi-bin/piny/newrepo.cgi +++ /dev/null @@ -1,29 +0,0 @@ -#!/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