Skip to contentSkip to conversation

Simultaneous Access to Console Management

Openvpn-devel James Yonan 2 participants 2 messages Nov 4, 2005 – Nov 9, 2005 3 messages not in the archive

lore
Share & tools
lore
#3 lore raw
In reply to a message not in the archive
Quoted 10 lines · Samuel Tardieu
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"James" == James Yonan <[email protected]...> writes:

James> The management interface doesn't close the listening socket James> when it's connected to a client, because then it would need to James> reopen it after the client disconnects, and for various reasons James> this causes problems (especially when privileges have been James> dropped).

Can't you at least do a listen(fd,0) while a client is connected and revert to listen(fd,1) when the server is waiting?

[moving this thread to openvpn-devel]

Unfortunately that won't work. The second parameter to listen() is only a hint to the OS for advisory purposes. Setting it to zero does not appear to be a portable method of temporarily rejecting new connections.

Having said that, I don't particularly like the current behaviour. It would be nice if new connections would fail when a management client is already connected. The original version of the management interface closed the listening socket once a client connected and reopened it when the client disconnected. This was only changed to the current behavior when problems arose with the repeated closing and reopening of the listening socket.

James

#4 lore raw
Quoted 15 lines · James Yonan
Quoted 8 lines

James> The management interface doesn't close the listening socket James> when it's connected to a client, because then it would need to James> reopen it after the client disconnects, and for various reasons James> this causes problems (especially when privileges have been James> dropped).

Can't you at least do a listen(fd,0) while a client is connected and revert to listen(fd,1) when the server is waiting?

[moving this thread to openvpn-devel]

Unfortunately that won't work. The second parameter to listen() is only a hint to the OS for advisory purposes. Setting it to zero does not appear to be a portable method of temporarily rejecting new connections.

Quoted 7 lines

Having said that, I don't particularly like the current behaviour. It would be nice if new connections would fail when a management client is already connected. The original version of the management interface closed the listening socket once a client connected and reopened it when the client disconnected. This was only changed to the current behavior when problems arose with the repeated closing and reopening of the listening socket.

I may have missed part of the story (not reading [email protected]...), but how about accept()/close(), perhaps with an error message before the close()?

The client sees the message (if one is sent), "connection reset by peer" and that's it. It's not too polite, but if it's a "one administration client only" model, probably the most portable, and at least the client might have a clue about what is going on.

Signature · 1 line
Matthias Andree