summaryrefslogtreecommitdiff
path: root/pinyweb/cgi-bin/auth/pinyconfig.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'pinyweb/cgi-bin/auth/pinyconfig.cgi')
-rwxr-xr-xpinyweb/cgi-bin/auth/pinyconfig.cgi26
1 files changed, 26 insertions, 0 deletions
diff --git a/pinyweb/cgi-bin/auth/pinyconfig.cgi b/pinyweb/cgi-bin/auth/pinyconfig.cgi
new file mode 100755
index 0000000..4fd8e89
--- /dev/null
+++ b/pinyweb/cgi-bin/auth/pinyconfig.cgi
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+$| = 1;
+
+open(STDERR, ">&STDOUT");
+
+use warnings;
+
+use CGI;
+
+use IPC::Open2;
+
+$q = CGI->new;
+
+print( "Content-type: text/plain\n\n");
+
+if( defined( $q->param('r') ) && defined( $q->param('n') ) && defined( $q->param('v') ) ) {
+ unless( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'pinyconfig', $q->param('r'), $q->param('n'), $q->param('v') ) == 0 ) {
+ die( 'pinyconfig was unsuccessful.' );
+ };
+} elsif( defined( $q->param('r') ) ) {
+ unless( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'pinyconfig', $q->param('r') ) == 0 ) {
+ die( 'pinyconfig was unsuccessful.' );
+ };
+} else {
+ print 'Missing parameters.';
+};