summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmish2020-11-26 21:20:14 +0530
committerAmish2020-11-26 21:20:14 +0530
commitca343d1fc6dc2a3f0f5724a50f726a21bd7968be (patch)
tree6d228f7d7b7513cd87c6aee055a64b60c0705d4e
parentedce5c262465d036f59a17e772e3299fa5868736 (diff)
downloadaur-ca343d1fc6dc2a3f0f5724a50f726a21bd7968be.tar.gz
Ship pam_abl.conf and tmpfiles.d config
-rw-r--r--.SRCINFO14
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD19
-rw-r--r--pam_abl.conf13
-rw-r--r--pam_abl.install19
-rw-r--r--pam_abl.tmpfiles1
6 files changed, 54 insertions, 16 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 82eba6a791d0..1de605cb99b6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
pkgbase = pam_abl
pkgdesc = Automated blacklisting on repeated failed authentication attempts
- pkgver = 0.6.0
+ pkgver = 1.0
pkgrel = 1
- url = http://pam-abl.sourceforge.net/
+ url = https://github.com/amishmm/pam_abl
install = pam_abl.install
arch = i686
arch = x86_64
@@ -10,9 +10,15 @@ pkgbase = pam_abl
makedepends = asciidoc
makedepends = cmake
depends = db
+ depends = kyotocabinet
depends = pam
- source = http://downloads.sourceforge.net/pam-abl/pam-abl-0.6.0.tar.gz
- md5sums = 62e02b88cf2da09eeea101a99f69f1ee
+ backup = etc/security/pam_abl.conf
+ source = pam_abl-1.0.tar.gz::https://github.com/amishmm/pam_abl/archive/v1.0.tar.gz
+ source = pam_abl.conf
+ source = pam_abl.tmpfiles
+ sha512sums = 7d7083de5af5112d0300be1ee9699d3290f6e984a20ed30bf4f5d63cd6c0cc1b06c6546fe45004a507d703224e5a774cc727b619ba939a8daa26de75bb61e7e9
+ sha512sums = 5b5c5b8796a852de9c7bcd4c58aea091b43c292038e0913aedf2827f4cb43c35069e9b0c48150a422610b266115633b70d670007e234c0d457f06fa49c95e32f
+ sha512sums = 581b86314b221a19db18cac5f85189d6d6446641c065be6543e926aaf09829902b84fb782a791ffbe74bcf90feaf438bb5a693a2405453988820e5598d285a1b
pkgname = pam_abl
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..4e72d51616e2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+src
+pkg
+*x86_64.pkg.tar.xz
+pam_abl-*.tar.gz
diff --git a/PKGBUILD b/PKGBUILD
index 1030203d16e7..ff4c0ab03414 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,6 +2,7 @@
# Contributor: quantax -- contact via Arch Linux forum or AUR
# Contributor: Michal Krenek <mikos@sg1.cz>
# Contributor: redden0t8 -- contact via Arch Linux forums or AUR
+
pkgname=pam_abl
pkgver=1.0
pkgrel=1
@@ -11,8 +12,13 @@ url='https://github.com/amishmm/pam_abl'
license=('GPL')
depends=(db kyotocabinet pam)
makedepends=(asciidoc cmake)
-source=("${pkgname}-${pkgver}.tar.gz::https://github.com/amishmm/${pkgname}/archive/v${pkgver}.tar.gz")
-sha512sums=('7d7083de5af5112d0300be1ee9699d3290f6e984a20ed30bf4f5d63cd6c0cc1b06c6546fe45004a507d703224e5a774cc727b619ba939a8daa26de75bb61e7e9')
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/amishmm/${pkgname}/archive/v${pkgver}.tar.gz"
+ 'pam_abl.conf'
+ 'pam_abl.tmpfiles')
+sha512sums=('7d7083de5af5112d0300be1ee9699d3290f6e984a20ed30bf4f5d63cd6c0cc1b06c6546fe45004a507d703224e5a774cc727b619ba939a8daa26de75bb61e7e9'
+ '5b5c5b8796a852de9c7bcd4c58aea091b43c292038e0913aedf2827f4cb43c35069e9b0c48150a422610b266115633b70d670007e234c0d457f06fa49c95e32f'
+ '581b86314b221a19db18cac5f85189d6d6446641c065be6543e926aaf09829902b84fb782a791ffbe74bcf90feaf438bb5a693a2405453988820e5598d285a1b')
+backup=('etc/security/pam_abl.conf')
install=pam_abl.install
build() {
@@ -26,8 +32,9 @@ build() {
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make -C build DESTDIR="${pkgdir}" install
- install --mode=0644 -D -- conf/pam_abl.conf "${pkgdir}/etc/security/pam_abl.conf.example"
- install --mode=0644 -D -- doc/pam_abl.1 "${pkgdir}/usr/share/man/man1/pam_abl.1"
- install --mode=0644 -D -- doc/pam_abl.8 "${pkgdir}/usr/share/man/man8/pam_abl.8"
- install --mode=0644 -D -- doc/pam_abl.conf.5 "${pkgdir}/usr/share/man/man5/pam_abl.conf.5"
+ install -Dm644 ../pam_abl.conf "${pkgdir}"/etc/security/pam_abl.conf
+ install -Dm644 doc/pam_abl.1 "${pkgdir}"/usr/share/man/man1/pam_abl.1
+ install -Dm644 doc/pam_abl.8 "${pkgdir}"/usr/share/man/man8/pam_abl.8
+ install -Dm644 doc/pam_abl.conf.5 "${pkgdir}"/usr/share/man/man5/pam_abl.conf.5
+ install -Dm644 ../pam_abl.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/pam_abl.conf
}
diff --git a/pam_abl.conf b/pam_abl.conf
new file mode 100644
index 000000000000..a6c0be8c18b2
--- /dev/null
+++ b/pam_abl.conf
@@ -0,0 +1,13 @@
+db_home=/var/lib/abl
+db_module=/usr/lib/security/pam_abl_kc.so
+host_purge=2d
+user_purge=2d
+host_rule=*:10/1h,20/1d
+user_rule=*:30/1h,50/1d
+host_clear_cmd=[/usr/bin/logger] [clear] [host] [%h]
+host_block_cmd=[/usr/bin/logger] [block] [host] [%h]
+user_clear_cmd=[/usr/bin/logger] [clear] [user] [%u]
+user_block_cmd=[/usr/bin/logger] [block] [user] [%u]
+limits=1000-1200
+host_whitelist=127.0.0.1
+user_whitelist=root
diff --git a/pam_abl.install b/pam_abl.install
index 6f207b3c0672..84421630137a 100644
--- a/pam_abl.install
+++ b/pam_abl.install
@@ -1,11 +1,18 @@
post_upgrade() {
- echo Warning: the database format has changed with version 0.5.0.
- echo The database files must be manually deleted and recreated if
- echo you are upgrading from an earlier version.
+ if (( $(vercmp $2 1.0) < 0 )); then
+ if test -f etc/security/pam_abl.conf ; then
+ if ! grep -q db_module= etc/security/pam_abl.conf ; then
+ echo db_module not set in /etc/security/pam_abl.conf
+ echo Setting db_module as BDB module. Consider switching to Kyoto Cabinet.
+ echo 'db_module=/usr/lib/security/pam_abl_bdb.so' >> etc/security/pam_abl.conf
+ fi
+ echo host_db and user_db options are removed, commenting in /etc/security/pam_abl.conf
+ sed -i -e 's/^\(host_db=\)/#\1/' -e 's/^\(user_db=\)/#\1/' etc/security/pam_abl.conf
+ fi
+ fi
}
post_install() {
- echo This package requires non-trivial configuration. See the
- echo Arch Wiki for details:
- echo https://wiki.archlinux.org/index.php/Pam_abl
+ echo This package requires non-trivial configuration. See:
+ echo https://wiki.archlinux.org/index.php/Pam_abl
}
diff --git a/pam_abl.tmpfiles b/pam_abl.tmpfiles
new file mode 100644
index 000000000000..71c111087a2e
--- /dev/null
+++ b/pam_abl.tmpfiles
@@ -0,0 +1 @@
+d /var/lib/abl 0750