summaryrefslogtreecommitdiff
path: root/recv
blob: 1230ae00df9f42b08d52f774975bc56e37350192 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!@zsh@/bin/zsh

set -e

user="$1"
[[ -n "$user" ]] || exit 2

recvDir="$(getent passwd "$user" | cut -f6 -d:)/uucppublic"
[[ -d "$recvDir" ]] || exit 1

recvDir=$(mktemp -d -p "$recvDir" recv.XXXXXXXXXX)
chown "$user" "$recvDir"
chmod 750 "$recvDir"

umask 027
exec @gnutar@/bin/tar -xv -C "$recvDir" --owner "$user" --no-same-permissions