2010-03-13 23:25:19 +08:00
|
|
|
post_install() {
|
2011-03-08 04:40:22 +08:00
|
|
|
[ -f var/log/lastlog ] || : >var/log/lastlog
|
|
|
|
[ -f var/log/wtmp ] || : >var/log/wtmp
|
|
|
|
[ -f var/run/utmp ] || : >var/run/utmp
|
2011-04-12 11:30:41 +08:00
|
|
|
chown root:20 var/run/utmp
|
|
|
|
chmod 664 var/run/utmp
|
2011-03-08 04:40:22 +08:00
|
|
|
[ -f var/log/btmp ] || (: >var/log/btmp && bin/chmod 600 var/log/btmp)
|
|
|
|
# workaround for bug #7194
|
|
|
|
# readded due to bug #9465
|
|
|
|
# please do not remove!
|
|
|
|
bin/chmod 1777 var/spool/mail tmp var/tmp var/lock
|
|
|
|
}
|
|
|
|
|
|
|
|
# args: <group> [options]
|
|
|
|
_addgroup() {
|
|
|
|
if ! bin/grep -q "^$1:" etc/group; then
|
|
|
|
usr/sbin/groupadd ${@} >/dev/null
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# args: <group> [options]
|
|
|
|
_adduser() {
|
|
|
|
if ! bin/grep -q "^$1:" etc/passwd; then
|
|
|
|
usr/sbin/useradd ${@} >/dev/null
|
|
|
|
fi
|
2010-03-13 23:25:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
post_upgrade() {
|
2011-03-08 04:40:22 +08:00
|
|
|
post_install
|
|
|
|
|
|
|
|
_addgroup cdemu -g 103
|
|
|
|
_addgroup optical -g 93
|
|
|
|
_addgroup audio -g 92
|
|
|
|
_addgroup video -g 91
|
|
|
|
_addgroup floppy -g 94
|
|
|
|
_addgroup storage -g 95
|
|
|
|
_addgroup log -g 19
|
2011-04-12 11:30:41 +08:00
|
|
|
_addgroup utmp -g 20
|
2011-03-08 04:40:22 +08:00
|
|
|
_addgroup power -g 98
|
|
|
|
_addgroup network -g 90
|
|
|
|
_addgroup games -g 50
|
|
|
|
_addgroup uucp -g 14
|
|
|
|
_addgroup http -g 33
|
|
|
|
_adduser http -u 33 -d /srv/http -g http -s /bin/false http
|
|
|
|
_addgroup scanner -g 96
|
|
|
|
_addgroup rfkill -g 24
|
|
|
|
|
|
|
|
# sync gshadow to group (fixes FS#19869
|
|
|
|
if ! bin/grep -q '^rfkill:' etc/gshadow; then
|
|
|
|
usr/sbin/grpconv >/dev/null
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! bin/grep -q '^include /etc/ld.so.conf.d/\*.conf$' etc/ld.so.conf; then
|
|
|
|
bin/echo 'include /etc/ld.so.conf.d/*.conf' >> etc/ld.so.conf
|
|
|
|
fi
|
2010-03-13 23:25:19 +08:00
|
|
|
|
2011-03-08 04:40:22 +08:00
|
|
|
# set "Last password change" > 0; otherwise su $user wont work
|
|
|
|
for user in bin daemon mail ftp http nobody; do
|
|
|
|
if LANG=C usr/bin/chage -l ${user} | bin/grep -q 'password must be changed'; then
|
|
|
|
usr/bin/chage -d 14871 ${user}
|
|
|
|
fi
|
|
|
|
done
|
2010-03-13 23:25:19 +08:00
|
|
|
}
|