+
+def allowSCP(run):
+ if len(run) != 3: return False
+ if run[0] != "scp": return False
+ if run[1] not in ("-f", "-t"): return False
+ return True
+
+def allowRSync(run):
+ if len(run) < 3: return False
+ if run[0] != "rsync": return False
+ if run[1] != "--server": return False
+ return True
+
+def allowSFTP(run):
+ if len(run) != 1: return False
+ return run[0] == "/usr/lib/openssh/sftp-server"
+
+allowCommands = [allowSCP, allowRSync, allowSFTP]