#!/bin/bash
#
# /usr/share/debian-edu-config/tools/password-fix-squeeze-r0
#
# Fix password expiring after 2 days (#664596) incorrectly introdiced
# in Debian Edu Squeeze up to r0; for new users the password will
# never expire. For existing users this will be the case after they've
# changed their password. Give old users the chance to change the
# password, exclude not affected accounts: templates and first user.
#
for i in $(getent passwd | egrep "home[0-9]" | egrep -v 'newteacher|newstudent|:1000:1000:' | cut -d: -f1) ; do
    kadmin.local -q "modprinc -pwexpire 7000days $i"
done
kadmin.local -q "modpol -maxlife 0secs users"
