git://git.jankratochvil.net
/
nethome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a05e485
)
Initial version of sshd(8) 'sftp' wrapper.
author
short
<>
Mon, 7 Mar 2005 11:18:20 +0000
(11:18 +0000)
committer
short
<>
Mon, 7 Mar 2005 11:18:20 +0000
(11:18 +0000)
src/sftpchroot.pl
[new file with mode: 0755]
patch
|
blob
diff --git a/src/sftpchroot.pl
b/src/sftpchroot.pl
new file mode 100755
(executable)
index 0000000..
a4f8ed4
--- /dev/null
+++ b/
src/sftpchroot.pl
@@ -0,0
+1,16
@@
+#! /usr/bin/perl -T --
+#
+# $Id$
+
+
+use strict;
+use warnings;
+
+my $CMD="/usr/libexec/openssh/sftp-server";
+my $PATH="/tmp";
+
+%ENV=(); # Prevent: Insecure $ENV{PATH} while running with -T switch
+chroot $PATH or die "chroot: $PATH: $!";
+chdir "/" or die "chdir: $!";
+exec $CMD;
+die "$CMD: $!";