X-Original-To: alpine-aports@lists.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from apollo.thewebhostserver.com (apollomail.thewebhostserver.com [46.23.65.248]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 2508ADC0092 for ; Fri, 6 Feb 2015 14:29:30 +0000 (UTC) Received: from [81.4.121.188] (port=52167 helo=localhost.localdomain) by apollo.thewebhostserver.com with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.84) (envelope-from ) id 1YJjuQ-003jt1-U9; Fri, 06 Feb 2015 14:29:26 +0000 From: Stuart Cardall To: alpine-aports@lists.alpinelinux.org Cc: Stuart Cardall Subject: [alpine-aports] [PATCH] main/sshfs: post-install Date: Fri, 6 Feb 2015 14:28:59 +0000 Message-Id: <1423232939-499-1-git-send-email-developer@it-offshore.co.uk> X-Mailer: git-send-email 2.2.2 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - apollo.thewebhostserver.com X-AntiAbuse: Original Domain - lists.alpinelinux.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - it-offshore.co.uk X-Get-Message-Sender-Via: apollo.thewebhostserver.com: authenticated_id: developer@it-offshore.co.uk X-Source: X-Source-Args: X-Source-Dir: X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Small post-install script giving the option to selectively add normal users to group readproc so they can mount sshfs under grsecurity. --- main/sshfs/APKBUILD | 4 +++- main/sshfs/sshfs.post-install | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 main/sshfs/sshfs.post-install diff --git a/main/sshfs/APKBUILD b/main/sshfs/APKBUILD index 6b3c3b4..07897f6 100644 --- a/main/sshfs/APKBUILD +++ b/main/sshfs/APKBUILD @@ -8,7 +8,9 @@ arch="all" license="GPL" depends="openssh-client" makedepends="pkgconfig fuse-dev glib-dev" -source="http://downloads.sourceforge.net/sourceforge/fuse/sshfs-fuse-$pkgver.tar.gz" +source="http://downloads.sourceforge.net/sourceforge/fuse/sshfs-fuse-$pkgver.tar.gz + $pkgname.setup + " _builddir="$srcdir"/sshfs-fuse-$pkgver build () diff --git a/main/sshfs/sshfs.post-install b/main/sshfs/sshfs.post-install new file mode 100644 index 0000000..852cdfa --- /dev/null +++ b/main/sshfs/sshfs.post-install @@ -0,0 +1,29 @@ +#!/bin/sh + +NORMAL="\033[1;0m" +STRONG="\033[1;1m" +GREEN="\033[1;32m" + +print_strong() { + local prompt="${STRONG}$1 ${GREEN}$2${NORMAL}" + printf "${prompt} %s" +} + +user_list=$(awk -F':' '{ if ( $3 >= 1000 && $1 != "nobody" ) print $1}' /etc/passwd) +group=readproc + +if [ -n "$user_list" ]; then + print_strong "\nAdd normal system users to group '$group'" "(to allow sshfs mounting) [y/N]:" + read answer + + case "$answer" in + y*|Y*) for user in $user_list; do + read -p "Add '$user' to Group '$group'?: [y/N] " answer + case "$answer" in + y*|Y*) addgroup $user readproc;; + esac + done;; + esac +fi +exit 0 + -- 2.2.2 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---