[evolvis-commits] r7486: Added cvssh.pl. ↵
mirabilos at evolvis.org
mirabilos at evolvis.org
Thu Feb 24 15:42:14 CET 2011
Author: mirabilos
Date: 2011-02-24 15:42:14 +0100 (Thu, 24 Feb 2011)
New Revision: 7486
Added:
trunk/gforge_base/evolvisforge-5.1/gforge/deb-specific/cvssh.pl
Modified:
trunk/gforge_base/evolvisforge-5.1/gforge/debian/changelog
Log:
Added cvssh.pl.
Added: trunk/gforge_base/evolvisforge-5.1/gforge/deb-specific/cvssh.pl
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/deb-specific/cvssh.pl (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/deb-specific/cvssh.pl 2011-02-24 14:42:14 UTC (rev 7486)
@@ -0,0 +1,50 @@
+#! /usr/bin/perl -w
+#
+# $Id$
+#
+# "Shell" for a restricted account, limiting the available commands
+# Roland Mas, debian-sf (Sourceforge for Debian)
+#
+# Inspired from the grap.c file in Sourceforge 2.5
+
+use strict ;
+use vars qw/ @allowed_options @allowed_commands $errmsg @cmd / ;
+use subs qw/ &reject / ;
+no locale ;
+
+ at allowed_options = ('-c', '-e') ;
+ at allowed_commands = ('cvs') ;
+
+# Clean up our environment
+delete @ENV{qw(IFS CDPATH ENV BASH_ENV PATH)};
+
+if ($#ARGV != 1) {
+ if ($#ARGV < 1) {
+ $errmsg = "Not enough arguments." ;
+ } else {
+ $errmsg = "Too many arguments." ;
+ }
+ &reject ;
+}
+
+if (scalar (grep { $_ eq $ARGV[0] } @allowed_options) == 0) {
+ $errmsg = "Option not allowed." ;
+ &reject ;
+}
+
+ at cmd = split (/ +/, $ARGV[1]) ;
+
+if (scalar (grep { $_ eq $cmd[0] } @allowed_commands) == 0) {
+ $errmsg = "Command not allowed." ;
+ &reject ;
+}
+
+exec @cmd ;
+
+sub reject {
+ print "This is a restricted account.\n" .
+ "You cannot execute anything here.\n" .
+ # $errmsg . "\n" .
+ "Goodbye.\n" ;
+ exit 1 ;
+}
Property changes on: trunk/gforge_base/evolvisforge-5.1/gforge/deb-specific/cvssh.pl
___________________________________________________________________
Added: svn:executable
+ *
Modified: trunk/gforge_base/evolvisforge-5.1/gforge/debian/changelog
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/debian/changelog 2011-02-24 14:42:13 UTC (rev 7485)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/debian/changelog 2011-02-24 14:42:14 UTC (rev 7486)
@@ -6,8 +6,9 @@
account
* [Roland] [From 2.5] Rewrote the config file handling, so that it does
not overwrite local changes.
+ * [Roland] [From 2.5] Added cvssh.pl.
- -- Roland Mas <lolando at debian.org> Fri, 30 Nov 2001 17:19:30 +0100
+ -- Roland Mas <lolando at debian.org> Fri, 30 Nov 2001 17:32:06 +0100
sourceforge (2.6-0+2) unstable; urgency=low
More information about the evolvis-commits
mailing list