(The code in kde-current is substantially different, so this won't go in unchanged) - use konsole_grantpty to do the login/logout, so that only this program needs to be setgid utmp. - pass the ttyname to konsole_grantpty explicitly. - use openpty to get the ttyname in a simple way. - deactivate USE_LOGIN on OpenBSD, as login/logout must occur in grantpty.