]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
Restructured system login.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 12 May 2009 15:07:13 +0000 (17:07 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 12 May 2009 15:07:13 +0000 (17:07 +0200)
We use the tools from util-linux-ng for login and
shadow is no longer linked against pam.

Split cracklib into lfs/cracklib and lfs/python-cracklib, because
when we first compile cracklib, there is no python.

lfs/Config
lfs/cracklib
lfs/pam
lfs/shadow
lfs/util-linux-ng
make.sh

index 44a1bc7098c89f39e1fa8470151d68cbb909cdf7..974f10d1c31f3b339da6b2dbeb0cff09f20abfaa 100644 (file)
@@ -73,6 +73,8 @@ PKG_PACKAGE=$(PKG_NAME)-$(PKG_VER)-$(SNAME)$(PKG_REL).$(TARGET).ipk
 
 IMAGE_FILE  = $(IMAGES_DIR)/$(SNAME)-$(VERSION).sfs
 
+LFS_FILE    = $(firstword $(MAKEFILE_LIST))
+
 ###############################################################################
 # Common Macro Definitions
 ###############################################################################
index 6520ec4911755bea23249235a47a0f82fca88286..5f5d88b442014396ddf77ce34fda4ec76e95a7a2 100644 (file)
@@ -39,7 +39,6 @@ GROUP      = Security/Password
 CORE       = yes
 EXTRA      = no
 DEBUG      = no
-DEPS       = python
 
 URL        = http://sourceforge.net/projects/cracklib/
 LICENSE    = GPLv2
@@ -55,6 +54,12 @@ define LONG_DESC
        in a dictionary.
 endef
 
+ifeq "$(LFS_FILE)" "python-cracklib"
+       DEPS = python
+       SHORT_DESC = Python-bindings for cracklib.
+       LONG_DESC = A python module to use safe passwords.
+endif
+
 ###############################################################################
 # Top-level Rules
 ###############################################################################
@@ -82,14 +87,20 @@ $(objects):
 $(OBJECT): $(objects)
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && $(EXTRACTOR) $(DIR_DL)/$(DL_FILE)
-       -rm -rf /usr/share/dict
+
        cd $(DIR_APP) && \
                ./configure \
                        $(CONFIGURE_ARCH) \
                        --prefix=/usr \
                        --disable-static \
                        --with-default-dict=/lib/cracklib/pw_dict
+
+ifeq "$(LFS_FILE)" "python-cracklib"
+       cd $(DIR_APP)/python && make $(PARALLELISMFLAGS)
+       cd $(DIR_APP)/python && make install
+else
        cd $(DIR_APP) && make $(PARALLELISMFLAGS)
+       -rm -rf /usr/share/dict
        cd $(DIR_APP) && make install
        mv -v /usr/lib/libcrack.so.2* /lib
        ln -v -sf ../../lib/libcrack.so.2.8.0 /usr/lib/libcrack.so
@@ -102,5 +113,7 @@ $(OBJECT): $(objects)
        echo -ne "$(NAME)\n$(SNAME)\n" >> /usr/share/dict/cracklib-extra-words
        create-cracklib-dict /usr/share/dict/cracklib-words \
                /usr/share/dict/cracklib-extra-words
+endif
+
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
diff --git a/lfs/pam b/lfs/pam
index dfdc0061bfcc5575e20d40dd906f76b1b6760e2d..e2cb844839004bd0d949b66a22ece51c430d8e57 100644 (file)
--- a/lfs/pam
+++ b/lfs/pam
@@ -35,7 +35,7 @@ CORE       = yes
 EXTRA      = no
 DEBUG      = no
 
-DEPS       = cracklib
+DEPS       = #cracklib
 
 OBJECT     = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
 
index 63af2623ae3f7401d8adf82ccfc81af8e1ec1383..9b0d48bb06a2f48ab05340db589ff117b58db3df 100644 (file)
@@ -39,7 +39,7 @@ GROUP      = System/Base
 CORE       = yes
 EXTRA      = no
 DEBUG      = no
-DEPS       = $(EXTRA_DEPS)
+DEPS       =
 
 URL        = ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/
 LICENSE    = GPLv2+
@@ -51,13 +51,6 @@ define LONG_DESC
        format, plus programs for managing user and group accounts.
 endef
 
-ifneq "$(STAGE)" "base"
-       CONFIGURE_ARGS = --with-libpam
-       EXTRA_DEPS = pam
-else
-       CONFIGURE_ARGS = --without-libpam
-endif
-
 ###############################################################################
 # Top-level Rules
 ###############################################################################
@@ -98,30 +91,28 @@ $(OBJECT): $(objects)
        cd $(DIR_APP) && \
                ./configure \
                        $(CONFIGURE_ARCH) \
+                       --prefix=/usr \
                        --sysconfdir=/etc \
+                       --enable-shadowgrp \
                        --with-sha-crypt \
                        --without-selinux \
                        --without-libcrack \
-                       $(CONFIGURE_ARGS) \
+                       --without-libpam \
                        --disable-static
 
-       cd $(DIR_APP) && sed -i 's/groups$$(EXEEXT) //' src/Makefile
-       cd $(DIR_APP) && find man -name Makefile -exec sed -i 's/groups\.1 / /' {} \;
+       # Do not build these files:
+       cd $(DIR_APP) && \
+               for i in chfn chgpasswd chpasswd chsh expiry gpasswd groups login \
+                               logoutd nologin passwd su; do \
+                       sed -i "s/$$i\$$(EXEEXT)//" src/Makefile; \
+                       find man -name Makefile -exec sed -i "s/$$i\.1/ /" {} \;; \
+               done
+
+       # Do not install korean and zh man pages
        cd $(DIR_APP) && sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile
 
        cd $(DIR_APP) && make $(PARALLELISMFLAGS)
        cd $(DIR_APP) && make install
-       mv -v /usr/bin/passwd /bin
-
-ifeq "$(STAGE)" "base"
-       touch /etc/shadow
-       chmod 600 /etc/shadow
-       pwconv
-else
-       rm -vf /etc/login.access* /etc/limits*
-endif
-
-       rm -vf /etc/{passwd,shadow}-
 
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
index 74e472e89f58d8c70465355aad26a2f023b7e99d..85d1d06ee291844a6706fc99b62534df2d247e7f 100644 (file)
@@ -36,6 +36,9 @@ OBJECT     = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
 CORE       = yes
 EXTRA      = no
 DEBUG      = no
+DEPS       = pam
+
+CFLAGS    += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
 
 ###############################################################################
 # Top-level Rules
@@ -83,12 +86,38 @@ ifeq "$(STAGE)" "base"
        cd $(DIR_APP) && \
                ./configure \
                        $(CONFIGURE_ARCH) \
+                       --bindir=/bin \
+                       --sbindir=/sbin \
+                       --disable-wall \
                        --enable-arch \
+                       --enable-kill \
+                       --enable-login-utils \
                        --enable-partx \
-                       --enable-write
+                       --enable-write \
+                       --with-fsprobe=blkid \
+                       --disable-makeinstall-chown
+
        cd $(DIR_APP) && make $(PARALLELISMFLAGS)
        cd $(DIR_APP) && make install
 
+       # Build nologin
+       cd $(DIR_APP) && gcc $(CFLAGS) -o nologin $(DIR_SOURCE)/$(PKG_NAME)/nologin.c
+       cd $(DIR_APP) && install -m 755 nologin /sbin
+       install -m 644 $(DIR_SOURCE)/$(PKG_NAME)/nologin.8 /usr/share/man/man8
+
+       # Install mount tmpfs helper
+       install -m 755 $(DIR_SOURCE)/$(PKG_NAME)/mount.tmpfs /sbin
+
+       ln -svf ../../sbin/hwclock /usr/sbin/hwclock
+       ln -svf hwclock /sbin/clock
+       ln -sf ../../bin/kill /usr/bin/kill
+
+       touch /var/log/lastlog
+
+       # Remove deprecated commands
+       rm -rfv /sbin/{fsck,mkfs}.{bfs,minix} \
+               /usr/share/man/man*/{fsck,mkfs}.{bfs,minix}*
+
        #chmod -v -s /bin/mount
        #setcap CAP_DAC_OVERRIDE,CAP_SYS_ADMIN=ep /bin/mount
        #chmod -v -s /bin/umount
diff --git a/make.sh b/make.sh
index 81d0e6f7860e90878df4f0c7f59bcc4931daf8de..963a6f56bf2a8c3194d547276e71d303999cdf01 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -136,9 +136,11 @@ base_build() {
        ipfire_make attr
        ipfire_make libcap2
        ipfire_make paxctl
+       ipfire_make shadow
        ipfire_make autoconf
        ipfire_make automake
        ipfire_make bash
+       ipfire_make cracklib
        ipfire_make diffutils
        ipfire_make eventlog
        ipfire_make file
@@ -160,9 +162,9 @@ base_build() {
        ipfire_make man-db
        ipfire_make module-init-tools
        ipfire_make mpfr
+       ipfire_make pam
        ipfire_make patch
        ipfire_make psmisc
-       ipfire_make shadow
        ipfire_make syslog-ng
        ipfire_make sysvinit
        ipfire_make tar
@@ -202,6 +204,7 @@ ipfire_build() {
        ipfire_make perl-xml-parser
        ipfire_make intltool
        ipfire_make python
+       ipfire_make python-cracklib
        ipfire_make python-dbus
        ipfire_make python-urlgrabber
        ipfire_make python-IPy
@@ -243,9 +246,6 @@ ipfire_build() {
        ipfire_make libgpg-error
        ipfire_make libgcrypt
        ipfire_make libksba
-       ipfire_make cracklib
-       ipfire_make pam
-       ipfire_make shadow-pam
        ipfire_make slang
        ipfire_make newt
        ipfire_make cyrus-sasl