summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d8b9a3d)
Suppose there's a part of the filesystem namespace that you want users
to be able to claim bits of. The usual approach is to make the top
directory of the subtree be world-writable and sticky, but this causes
no end of trouble: there's potential contention for the namespace, which
leads to security problems.
These tools provide an alternative approach: a userv service which makes
a directory named after and owned by the calling user, and with
restrictive permissions. It doesn't set a group for the new directory,
but the caller can do that.
--- /dev/null
+#! /bin/sh
+
+set -e
+dir="${1?dir}/$USERV_USER"
+if [ ! -d "$dir" ]; then
+ mkdir -m700 "$dir"
+ chown "$USERV_USER" "$dir"
+fi
+echo "$dir"
--- /dev/null
+### -*-conf-*-
+
+if grep calling-user-shell /etc/shells
+ suppress-args
+ execute /usr/local/sbin/claim-dir /mnt/mem
+fi