diff options
Diffstat (limited to 'source/ap/screen')
-rw-r--r-- | source/ap/screen/doinst.sh | 19 | ||||
-rwxr-xr-x | source/ap/screen/screen.SlackBuild | 44 | ||||
-rw-r--r-- | source/ap/screen/screen.pam | 5 |
3 files changed, 47 insertions, 21 deletions
diff --git a/source/ap/screen/doinst.sh b/source/ap/screen/doinst.sh new file mode 100644 index 000000000..c71460ad0 --- /dev/null +++ b/source/ap/screen/doinst.sh @@ -0,0 +1,19 @@ +#!/bin/bash +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} +config etc/screenrc.new +config etc/skel/.screenrc.new +if [ -r etc/pam.d/screen.new ]; then + config etc/pam.d/screen.new +fi +# This is probably safer than leaving the hidden .new file... maybe? +rm -f etc/skel/.screenrc.new diff --git a/source/ap/screen/screen.SlackBuild b/source/ap/screen/screen.SlackBuild index dc7f2ded7..ee5b24aed 100755 --- a/source/ap/screen/screen.SlackBuild +++ b/source/ap/screen/screen.SlackBuild @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2008, 2009, 2010, 2011, 2013, 2014, 2015, 2016, 2018, 2019 Patrick J. Volkerding, Sebeka, Minnesota, USA +# Copyright 2008, 2009, 2010, 2011, 2013, 2014, 2015, 2016, 2018, 2019, 2020 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -46,12 +46,16 @@ fi if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" + LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" + LIBDIRSUFFIX="" fi TMP=${TMP:-/tmp} @@ -86,6 +90,15 @@ done # the console from being properly cleared when detaching from a screen session: zcat $CWD/60-revert-screenrc-change.diff.gz | patch -p1 --verbose || exit 1 +# Choose correct options depending on whether PAM is installed: +if [ -L /lib${LIBDIRSUFFIX}/libpam.so.? ]; then + PAM_OPTIONS="--enable-pam" + unset SHADOW_OPTIONS +else + unset PAM_OPTIONS + SHADOW_OPTIONS="--disable-pam" +fi + # Configure: CFLAGS="$SLKCFLAGS" \ ./configure \ @@ -97,7 +110,8 @@ CFLAGS="$SLKCFLAGS" \ --with-sys-screenrc=/etc/screenrc \ --with-pty-mode=0620 \ --with-pty-group=5 \ - --disable-pam \ + $PAM_OPTIONS \ + $SHADOW_OPTIONS \ --enable-telnet \ --disable-socket-dir \ --enable-use-locale \ @@ -125,6 +139,12 @@ chmod 755 $PKG/usr/bin/screen-$VERSION mkdir -p $PKG/etc/skel cat etc/etcscreenrc > $PKG/etc/screenrc.new cat etc/screenrc > $PKG/etc/skel/.screenrc.new + +if [ ! -z "$PAM_OPTIONS" ]; then + mkdir -p $PKG/etc/pam.d + cat $CWD/screen.pam > $PKG/etc/pam.d/screen.new +fi + rm -f $PKG/usr/info/dir gzip -9 $PKG/usr/info/* gzip -9 $PKG/usr/man/man1/* @@ -135,26 +155,8 @@ cp -a COPYING ChangeLog HACKING INSTALL NEWS README TODO \ $PKG/usr/doc/screen-$VERSION mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc -cat << EOF > $PKG/install/doinst.sh -#!/bin/bash -config() { - NEW="\$1" - OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" - # If there's no config file by that name, mv it over: - if [ ! -r \$OLD ]; then - mv \$NEW \$OLD - elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then # toss the redundant copy - rm \$NEW - fi - # Otherwise, we leave the .new copy for the admin to consider... -} -config etc/screenrc.new -config etc/skel/.screenrc.new -# This is probably safer than leaving the hidden .new file... maybe? -rm -f etc/skel/.screenrc.new -EOF +zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh # Build package: cd $PKG makepkg -l y -c n $TMP/screen-$VERSION-$ARCH-$BUILD.txz - diff --git a/source/ap/screen/screen.pam b/source/ap/screen/screen.pam new file mode 100644 index 000000000..d286fe2a3 --- /dev/null +++ b/source/ap/screen/screen.pam @@ -0,0 +1,5 @@ +#%PAM-1.0 + +auth required pam_securetty.so debug +auth include system-auth + |