rfcomm_sppd uses the deprecated pty(4) driver to implement its pseudo slave TTY mode (invoked by the '-t tty' option). This breaks on recent FreeBSD systems. In order to fix this I changed the code to use the openpty(3) API which uses the pts(4) driver instead of the pty(4) driver. The patch works fine for me, but there is one regression in functionality: The old code allowed the user to select the name of the pseudo terminal. This no longer works using the pts(4) driver, the name is always automatically selected by the pts(4) driver. But maybe I missed something here.
Update: - Close file descriptors if strdup(3) call fails
Thanks Tobias - it works beautifully. Please commit this fix as the current code is broken on FreeBSD >= 8. Thanks, Graham
Created attachment 145607 [details] rfcomm_sppd-to-pts-openpty.3.diff Another update to the patch. Print the name of the pts(4) to use on stdout. This way wrapper scripts/tools can easily pick it up.
A commit references this bug: Author: emax Date: Thu Oct 23 15:16:42 UTC 2014 New revision: 273548 URL: https://svnweb.freebsd.org/changeset/base/273548 Log: Change the code to use the openpty(3) API which uses the pts(4) driver instead of the pty(4) driver. PR: 184597 Submitted by: tobias.rehbein MFC after: 2 weeks Changes: head/usr.bin/bluetooth/rfcomm_sppd/Makefile head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1 head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
A commit references this bug: Author: emax Date: Thu Nov 6 16:32:01 UTC 2014 New revision: 274182 URL: https://svnweb.freebsd.org/changeset/base/274182 Log: MFC r273548 Change the code to use the openpty(3) API which uses the pts(4) driver instead of the pty(4) driver. PR: 184597 Submitted by: tobias.rehbein Changes: _U stable/10/ stable/10/usr.bin/bluetooth/rfcomm_sppd/Makefile stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1 stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
Committed as 273548.