diff options
author | Hao Chi Kiang <no@no.noooo.ooo> | 2023-11-11 21:35:57 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-11-11 22:16:58 +0700 |
commit | 328d606edc96e62d2777dafd95393e9ef8e075b0 (patch) | |
tree | 46a59df436fcda9bfda46cffab8ce50a4fd4d6e0 /libraries | |
parent | 2d798bde0de25d23b5008f7fc864f4655004f479 (diff) |
libraries/pam_usb: Added (hardware authentication).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/pam_usb/README | 12 | ||||
-rw-r--r-- | libraries/pam_usb/pam_usb.SlackBuild | 96 | ||||
-rw-r--r-- | libraries/pam_usb/pam_usb.info | 10 | ||||
-rw-r--r-- | libraries/pam_usb/slack-desc | 19 |
4 files changed, 137 insertions, 0 deletions
diff --git a/libraries/pam_usb/README b/libraries/pam_usb/README new file mode 100644 index 0000000000000..222d81fc4aff6 --- /dev/null +++ b/libraries/pam_usb/README @@ -0,0 +1,12 @@ +pam_usb (Hardware Auth via Memory Sticks) + +This is a PAM module for Linux authentication using USB memory sticks, +SD cards, external SSD etc. Simply speaking, it lets you log onto +your Linux user without typing password if the pre-configured memory +stick is detected. + +See https://github.com/mcdope/pam_usb for configuration instruction. + +In Slackware 15, the right file to modify are +/etc/pam.d/system-auth +/etc/security/pam_usb.conf diff --git a/libraries/pam_usb/pam_usb.SlackBuild b/libraries/pam_usb/pam_usb.SlackBuild new file mode 100644 index 0000000000000..5cbd1fbade237 --- /dev/null +++ b/libraries/pam_usb/pam_usb.SlackBuild @@ -0,0 +1,96 @@ +#!/bin/bash +# Copyright (C) 2023 Hao Chi Kiang <no@no.noooo.ooo> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# revision date: 2023/11/11 +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=pam_usb +VERSION=${VERSION:-0.8.3} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +unzip $CWD/$PRGNAM-$VERSION.zip +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +sed -i "s|share/doc/|doc/|g" Makefile +sed -i "s|share/man|man|g" Makefile + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +make +make PREFIX=/usr DESTDIR=$PKG install + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS COPYING *.md doc/CONFIGURATION doc/QUICKSTART doc/SECURITY doc/TROUBLESHOOTING $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +rm -rf $PKG/usr/doc/pam_usb + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/libraries/pam_usb/pam_usb.info b/libraries/pam_usb/pam_usb.info new file mode 100644 index 0000000000000..88eb9c44240ae --- /dev/null +++ b/libraries/pam_usb/pam_usb.info @@ -0,0 +1,10 @@ +PRGNAM="pam_usb" +VERSION="0.8.3" +HOMEPAGE="https://github.com/mcdope/pam_usb" +DOWNLOAD="https://github.com/mcdope/pam_usb/archive/0.8.3/pam_usb-0.8.3.zip" +MD5SUM="f584fb5dbc8e84eebefd8a1911b7cd7f" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Hao Chi Kiang" +EMAIL="no@no.noooo.ooo" diff --git a/libraries/pam_usb/slack-desc b/libraries/pam_usb/slack-desc new file mode 100644 index 0000000000000..01975b4bdbce0 --- /dev/null +++ b/libraries/pam_usb/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +pam_usb: pam_usb (Hardware Auth via Memory Sticks) +pam_usb: +pam_usb: This is a PAM module for Linux authentication using USB memory sticks, +pam_usb: SD cards, external SSD etc. Simply speaking, it lets you log onto +pam_usb: your Linux user without typing password if the pre-configured memory +pam_usb: stick is detected. +pam_usb: +pam_usb: See https://github.com/mcdope/pam_usb for configuration instruction. +pam_usb: +pam_usb: +pam_usb: |