Historic archive of defunct list bismark-commits@lists.bufferbloat.net
 help / color / mirror / Atom feed
From: walter@svn.comics.unina.it
To: bismark-commits@lists.bufferbloat.net
Subject: [Bismark-commits] rev 354 - trunk/server/scripts
Date: Fri, 27 May 2011 20:10:00 +0200	[thread overview]
Message-ID: <E1QQ1U0-0003Gv-Pw@svn.comics.unina.it> (raw)

Author: walter
Date: 2011-05-27 20:10:00 +0200 (Fri, 27 May 2011)
New Revision: 354

Added:
   trunk/server/scripts/brsh
Log:
added bismark restricted shell

Added: trunk/server/scripts/brsh
===================================================================
--- trunk/server/scripts/brsh	                        (rev 0)
+++ trunk/server/scripts/brsh	2011-05-27 18:10:00 UTC (rev 354)
@@ -0,0 +1,25 @@
+#!/bin/bash
+# Bismark Restricted Shell
+# 
+# Only allows to execute: 
+# - scp    : to upload measure results
+# - rshell : add recovery tunnel to list
+#
+# author: walter.dedonato@unina.it
+
+#echo $SSH_ORIGINAL_COMMAND 
+
+. ~/etc/bdm.conf
+
+cmd=$(echo "$SSH_ORIGINAL_COMMAND" | gawk '
+	($1 == "scp") && ($(NF-1) ~ "-t") && ($NF ~ "^var/data/") && ! ($NF ~ "\\.\\.") && ! /[;$`]/ { print }
+	($1 == "rshell") && ! /[;$`]/ { print "bdm settunnel " $2 " " $3 }
+')
+
+$cmd
+
+if [ ${cmd:0:3} == "bdm" ]; then
+	while [ true ]; do
+		read 
+	done
+fi


Property changes on: trunk/server/scripts/brsh
___________________________________________________________________
Name: svn:mergeinfo
   + 


                 reply	other threads:[~2011-05-27 19:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1QQ1U0-0003Gv-Pw@svn.comics.unina.it \
    --to=walter@svn.comics.unina.it \
    --cc=bismark-commits@lists.bufferbloat.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox