remove unnecessary newline conversion
[gemrepl.git] / examples / ed.sh
blob570e72bfce3042cd8e101b4c94f381670e6e2855
1 #!/bin/sh
2 # Run ed in restricted mode, allowing the user to edit files in a directory
3 # specific to their client cert.
5 var=/var/gemini/ed/
7 [ -n "$TLS_CLIENT_HASH" ] || exit 1
9 mkdir -p "$var/$TLS_CLIENT_HASH" || exit 1
10 cd "$var/$TLS_CLIENT_HASH" || exit 1
12 # Impose some severe limits to reduce potential for abuse
13 ulimit -n 10
14 ulimit -t 300
15 ulimit -f 1000
16 ulimit -v 5000
18 touch sandbox
19 ed -r -v sandbox