pam: fix conf_files, enable pam_namespace(8) for /tmp and /var/tmp.

- We now create /tmp and /var/tmp as tmpfs instances for all users
  except root, via pam_namespace(8).
- Fixed conf_files, it's /etc/environment not /etc/security/environment.

Bump revision.

--HG--
extra : convert_revision : 04b3d5a9c3e08b28e61708ea33ddb78db8ce5c77
This commit is contained in:
Juan RP 2010-01-17 22:48:29 +01:00
parent ddc29f253b
commit 6a5f54e8cb
2 changed files with 43 additions and 2 deletions

16
srcpkgs/pam/INSTALL Normal file
View file

@ -0,0 +1,16 @@
# This script creates the pam_namespace(8) instance directories
# for /tmp and /var/tmpfs, they are created from /tmp/.tmp_inst
# and /var/tmp/.tmp_inst respectively.
#
case "${ACTION}" in
post)
if [ ! -d tmp/.tmp_inst ]; then
mkdir -m 0000 tmp/.tmp_inst || exit $?
echo "Created pam_namespace(8) /tmp instance dir."
fi
if [ ! -d var/tmp/.tmp_inst ]; then
mkdir -m 0000 var/tmp/.tmp_inst || exit $?
echo "Created pam_namespace(8) /var/tmp instance dir."
fi
;;
esac

View file

@ -1,7 +1,7 @@
# Template file for 'pam' # Template file for 'pam'
pkgname=pam pkgname=pam
version=1.1.1 version=1.1.1
revision=2 revision=3
wrksrc="Linux-PAM-$version" wrksrc="Linux-PAM-$version"
distfiles="${KERNEL_SITE}/libs/pam/library/Linux-PAM-$version.tar.bz2" distfiles="${KERNEL_SITE}/libs/pam/library/Linux-PAM-$version.tar.bz2"
build_style=gnu_configure build_style=gnu_configure
@ -16,8 +16,8 @@ long_desc="
PAM was invented by SUN Microsystems." PAM was invented by SUN Microsystems."
conf_files=" conf_files="
/etc/environment
/etc/security/access.conf /etc/security/access.conf
/etc/security/environment
/etc/security/group.conf /etc/security/group.conf
/etc/security/limits.conf /etc/security/limits.conf
/etc/security/namespace.conf /etc/security/namespace.conf
@ -37,4 +37,29 @@ post_install()
rm -rf ${DESTDIR}/var rm -rf ${DESTDIR}/var
# Fix unix_chkpwd perms. # Fix unix_chkpwd perms.
chmod 4755 ${DESTDIR}/sbin/unix_chkpwd chmod 4755 ${DESTDIR}/sbin/unix_chkpwd
#
# Enable by default pam_namespace(8) to mount /tmp and
# /var/tmp as tmpfs for all users except root.
#
cat >> ${DESTDIR}/etc/security/namespace.conf << _EOF
#
# ------ END OF DEFAULT FILE ---------
#
# XBPS: by default create /tmp and /var/tmp tmpfs instances to
# all users except root.
#
/tmp /tmp/.tmp_inst/ tmpfs root
/var/tmp /var/tmp/.tmp_inst/ tmpfs root
#
_EOF
chmod 644 ${DESTDIR}/etc/security/namespace.conf || return 1
#
# Fix a syntax error in namespace.init, -p flag is unknown
# at least to dash and bash.
#
sed -i -e "s|^#!/bin/sh -p$|#!/bin/sh|" \
${DESTDIR}/etc/security/namespace.init || return 1
chmod 755 ${DESTDIR}/etc/security/namespace.init || return 1
} }