summaryrefslogtreecommitdiff
path: root/pinyweb/cgi-bin/auth
diff options
context:
space:
mode:
Diffstat (limited to 'pinyweb/cgi-bin/auth')
-rwxr-xr-xpinyweb/cgi-bin/auth/addaccess.cgi22
-rwxr-xr-xpinyweb/cgi-bin/auth/newrepo.cgi9
-rwxr-xr-xpinyweb/cgi-bin/auth/rmaccess.cgi22
-rwxr-xr-xpinyweb/cgi-bin/auth/rmrepo.cgi22
4 files changed, 71 insertions, 4 deletions
diff --git a/pinyweb/cgi-bin/auth/addaccess.cgi b/pinyweb/cgi-bin/auth/addaccess.cgi
new file mode 100755
index 0000000..fca9574
--- /dev/null
+++ b/pinyweb/cgi-bin/auth/addaccess.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') ) {
+ unless( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'addaccess', $q->param('r'), $q->param('n') ) == 0 ) {
+ die( 'Addaccess was unsuccessful.' );
+ };
+} else {
+ print 'Missing parameters.';
+};
diff --git a/pinyweb/cgi-bin/auth/newrepo.cgi b/pinyweb/cgi-bin/auth/newrepo.cgi
index ad3cdd7..000be02 100755
--- a/pinyweb/cgi-bin/auth/newrepo.cgi
+++ b/pinyweb/cgi-bin/auth/newrepo.cgi
@@ -1,6 +1,8 @@
#!/usr/bin/perl
$| = 1;
+open(STDERR, ">&STDOUT");
+
use warnings;
use CGI;
@@ -11,10 +13,9 @@ $q = CGI->new;
print( "Content-type: text/plain\n\n");
-if( $q->param('n') && $q->param('d') ) {
- unless( open2( OUT, IN, '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'newrepo', '--batch', $q->param('n') ) ) {
- print 'could not execute newrepo';
- die;
+if( $q->param('r') && $q->param('d') ) {
+ unless( open2( OUT, IN, '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'newrepo', '--batch', $q->param('r') ) ) {
+ die 'could not execute newrepo';
};
# make things flushier
select( (select(IN), $| = 1)[0] );
diff --git a/pinyweb/cgi-bin/auth/rmaccess.cgi b/pinyweb/cgi-bin/auth/rmaccess.cgi
new file mode 100755
index 0000000..5123041
--- /dev/null
+++ b/pinyweb/cgi-bin/auth/rmaccess.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') ) {
+ unless ( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'rmaccess', $q->param('r'), $q->param('n') ) == 0 ) {
+ die( 'rmaccess was unsuccessful.' );
+ };
+} else {
+ print 'Missing parameters.';
+};
diff --git a/pinyweb/cgi-bin/auth/rmrepo.cgi b/pinyweb/cgi-bin/auth/rmrepo.cgi
new file mode 100755
index 0000000..2d0ff23
--- /dev/null
+++ b/pinyweb/cgi-bin/auth/rmrepo.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') ) {
+ unless ( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'rmrepo', $q->param('r') ) == 0 ) {
+ die( 'rmrepo was unsuccessful.' );
+ };
+} else {
+ print 'Missing parameters.';
+};