diff options
Diffstat (limited to 'pinyweb/cgi-bin/auth')
-rwxr-xr-x | pinyweb/cgi-bin/auth/addaccess.cgi | 2 | ||||
-rwxr-xr-x | pinyweb/cgi-bin/auth/lsaccess.cgi | 24 | ||||
-rwxr-xr-x | pinyweb/cgi-bin/auth/lsrepo.cgi | 18 | ||||
-rwxr-xr-x | pinyweb/cgi-bin/auth/newrepo.cgi | 2 | ||||
-rwxr-xr-x | pinyweb/cgi-bin/auth/pinyconfig.cgi | 26 | ||||
-rwxr-xr-x | pinyweb/cgi-bin/auth/rebuildrepo.cgi | 22 | ||||
-rwxr-xr-x | pinyweb/cgi-bin/auth/rmaccess.cgi | 2 | ||||
-rwxr-xr-x | pinyweb/cgi-bin/auth/rmrepo.cgi | 2 |
8 files changed, 94 insertions, 4 deletions
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 new file mode 100755 index 0000000..354ba32 --- /dev/null +++ b/pinyweb/cgi-bin/auth/lsaccess.cgi @@ -0,0 +1,24 @@ +#!/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') ) ) { + unless ( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'lsaccess', $q->param('r') ) == 0 ) { + die( 'lsaccess was unsuccessful.' ); + }; +} else { + unless ( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'lsaccess' ) == 0 ) { + die( 'lsaccess was unsuccessful.' ); + }; +}; diff --git a/pinyweb/cgi-bin/auth/lsrepo.cgi b/pinyweb/cgi-bin/auth/lsrepo.cgi new file mode 100755 index 0000000..599eb80 --- /dev/null +++ b/pinyweb/cgi-bin/auth/lsrepo.cgi @@ -0,0 +1,18 @@ +#!/usr/bin/perl +$| = 1; + +open(STDERR, ">&STDOUT"); + +use warnings; + +use CGI; + +use IPC::Open2; + +$q = CGI->new; + +print( "Content-type: text/plain\n\n"); + +unless ( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'lsrepo' ) == 0 ) { + die( 'lsrepo 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 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.'; +}; diff --git a/pinyweb/cgi-bin/auth/rebuildrepo.cgi b/pinyweb/cgi-bin/auth/rebuildrepo.cgi new file mode 100755 index 0000000..912e004 --- /dev/null +++ b/pinyweb/cgi-bin/auth/rebuildrepo.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( defined( $q->param('r') ) ) { + unless ( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'rebuildrepo', $q->param('r') ) == 0 ) { + die( 'rebuildrepo was unsuccessful.' ); + }; +} else { + print 'Missing parameters.'; +}; 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.' ); }; |