From fc2d60f963f6388bdfb56b32c84afa1ee5c0f887 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 13 May 2018 13:03:44 +0200 Subject: Permissions --- nix/recv.nix | 2 +- recv | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nix/recv.nix b/nix/recv.nix index d24d412..1634b61 100644 --- a/nix/recv.nix +++ b/nix/recv.nix @@ -4,7 +4,7 @@ stdenv.mkDerivation rec { name = "recv-${version}"; - version = "0.3"; + version = "0.4"; src = ../recv; phases = [ "buildPhase" "installPhase" ]; diff --git a/recv b/recv index ed1e0ed..1230ae0 100644 --- a/recv +++ b/recv @@ -8,6 +8,9 @@ user="$1" recvDir="$(getent passwd "$user" | cut -f6 -d:)/uucppublic" [[ -d "$recvDir" ]] || exit 1 -umask 027 +recvDir=$(mktemp -d -p "$recvDir" recv.XXXXXXXXXX) +chown "$user" "$recvDir" +chmod 750 "$recvDir" -exec @gnutar@/bin/tar -xv -C $(mktemp -d -p "$recvDir" recv.XXXXXXXXXX) --owner "$user" --no-same-permissions \ No newline at end of file +umask 027 +exec @gnutar@/bin/tar -xv -C "$recvDir" --owner "$user" --no-same-permissions \ No newline at end of file -- cgit v1.2.3