123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- #!/bin/sh
- . /etc/rc.d/PUPSTATE
- NEWUSER='fido'
- if [ $DISPLAY ];then
- export XDIALOG_HIGH_DIALOG_COMPAT=true
- DIALOGEXE="pupdialog"
- DIALOGEXE2="Xdialog"
- BACKGROUNDYELLOW='--background \#FFFF80'
- BACKGROUNDPINK='--background pink'
- BACKGROUNDORANGE='--background \#FFDC32'
- TITLEPARAM='--backtitle'
- else
- DIALOGEXE="dialog"
- DIALOGEXE2="dialog"
- TITLEPARAM='--title'
- BACKGROUNDYELLOW=''
- BACKGROUNDPINK=''
- BACKGROUNDORANGE=''
- fi
- busybox chown -h -R ${NEWUSER}:users /root
- busybox chmod g+s /root
- busybox chown -h -R spot:spot /root/spot
- case $PUPMODE in
- 2)
- echo
- ;;
- *)
- echo
- ;;
- esac
- userEXPR='s%autologin root %autologin fido %'
- sed -i -e "$userEXPR" /etc/inittab
- if [ -f /etc/minit/getty/1/params ];then
- EXPR2='s%^root$%fido%'
- sed -i -e "$EXPR2" /etc/minit/getty/1/params
- fi
- busybox chmod 770 /dev/zero
- busybox chmod 770 /dev/ptmx
- busybox chmod u+s `which ddcprobe`
- [ "`which Xvesa`" ] && busybox chmod u+s `which Xvesa`
- [ "`which Xorg`" ] && busybox chmod u+s `which Xorg`
- chgrp users /dev/console
- chmod g+w /dev/console
- busybox chmod u+s `which busybox`
- echo '[SUID]
- reboot = ssx root.0 # reboot can be run by anyone and runs with euid=0/egid=0
- poweroff = ssx root.0
- halt = ssx root.0
- su = ssx root.root
- # passwd = ssx root.root
- loadkmap = ssx root.root
- mount = ssx root.root
- umount = ssx root.root
- ps = ssx root.0
- kill = ssx root.0
- ' > /etc/busybox.conf
- ROOTPASSWORD="`${DIALOGEXE} ${BACKGROUNDYELLOW} ${TITLEPARAM} "First shutdown: ask admin password" --stdout --nocancel --inputbox "Please enter a password for the administrator (root), minimum six characters.\n\nLogin as fido does not require a password, so at bootup you will go directly to the desktop. This is also the case if you had chosen to run as administrator. However, having chosen the restricted fido user, you will be required to enter a password whenever you want to perform an operation that requires admin priviledges.\n\nPLEASE REMEMBER THIS PASSWORD" 0 0 ""`"
- echo "root:${ROOTPASSWORD}" | busybox chpasswd
- echo "fido:${ROOTPASSWORD}" | busybox chpasswd
|