summaryrefslogtreecommitdiff
path: root/pinyweb/cgi-bin/auth/pinyconfig.cgi
diff options
context:
space:
mode:
authorJulian Blake Kongslie <jblake@omgwallhack.org>2011-05-13 15:15:29 -0700
committerJulian Blake Kongslie <jblake@omgwallhack.org>2011-05-13 15:15:29 -0700
commitd9df093f1837f971090def69fb20e5677cb364da (patch)
tree115b6df9f9a03a79cfdd855003b3b7c0b0447e79 /pinyweb/cgi-bin/auth/pinyconfig.cgi
parentc4fb9497982e2f51c1afefd43f94be8c6cc74edc (diff)
parent9a8be1d87c03fbcdbc7b62e1369cdfe3f5aba193 (diff)
downloadpiny-code-d9df093f1837f971090def69fb20e5677cb364da.tar.gz
piny-code-d9df093f1837f971090def69fb20e5677cb364da.zip
Merge branch 'master' of ssh://piny/srv/git/piny-code
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.';
+};