Mercurial > vanilla
comparison security/shadow/shadow.sh @ 822:a73b34fe66ec
security/shadow: add custom PAM files recommended per LFS
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 21 Aug 2019 20:50:00 +0200 |
parents | 59a2fa6992bc |
children | ae55d9077f70 |
comparison
equal
deleted
inserted
replaced
821:c5cbe07af6a9 | 822:a73b34fe66ec |
---|---|
20 PKGREVISION=1 | 20 PKGREVISION=1 |
21 PKGLICENSE="BSD" | 21 PKGLICENSE="BSD" |
22 PKGSUMMARY="password and account management" | 22 PKGSUMMARY="password and account management" |
23 PKGDOWNLOAD="https://github.com/shadow-maint/shadow/releases/download/$PKGVERSION/$PKGNAME-$PKGVERSION.tar.xz" | 23 PKGDOWNLOAD="https://github.com/shadow-maint/shadow/releases/download/$PKGVERSION/$PKGNAME-$PKGVERSION.tar.xz" |
24 PKGOPTIONS="ACL ATTR NLS PAM SELINUX" | 24 PKGOPTIONS="ACL ATTR NLS PAM SELINUX" |
25 PKGPROTECT="etc/login.defs" | 25 PKGPROTECT="etc/login.defs |
26 etc/pam.d/chage | |
27 etc/pam.d/chfn | |
28 etc/pam.d/chgpasswd | |
29 etc/pam.d/chpasswd | |
30 etc/pam.d/chsh | |
31 etc/pam.d/groupadd | |
32 etc/pam.d/groupdel | |
33 etc/pam.d/groupmems | |
34 etc/pam.d/groupmod | |
35 etc/pam.d/login | |
36 etc/pam.d/newusers | |
37 etc/pam.d/passwd | |
38 etc/pam.d/su | |
39 etc/pam.d/useradd | |
40 etc/pam.d/userdel | |
41 etc/pam.d/usermod" | |
26 | 42 |
27 : ${CHOST:=$(uname -m)-linux-musl} | 43 : ${CHOST:=$(uname -m)-linux-musl} |
28 : ${CBUILD:=$(uname -m)-linux-musl} | 44 : ${CBUILD:=$(uname -m)-linux-musl} |
29 : ${CC:=clang} | 45 : ${CC:=clang} |
30 : ${CFLAGS:=-O2} | 46 : ${CFLAGS:=-O2} |
75 rm -rf $PKGNAME-$PKGVERSION | 91 rm -rf $PKGNAME-$PKGVERSION |
76 tar xvf $PKGNAME-$PKGVERSION.tar.xz | 92 tar xvf $PKGNAME-$PKGVERSION.tar.xz |
77 cd $PKGNAME-$PKGVERSION | 93 cd $PKGNAME-$PKGVERSION |
78 | 94 |
79 # | 95 # |
80 # disable groups, it's provided by busybox/coreutils and documentation | 96 # Disable groups, it's provided by busybox/coreutils and documentation |
81 # by man-pages. | 97 # by man-pages. |
82 # | 98 # |
83 sed -i 's/groups$(EXEEXT) //' src/Makefile.in | 99 sed -i 's/groups$(EXEEXT) //' src/Makefile.in |
84 find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; | 100 find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; |
85 find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \; | 101 find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \; |
103 $with_selinux | 119 $with_selinux |
104 make ubindir=/bin usbindir=/bin | 120 make ubindir=/bin usbindir=/bin |
105 make DESTDIR=$DESTDIR ubindir=/bin usbindir=/bin install | 121 make DESTDIR=$DESTDIR ubindir=/bin usbindir=/bin install |
106 | 122 |
107 if [ "$PAM" = "yes" ]; then | 123 if [ "$PAM" = "yes" ]; then |
108 # --disable-selinux does not update pam.d files | 124 for i in \ |
109 if [ "$SELINUX" = "no" ]; then | 125 chage chfn chgpasswd chpasswd chsh groupadd groupdel \ |
110 sed -i -e "/pam_selinux.so/d" \ | 126 groupmems groupmod login newusers passwd su useradd \ |
111 $DESTDIR/etc/pam.d/login \ | 127 userdel usermod; do |
112 $DESTDIR/etc/pam.d/su | 128 install -Dm0600 ../$i $DESTDIR/etc/pam.d/$i |
113 fi | 129 done |
114 | |
115 # pam_console.so isn't shipped with linux-pam. | |
116 sed -i -e "/pam_console.so/d" $DESTDIR/etc/pam.d/login | |
117 fi | 130 fi |
118 | 131 |
119 cd .. | 132 cd .. |
120 rm -rf $PKGNAME-$PKGVERSION | 133 rm -rf $PKGNAME-$PKGVERSION |
121 } | 134 } |