diff options
Diffstat (limited to 'EndoForge/openssh/run-sshd')
-rwxr-xr-x | EndoForge/openssh/run-sshd | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/EndoForge/openssh/run-sshd b/EndoForge/openssh/run-sshd new file mode 100755 index 0000000..29615fb --- /dev/null +++ b/EndoForge/openssh/run-sshd | |||
@@ -0,0 +1,28 @@ | |||
1 | #!/bin/sh | ||
2 | case "$LD_PRELOAD" in | ||
3 | libfakeroot-sysv.so) ;; | ||
4 | '') exec fakeroot -- "$0" "$@" ;; | ||
5 | *) exit 1 ;; | ||
6 | esac | ||
7 | |||
8 | fixperms() | ||
9 | { | ||
10 | set -- | ||
11 | dirs=$HOME | ||
12 | p=$HOME | ||
13 | while [ "$p" != "${p%/*}" ] | ||
14 | do | ||
15 | p=${p%/*} | ||
16 | dirs="$dirs $p/" | ||
17 | done | ||
18 | |||
19 | chown root:root $dirs | ||
20 | chmod go-w $dirs | ||
21 | } | ||
22 | |||
23 | fixperms | ||
24 | |||
25 | PATH=/sbin:/usr/sbin:$PATH | ||
26 | cmd="$(which sshd) $*" | ||
27 | runuser -u "$USER" -- sh -c "$cmd" | ||
28 | |||