summaryrefslogtreecommitdiff
path: root/pinyweb/cgi-bin/piny-newuser.cgi
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@richardiv.omgwallhack.org>2010-12-30 22:40:24 -0800
committerJoe Rayhawk <jrayhawk@richardiv.omgwallhack.org>2010-12-30 22:40:24 -0800
commit0603e84c9af78b5e6d76db66d45934819e9f6d3b (patch)
tree7e2f8e0389f060121c5a2d80d46e90c4e7181b21 /pinyweb/cgi-bin/piny-newuser.cgi
parent3e9efc02288fd4cd386f825adf9017d6117e6383 (diff)
downloadpiny-code-0603e84c9af78b5e6d76db66d45934819e9f6d3b.tar.gz
piny-code-0603e84c9af78b5e6d76db66d45934819e9f6d3b.zip
Revert "Some minor reorg."
This makes newuser.cgi usable again. This reverts commit 3e9efc02288fd4cd386f825adf9017d6117e6383.
Diffstat (limited to 'pinyweb/cgi-bin/piny-newuser.cgi')
-rw-r--r--pinyweb/cgi-bin/piny-newuser.cgi29
1 files changed, 29 insertions, 0 deletions
diff --git a/pinyweb/cgi-bin/piny-newuser.cgi b/pinyweb/cgi-bin/piny-newuser.cgi
new file mode 100644
index 0000000..002d2be
--- /dev/null
+++ b/pinyweb/cgi-bin/piny-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( <OUT> ) {
+ print;
+ };
+} else {
+ print 'Missing parameters.';
+};