summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Severance2015-09-10 04:47:20 -0400
committerChris Severance2015-09-10 04:47:20 -0400
commit1e9a1717aa6a3d9a4908e42cbd3e5fbc2933e846 (patch)
tree27659f1b9e3f59fdd573f6987830cd167d650b19
downloadaur-1e9a1717aa6a3d9a4908e42cbd3e5fbc2933e846.tar.gz
Initial Import
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD50
-rw-r--r--mysecureshell.install53
3 files changed, 120 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..cfa3a8738a22
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = mysecureshell
+ pkgdesc = A shell that adds advanced SFTP features to the OpenSSH server including ACLs, connection limits, and bandwidth control
+ pkgver = 2.00
+ pkgrel = 2
+ url = https://mysecureshell.readthedocs.org/
+ install = mysecureshell.install
+ arch = arm
+ arch = i686
+ arch = x86_64
+ license = GPL
+ depends = openssh
+ backup = etc/ssh/sftp_config
+ source = mysecureshell-2.00.tar.gz::https://github.com/mysecureshell/mysecureshell/archive/v2.00.tar.gz
+ sha256sums = 05fbcc407a61a06f980581320e7df46bbb7cf2d2ae253cae79f716bda0940890
+
+pkgname = mysecureshell
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6e46183d175c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
+# Contributor: garion < garion @ mailoo.org >
+# Contributor: Alessandro Nakamuta <alessandro dot ufms at gmail dot com>
+
+set -u
+pkgname='mysecureshell'
+pkgver='2.00'
+pkgrel='2'
+pkgdesc='A shell that adds advanced SFTP features to the OpenSSH server including ACLs, connection limits, and bandwidth control'
+arch=('arm' 'i686' 'x86_64')
+#url='http://mysecureshell.sourceforge.net'
+#url='https://github.com/mysecureshell/mysecureshell'
+url='https://mysecureshell.readthedocs.org/'
+license=('GPL')
+depends=('openssh')
+backup=('etc/ssh/sftp_config')
+install="${pkgname}.install"
+#source=("http://mysecureshell.free.fr/repository/index.php/source/mysecureshell_${pkgver}.tar.gz")
+_srcdir="${pkgname}-${pkgver}"
+_giturl="https://github.com/mysecureshell/${pkgname}"
+_verwatch=("${_giturl}/releases" "${_giturl#*github.com}/archive/v\(.*\)\.tar\.gz" 'l')
+source=("${pkgname}-${pkgver}.tar.gz::${_giturl}/archive/v${pkgver}.tar.gz")
+sha256sums=('05fbcc407a61a06f980581320e7df46bbb7cf2d2ae253cae79f716bda0940890')
+
+prepare(){
+ set -u
+ cd "${_srcdir}"
+ ./configure --with-logcolor='yes' # --prefix='/usr' # prefix moves /etc
+ set +u
+}
+
+build(){
+ set -u
+ cd "${_srcdir}"
+ make all -s -j "$(nproc)"
+ set +u
+}
+
+package(){
+ set -u
+ cd "${_srcdir}"
+ #local USER=root
+ sed -i -e 's!MANDIR=/share/man!MANDIR=/usr/share/man!g' './install.sh'
+ make DESTDIR="${pkgdir}" install
+
+ chmod a+r "${pkgdir}/usr/bin/sftp-"{kill,admin,state}
+ #cp -pvR 'man/fr' "${pkgdir}/usr/share/man/"
+ set +u
+}
+set +u
diff --git a/mysecureshell.install b/mysecureshell.install
new file mode 100644
index 000000000000..166f3a91b950
--- /dev/null
+++ b/mysecureshell.install
@@ -0,0 +1,53 @@
+pre_install() {
+ :
+}
+
+post_upgrade() {
+ local _shell='mysecureshell'
+ grep -qlxF -e "/usr/bin/${_shell}" '/etc/shells' || echo "/usr/bin/${_shell}" >> '/etc/shells'
+}
+
+post_install() {
+ post_upgrade
+ cat << _EOF
+=> To use MySecureShell:
+=> - replace the shell of SFTP user accounts on /etc/passwd.
+=> Warning: This program restrict the user account to SFTP use.
+=> Do not replace the shell of root or regular user.
+=> Info: Config file is on /etc/ssh/sftp_config.
+_EOF
+ #mandb -q
+}
+
+pre_upgrade() {
+ :
+}
+
+pre_remove() {
+ # This is only necessary on alternate shells. sh and bash
+ # are at the base of Arch and cannot be removed.
+ # To test this you should have a spare root shell already open.
+ # Otherwise, if this doesn't work, you will need to learn how to bypass
+ # the default shell on login.
+ # http://stackoverflow.com/questions/11059067/what-is-the-nix-command-to-view-a-users-default-login-shell
+ local _shell='mysecureshell'
+ if getent passwd root | cut -d: -f7 | grep -qlxF -e "/usr/bin/${_shell}"; then
+ echo '**********************************************'
+ echo "*** Warning: ROOT HAS ${_shell} as the login shell."
+ echo '*** Shell changed to sh to prevent loss of root access.'
+ echo '**********************************************'
+ # sh is more likely to guarantee a login than bash because sh is typically
+ # unmodified. Crappy, but guaranteed.
+ chsh -s '/bi''n/sh'
+ fi
+ sed -i -e "/^\/usr\/b""in\/${_shell}"'$/d' '/etc/shells'
+}
+
+post_remove() {
+ #mandb -q
+ local _shell='mysecureshell'
+ if getent passwd | cut -d: -f7 | grep -qlxF -e "/usr/bin/${_shell}"; then
+ echo "*** Warning: Some users have ${_shell} as their login shell."
+ echo '*** Fix promptly to restore access.'
+ fi
+}