wok-tiny rev 96

No shadow passwords
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Oct 07 10:53:41 2015 +0200 (2015-10-07)
parents 84dee9f78001
children bb00d1e3b0f7
files base-tiny/receipt base-tiny/stuff/etc/group base-tiny/stuff/etc/passwd busybox/receipt busybox/stuff/busybox-1.18.config busybox/stuff/udhcp.script hardware-ibm-6272/receipt linux/stuff/bootloader.S
line diff
     1.1 --- a/base-tiny/receipt	Tue Oct 06 21:04:42 2015 +0200
     1.2 +++ b/base-tiny/receipt	Wed Oct 07 10:53:41 2015 +0200
     1.3 @@ -8,13 +8,15 @@
     1.4  LICENSE="BSD"
     1.5  WEB_SITE="http://tiny.slitaz.org/"
     1.6  AUTO_SELECTION="always"
     1.7 -CONFIG_FILES="/etc/network.conf /etc/rcS.conf /etc/passwd /etc/shadow \
     1.8 -/root/.profile /etc/fstab /etc/init.d/local.sh"
     1.9 +CONFIG_FILES="/etc/network.conf /etc/rcS.conf /etc/passwd /etc/fstab \
    1.10 +/root/.profile /etc/init.d/local.sh"
    1.11  
    1.12  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.13  genpkg_rules()
    1.14  {
    1.15 -	cp -a $stuff/. $fs
    1.16 +	for i in $CONFIG_FILES ; do
    1.17 +		[ -e $stuff$i ] && echo ${i#/}
    1.18 +	done | ( cd $stuff ; cpio -o -H newc ) | ( cd $fs ; cpio -id )
    1.19  }
    1.20  
    1.21  config_form()
    1.22 @@ -79,6 +81,8 @@
    1.23  </textarea></td>
    1.24  </tr>
    1.25  </table>
    1.26 +<input type="checkbox" name="KEEP_MODULES" />
    1.27 +Do not remove the modules files after loading modules.
    1.28  EOT
    1.29  }
    1.30  
    1.31 @@ -93,23 +97,26 @@
    1.32  	DHCP)	DHCP="yes"
    1.33  		STATIC="no"
    1.34  	esac
    1.35 -	sed -i -e "s/^DNS_SERVER=.*/DNS_SERVER=\"$DNS_SERVER\"/" \
    1.36 -	       -e "s/^INTERFACE=.*/INTERFACE=\"$INTERFACE\"/" \
    1.37 -	       -e "s/^NETMASK=.*/NETMASK=\"$NETMASK\"/" \
    1.38 -	       -e "s/^GATEWAY=.*/GATEWAY=\"$GATEWAY\"/" \
    1.39 -	       -e "s/^STATIC=.*/STATIC=\"$STATIC\"/" \
    1.40 -	       -e "s/^DHCP=.*/DHCP=\"$DHCP\"/" \
    1.41 -	       -e "s/^IP=.*/IP=\"$IP\"/" $1/etc/network.conf
    1.42 +	sed -i	"s/^KEEP_MODULES=.*/KEEP_MODULES=\"$KEEP_MODULES\"/" \
    1.43 +			$1/etc/rcS.conf
    1.44 +	sed -i	-e "s/^DNS_SERVER=.*/DNS_SERVER=\"$DNS_SERVER\"/" \
    1.45 +		-e "s/^INTERFACE=.*/INTERFACE=\"$INTERFACE\"/" \
    1.46 +		-e "s/^NETMASK=.*/NETMASK=\"$NETMASK\"/" \
    1.47 +		-e "s/^GATEWAY=.*/GATEWAY=\"$GATEWAY\"/" \
    1.48 +		-e "s/^STATIC=.*/STATIC=\"$STATIC\"/" \
    1.49 +		-e "s/^DHCP=.*/DHCP=\"$DHCP\"/" \
    1.50 +		-e "s/^IP=.*/IP=\"$IP\"/" $1/etc/network.conf
    1.51  	if [ -n "$PASSWORD" ]; then
    1.52  		case "$PASSWORD" in
    1.53  		\$1\$*)
    1.54  			sed -i "s|^root:[^:]*|root:$PASSWORD|" $1/etc/shadow ;;
    1.55  		*)
    1.56 -			mkdir $1/lib
    1.57 -			cp -a /lib/lib[cm][.-]* /lib/ld* $1/lib
    1.58 -			cp -a /bin/busybox $1/lib/chpasswd
    1.59 -			echo "root:$PASSWORD" | chroot $1/ /lib/chpasswd -m
    1.60 -			rm -rf $1/lib
    1.61 +			mkdir $1/fs
    1.62 +			( cd $1/fs ; cpio -idmu ) < dist/rootfs.cpio
    1.63 +			cp $1/etc/passwd $1/fs/etc/
    1.64 +			echo "root:$PASSWORD" | chroot $1/fs/ busybox chpasswd -m
    1.65 +			cp $1/fs/etc/passwd $1/etc/
    1.66 +			rm -rf $1/fs
    1.67  		esac
    1.68  	else
    1.69  		sed -i 's/^root:[^:]*:/root::/' $1/etc/passwd
     2.1 --- a/base-tiny/stuff/etc/group	Tue Oct 06 21:04:42 2015 +0200
     2.2 +++ b/base-tiny/stuff/etc/group	Wed Oct 07 10:53:41 2015 +0200
     2.3 @@ -1,20 +1,20 @@
     2.4 -root:x:0:
     2.5 -daemon:x:1:
     2.6 -bin:x:2:
     2.7 -sys:x:3:
     2.8 -adm:x:4:
     2.9 -tty:x:5:
    2.10 -disk:x:6:root
    2.11 -lp:x:7:
    2.12 -kmem:x:9:
    2.13 -wheel:x:10:root
    2.14 -floppy:x:11:
    2.15 -video:x:18:
    2.16 -cdrom:x:19:
    2.17 -audio:x:20:
    2.18 -tape:x:26:
    2.19 -www:x:80:
    2.20 -plugdev:x:83:
    2.21 -dialout:x:95:
    2.22 -nogroup:x:99:
    2.23 -users:x:100:
    2.24 +root:*:0:
    2.25 +daemon:!:1:
    2.26 +bin:!:2:
    2.27 +sys:!:3:
    2.28 +adm:!:4:
    2.29 +tty:!:5:
    2.30 +disk:!:6:root
    2.31 +lp:!:7:
    2.32 +kmem:!:9:
    2.33 +wheel:!:10:root
    2.34 +floppy:!:11:
    2.35 +video:!:18:
    2.36 +cdrom:!:19:
    2.37 +audio:!:20:
    2.38 +tape:!:26:
    2.39 +www:!:80:
    2.40 +plugdev:!:83:
    2.41 +dialout:!:95:
    2.42 +nogroup:!:99:
    2.43 +users:!:100:
     3.1 --- a/base-tiny/stuff/etc/passwd	Tue Oct 06 21:04:42 2015 +0200
     3.2 +++ b/base-tiny/stuff/etc/passwd	Wed Oct 07 10:53:41 2015 +0200
     3.3 @@ -1,3 +1,3 @@
     3.4 -root:x:0:0:Root Administrator:/root:/bin/sh
     3.5 -nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
     3.6 -www:x:80:80:Web Server User:/var/www:/bin/false
     3.7 +root:$1$EbR327ag$7NFmnOi7JQc5/lG0JLiU8/:0:0:Root Administrator:/root:/bin/sh
     3.8 +nobody:*:99:99:Unprivileged User:/dev/null:/bin/false
     3.9 +www:*:80:80:Web Server User:/var/www:/bin/false
     4.1 --- a/busybox/receipt	Tue Oct 06 21:04:42 2015 +0200
     4.2 +++ b/busybox/receipt	Wed Oct 07 10:53:41 2015 +0200
     4.3 @@ -120,6 +120,10 @@
     4.4  
     4.5      ( cd rootfs ; find | cpio -o -H newc ) > rootfs.cpio
     4.6      du -h rootfs.cpio
     4.7 +
     4.8 +	rm -rf $fs/*
     4.9 +	cp rootfs.cpio $fs
    4.10 +	cp $stuff/busybox*config $fs/busybox.config.txt
    4.11  }
    4.12  
    4.13  # Force glibc-2.7 reinstall if 2.3.6 still in use.
     5.1 --- a/busybox/stuff/busybox-1.18.config	Tue Oct 06 21:04:42 2015 +0200
     5.2 +++ b/busybox/stuff/busybox-1.18.config	Wed Oct 07 10:53:41 2015 +0200
     5.3 @@ -432,7 +432,7 @@
     5.4  #
     5.5  # CONFIG_ADD_SHELL is not set
     5.6  # CONFIG_REMOVE_SHELL is not set
     5.7 -CONFIG_FEATURE_SHADOWPASSWDS=y
     5.8 +# CONFIG_FEATURE_SHADOWPASSWDS is not set
     5.9  # CONFIG_USE_BB_PWD_GRP is not set
    5.10  # CONFIG_USE_BB_SHADOW is not set
    5.11  # CONFIG_USE_BB_CRYPT is not set
    5.12 @@ -457,7 +457,7 @@
    5.13  CONFIG_PASSWD=y
    5.14  # CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set
    5.15  # CONFIG_CRYPTPW is not set
    5.16 -# CONFIG_CHPASSWD is not set
    5.17 +CONFIG_CHPASSWD=y
    5.18  CONFIG_SU=y
    5.19  # CONFIG_FEATURE_SU_SYSLOG is not set
    5.20  # CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
     6.1 --- a/busybox/stuff/udhcp.script	Tue Oct 06 21:04:42 2015 +0200
     6.2 +++ b/busybox/stuff/udhcp.script	Wed Oct 07 10:53:41 2015 +0200
     6.3 @@ -9,13 +9,13 @@
     6.4  
     6.5  case "$1" in
     6.6  	deconfig)
     6.7 -		/sbin/ifconfig $interface 0.0.0.0
     6.8 +		ifconfig $interface 0.0.0.0
     6.9  		for i in /etc/ipdown.d/*; do
    6.10  			[ -x $i ] && $i $interface
    6.11  		done ;;
    6.12  
    6.13  	renew|bound)
    6.14 -		/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
    6.15 +		ifconfig $interface $ip $BROADCAST $NETMASK
    6.16  
    6.17  		if [ "$router" ] ; then
    6.18  			while route del default gw 0.0.0.0 dev $interface ; do
     7.1 --- a/hardware-ibm-6272/receipt	Tue Oct 06 21:04:42 2015 +0200
     7.2 +++ b/hardware-ibm-6272/receipt	Wed Oct 07 10:53:41 2015 +0200
     7.3 @@ -22,7 +22,7 @@
     7.4  	chmod +x $fs/etc/init.d/pnp.sh
     7.5  	cat >> $1/etc/init.d/pnp.sh <<EOT
     7.6  
     7.7 -echo -n "Switching on isa pnp ethernet card "
     7.8 +echo -n "Switching on cs89x0 isa pnp ethernet card "
     7.9  for io in \$(seq 360 -10 250); do for irq in IRQ_CS89X0_LIST; do
    7.10  pnpdump | awk "BEGIN {s=0} \\
    7.11  /CONFIGURE CSC6040/ {s=1} { \\
    7.12 @@ -49,6 +49,9 @@
    7.13  	done
    7.14  	sed -i "s/IRQ_CS89X0_LIST/${list:-15 12 11 10}/" $1/etc/init.d/pnp.sh
    7.15  	sed -i 's/cs89x0[^ "]* //' $1/etc/rcS.conf
    7.16 +	sed -i '/rm -f .sbin.*pnp/d' $1/etc/init.d/pnp.sh
    7.17 +	[ "$CS89X0_WIPEPNP" == "on" ] &&
    7.18 +	echo 'rm -f /sbin/pnpdump /sbin/isapnp' >> $1/etc/init.d/pnp.sh
    7.19  }
    7.20  
    7.21  config_form()
    7.22 @@ -60,5 +63,6 @@
    7.23  <td><input type="text" name="IRQ_CS89X0_LIST" value="${IRQ_LIST:-15 12 11 10 9 7 6 5 4 3}" /></td>
    7.24  </tr>
    7.25  </table>
    7.26 +<input type="checkbox" name="CS89X0_WIPEPNP" />Remove PNP binaries after use<br>
    7.27  EOT
    7.28  }
     8.1 --- a/linux/stuff/bootloader.S	Tue Oct 06 21:04:42 2015 +0200
     8.2 +++ b/linux/stuff/bootloader.S	Wed Oct 07 10:53:41 2015 +0200
     8.3 @@ -23,11 +23,12 @@
     8.4  #define EXE_CMDLINE		kernel >= 2.4
     8.5  // #define FLOPPY_CMDLINE	kernel >= 2.4
     8.6  // #define OLDCMDLINE		kernel  < 2.4
     8.7 +#define DISPLAY_VERSION		display version string
     8.8  #define MORETHAN16M		up to 4Gb RAM, not 16Mb
     8.9  #define KEYBOARDLESS_SUPPORT	scan floppy swap each 5 seconds
    8.10  // #define FAT12_SUPPORT	will format the floppy free space in FAT 12
    8.11 -// #define REALMODE_NOT_CHECKED	exe crash when started in vm86
    8.12 -// #define SINGLE_FLOPPY	Everytihng fit in a single floppy
    8.13 +// #define CHECK_REALMODE	exe dont crash when started in vm86
    8.14 +// #define SINGLE_FLOPPY	Everything fit in a single floppy
    8.15  // #define EDIT_CMDLINE
    8.16  // #define MOVE_CMDLINE
    8.17  #define INITRD_SUPPORT
    8.18 @@ -213,7 +214,9 @@
    8.19  heap_end_ptr	=	0x24
    8.20  	orw	$0x8020, type_of_loader(%si) # loader type = 0x20 = bootsect-loader
    8.21  	movb	$(stacktop-0x300)/256, heap_end_ptr+1(%si)
    8.22 +#ifdef DISPLAY_VERSION
    8.23  	call	puts_version		# show which kernel we are loading
    8.24 +#endif
    8.25  
    8.26  #ifdef	FLOPPY_CMDLINE
    8.27  # The cmdline can be entered and modifed at boot time.
    8.28 @@ -663,26 +666,30 @@
    8.29  	  movsb
    8.30  nocmdline:
    8.31  	xchgw	%ax, %di
    8.32 -# ifdef HELP
    8.33 +# if defined(HELP) && defined(DISPLAY_VERSION)
    8.34  	cmpb	$'?', -1(%si)
    8.35  	movw	$EXEADRS(0x200), %si
    8.36  	je	puts_version
    8.37 -#  ifndef REALMODE_NOT_CHECKED
    8.38 -	smsww	%ax
    8.39 -	andb	$1, %al
    8.40 -	jne	puts_version			// real mode only...
    8.41 -#  endif
    8.42  # endif
    8.43  #else
    8.44  	xchgw	%ax, %di
    8.45  #endif
    8.46 +#ifdef CHECK_REALMODE
    8.47 +	smsww	%ax
    8.48 +	andb	$1, %al
    8.49 +# if defined(HELP) && defined(DISPLAY_VERSION)
    8.50 +	jne	puts_version			// real mode only...
    8.51 +# else
    8.52 +	jne	dosexit				// real mode only...
    8.53 +# endif
    8.54 +#endif
    8.55  	movw	0x2C(%bx), %ds	// DOS 3.0+
    8.56  loop1:
    8.57  	incw	%bx
    8.58  	cmpw	%cx, (%bx)
    8.59  	jne	loop1
    8.60  	leaw	4(%bx), %dx 	// %ds:%dx filename
    8.61 -#if !defined(REALMODE_NOT_CHECKED) && defined(EXE_CMDLINE) && defined(HELP)
    8.62 +#if defined(CHECK_REALMODE)
    8.63  	movb	$0x3D, %ah	// open, access = RO
    8.64  #else
    8.65  	movw	$0x3D00, %ax	// open, access = RO
    8.66 @@ -711,8 +718,10 @@
    8.67  	lretw
    8.68  #endif
    8.69  #define kernel_version_offset	0xE
    8.70 +#ifdef DISPLAY_VERSION
    8.71  puts_version:
    8.72  	addw	kernel_version_offset(%si),%si	# starting protocol 2.00, Kernel 1.3.73
    8.73 +#endif
    8.74  puts:
    8.75  	movb	$0xd, %al		# CR
    8.76  putcs: