After upgrading from 9.1 to 10.0-RELEASE, authpf does not work anymore. The SSH session is immediately terminated after login and the syslog contains the following error message "error removing stale rulesets" (apparently something in remove_stale_rulesets() goes wrong): root@freebsd:/var/log # tail -n 3 all.log Jan 29 16:30:13 freebsd sshd[1035]: Accepted keyboard-interactive/pam for test from 192.168.0.11 port 52213 ssh2 Jan 29 16:30:13 freebsd authpf[1039]: error removing stale rulesets Jan 29 16:30:13 freebsd sshd[1038]: Received disconnect from 192.168.0.11: 11: disconnected by user How-To-Repeat: I can reproduce the problem on a freshly installed system with the following minimal config (the same config works on both 9.1 and 9.2): echo 'pf_enable="YES"' >> /etc/rc.conf touch /etc/pf.conf /etc/rc.d/pf start mkdir /etc/authpf touch /etc/authpf/authpf.conf touch /etc/authpf/authpf.rules mount -t fdescfs null /dev/fd <create user "test"> echo /usr/sbin/authpf >> /etc/shells chsh -s authpf test <login as user "test" via SSH>
I just checked: The problem still exists on the 10.1-RC2.
batch change: For bugs that match the following - Status Is In progress AND - Untouched since 2018-01-01. AND - Affects Base System OR Documentation DO: Reset to open status. Note: I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Created attachment 219771 [details] patch for authpf.c
We also ran into this, I think the attached patch will solve the problem. I looks like the return value from ioctl DIOCGETRULESETS (and DIOCGETRULESET) changed in r240233. Should update manpage for pf also