From 98f8029ea194326327f69b47cb0b95c0af72564f Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Thu, 12 May 2011 18:09:32 -0700 Subject: Adding pinyconfig.cgi and rebuildrepo.cgi --- pinyweb/cgi-bin/auth/pinyconfig.cgi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 pinyweb/cgi-bin/auth/pinyconfig.cgi (limited to 'pinyweb/cgi-bin/auth/pinyconfig.cgi') diff --git a/pinyweb/cgi-bin/auth/pinyconfig.cgi b/pinyweb/cgi-bin/auth/pinyconfig.cgi new file mode 100755 index 0000000..f852a56 --- /dev/null +++ b/pinyweb/cgi-bin/auth/pinyconfig.cgi @@ -0,0 +1,22 @@ +#!/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( $q->param('r') && $q->param('n') && $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.' ); + }; +} else { + print 'Missing parameters.'; +}; -- cgit v1.2.3 From 7ffed596511dab81353b8af3096e17d104278679 Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Thu, 12 May 2011 21:24:13 -0700 Subject: pinyconfig.cgi: enabling variable listing --- pinyweb/cgi-bin/auth/pinyconfig.cgi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pinyweb/cgi-bin/auth/pinyconfig.cgi') diff --git a/pinyweb/cgi-bin/auth/pinyconfig.cgi b/pinyweb/cgi-bin/auth/pinyconfig.cgi index f852a56..af7cebd 100755 --- a/pinyweb/cgi-bin/auth/pinyconfig.cgi +++ b/pinyweb/cgi-bin/auth/pinyconfig.cgi @@ -17,6 +17,10 @@ if( $q->param('r') && $q->param('n') && $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( $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.'; }; -- cgit v1.2.3 From bde32987fd3b9ccb1c830bb290fa4008b3a8c84c Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Thu, 12 May 2011 21:35:22 -0700 Subject: pinyweb: making '0' an acceptable variable value --- pinyweb/cgi-bin/auth/addaccess.cgi | 2 +- pinyweb/cgi-bin/auth/lsaccess.cgi | 2 +- pinyweb/cgi-bin/auth/newrepo.cgi | 2 +- pinyweb/cgi-bin/auth/pinyconfig.cgi | 4 ++-- pinyweb/cgi-bin/auth/rebuildrepo.cgi | 2 +- pinyweb/cgi-bin/auth/rmaccess.cgi | 2 +- pinyweb/cgi-bin/auth/rmrepo.cgi | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) (limited to 'pinyweb/cgi-bin/auth/pinyconfig.cgi') diff --git a/pinyweb/cgi-bin/auth/addaccess.cgi b/pinyweb/cgi-bin/auth/addaccess.cgi index fca9574..f86c19e 100755 --- a/pinyweb/cgi-bin/auth/addaccess.cgi +++ b/pinyweb/cgi-bin/auth/addaccess.cgi @@ -13,7 +13,7 @@ $q = CGI->new; print( "Content-type: text/plain\n\n"); -if( $q->param('r') && $q->param('n') ) { +if( defined( $q->param('r') ) && defined( $q->param('n') ) ) { unless( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'addaccess', $q->param('r'), $q->param('n') ) == 0 ) { die( 'Addaccess was unsuccessful.' ); }; diff --git a/pinyweb/cgi-bin/auth/lsaccess.cgi b/pinyweb/cgi-bin/auth/lsaccess.cgi index f7c9a06..354ba32 100755 --- a/pinyweb/cgi-bin/auth/lsaccess.cgi +++ b/pinyweb/cgi-bin/auth/lsaccess.cgi @@ -13,7 +13,7 @@ $q = CGI->new; print( "Content-type: text/plain\n\n"); -if( $q->param('r') ) { +if( defined( $q->param('r') ) ) { unless ( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'lsaccess', $q->param('r') ) == 0 ) { die( 'lsaccess was unsuccessful.' ); }; diff --git a/pinyweb/cgi-bin/auth/newrepo.cgi b/pinyweb/cgi-bin/auth/newrepo.cgi index 000be02..aa42732 100755 --- a/pinyweb/cgi-bin/auth/newrepo.cgi +++ b/pinyweb/cgi-bin/auth/newrepo.cgi @@ -13,7 +13,7 @@ $q = CGI->new; print( "Content-type: text/plain\n\n"); -if( $q->param('r') && $q->param('d') ) { +if( defined( $q->param('r') ) && defined( $q->param('d') ) ) { unless( open2( OUT, IN, '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'newrepo', '--batch', $q->param('r') ) ) { die 'could not execute newrepo'; }; diff --git a/pinyweb/cgi-bin/auth/pinyconfig.cgi b/pinyweb/cgi-bin/auth/pinyconfig.cgi index af7cebd..4fd8e89 100755 --- a/pinyweb/cgi-bin/auth/pinyconfig.cgi +++ b/pinyweb/cgi-bin/auth/pinyconfig.cgi @@ -13,11 +13,11 @@ $q = CGI->new; print( "Content-type: text/plain\n\n"); -if( $q->param('r') && $q->param('n') && $q->param('v') ) { +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( $q->param('r') ) { +} elsif( defined( $q->param('r') ) ) { unless( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'pinyconfig', $q->param('r') ) == 0 ) { die( 'pinyconfig was unsuccessful.' ); }; diff --git a/pinyweb/cgi-bin/auth/rebuildrepo.cgi b/pinyweb/cgi-bin/auth/rebuildrepo.cgi index 0d23fbd..912e004 100755 --- a/pinyweb/cgi-bin/auth/rebuildrepo.cgi +++ b/pinyweb/cgi-bin/auth/rebuildrepo.cgi @@ -13,7 +13,7 @@ $q = CGI->new; print( "Content-type: text/plain\n\n"); -if( $q->param('r') ) { +if( defined( $q->param('r') ) ) { unless ( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'rebuildrepo', $q->param('r') ) == 0 ) { die( 'rebuildrepo was unsuccessful.' ); }; diff --git a/pinyweb/cgi-bin/auth/rmaccess.cgi b/pinyweb/cgi-bin/auth/rmaccess.cgi index 5123041..35736ab 100755 --- a/pinyweb/cgi-bin/auth/rmaccess.cgi +++ b/pinyweb/cgi-bin/auth/rmaccess.cgi @@ -13,7 +13,7 @@ $q = CGI->new; print( "Content-type: text/plain\n\n"); -if( $q->param('r') && $q->param('n') ) { +if( defined( $q->param('r') ) && defined( $q->param('n') ) ) { unless ( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'rmaccess', $q->param('r'), $q->param('n') ) == 0 ) { die( 'rmaccess was unsuccessful.' ); }; diff --git a/pinyweb/cgi-bin/auth/rmrepo.cgi b/pinyweb/cgi-bin/auth/rmrepo.cgi index 2d0ff23..f57170a 100755 --- a/pinyweb/cgi-bin/auth/rmrepo.cgi +++ b/pinyweb/cgi-bin/auth/rmrepo.cgi @@ -13,7 +13,7 @@ $q = CGI->new; print( "Content-type: text/plain\n\n"); -if( $q->param('r') ) { +if( defined( $q->param('r') ) ) { unless ( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'rmrepo', $q->param('r') ) == 0 ) { die( 'rmrepo was unsuccessful.' ); }; -- cgit v1.2.3