Bug 1561

Summary: Check for up on open tap device
Product: Portable OpenSSH Reporter: Richard <richard.burakowski+ossh>
Component: sshdAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: normal CC: djm
Priority: P2    
Version: 5.1p1   
Hardware: Other   
OS: FreeBSD   
Bug Depends on:    
Bug Blocks: 1708    
Attachments:
Description Flags
check for open tun/tap device
none
/home/djm/sshd-tun-iff_up.diff dtucker: ok+

Description Richard 2009-02-24 07:32:39 AEDT
Created attachment 1606 [details]
check for open tun/tap device

Freebsd allows a non-root user to open a tap device (net.link.tap.user_open=1) at which point it can be marked up automatically (net.link.tap.up_on_open=1) so that root access is not required to get a functioning tap server side.

#ifdef SSH_TUN_FREEBSD version of sys_tun_open in openbsd-compat/port-tun.c dosen't allow for this.  It will successfully open a tap for non-root but will then attempt to IFF_UP which will fail.

Test if the interface is already marked up and leave alone if it is.

At this time, up on open is only available to tap devices.
Comment 1 Damien Miller 2010-08-10 04:30:12 AEST
Created attachment 1911 [details]
/home/djm/sshd-tun-iff_up.diff

Unified diff format against current
Comment 2 Damien Miller 2010-08-10 04:30:55 AEST
Comment on attachment 1911 [details]
/home/djm/sshd-tun-iff_up.diff

I think this can make release.
Comment 3 Damien Miller 2010-08-10 12:48:02 AEST
Patch applied. This will be in OpenSSH 5.6, due soon.
Comment 4 Darren Tucker 2010-08-27 10:28:07 AEST
With the release of OpenSSH 5.6p1 this bug is now considered closed.  If you have further problems please reopen or file a new bug as appropriate.