X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage2%2Fcis-shadow;h=bc63f0ad43cc5cea549cf1efe8b6a693835b4f4c;hb=d9a5344c1aa683d051d1a1d5e87f0bba317e299a;hp=96907011249d4c5a94f5e5810a02fd34ffdd764b;hpb=16cc35ba4890382ee9368a176e4f5a7fa773b7a6;p=hvlinux.git diff --git a/stage2/cis-shadow b/stage2/cis-shadow index 9690701..bc63f0a 100755 --- a/stage2/cis-shadow +++ b/stage2/cis-shadow @@ -1,4 +1,6 @@ -#!/bin/sh +#!/bin/bash +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -7,51 +9,46 @@ source ../functions source ../packages-list # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} + +cd ${LFS_TMP}/${1} -cd ${LFS_TMP}/${1}-build && -../${1}/configure \ - --libdir=/lib \ - --sysconfdir=/etc \ - --enable-shared \ - --without-selinux && # Disable the installation of the groups program and its man page, as # Coreutils provides a better version. -sed -i 's/groups$(EXEEXT) //' src/Makefile && -find man -name Makefile -exec sed -i '/groups/d' {} \; && -make -j ${MAKEJOBS} && -make install && -cp -f ../${1}/etc/{limits,login.access} /etc && - -# Instead of using the default crypt method, we want to use the more secure -# MD5 method of password encryption, which also allows passwords longer than -# 8 characters. We also need to change the obsolete /var/spool/mail location -# for user mailboxes that Shadow uses by default to the /var/mail location -# used currently. We accomplish both these things by changing the relevant -# configuration file while copying it to its destination. -sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \ - -e 's@/var/spool/mail@/var/mail@' \ - ../${1}/etc/login.defs > /etc/login.defs - -var_add_shadow "ENV_SUPATH" /etc/login.defs "/usr/local/sbin:/usr/local/bin" && +sed -i 's/groups$(EXEEXT) //' src/Makefile.in +find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; -# Move some misplaced symlinks/programs to their proper locations. -mv /usr/bin/passwd /bin && +# Disable the installation of Chinese and Korean manual pages, since Man-DB +# cannot format them properly: +sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile.in + +# Instead of using the default crypt method, use the more secure MD5 method +# of password encryption, which also allows passwords longer than 8 characters. +# It is also necessary to change the obsolete /var/spool/mail location for user +# mailboxes that Shadow uses by default to the /var/mail location used currently: +sed -i -e 's@#ENCRYPT_METHOD DES@ENCRYPT_METHOD MD5@' \ + -e 's@/var/spool/mail@/var/mail@' etc/login.defs -# Move Shadow's libraries to more appropriate locations. -mv /lib/libshadow.*a /usr/lib && -rm /lib/libshadow.so && -ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so && +cd ${LFS_TMP}/${1}-build +../${1}/configure \ + --sysconfdir=/etc \ + --without-selinux +make -j ${MAKEJOBS} +make install + +var_add_shadow "ENV_SUPATH" /etc/login.defs "/usr/local/sbin:/usr/local/bin" + +# Move some misplaced symlinks/programs to their proper locations. +mv /usr/bin/passwd /bin # The -D option of the useradd program requires this directory for it # to work properly. -mkdir -p /etc/default && +mkdir -p /etc/default # To enable shadowed passwords: -pwconv && +pwconv # To enable shadowed group passwords: grpconv -# Return last error exit $?