Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] Re: Extended connect dialog (PR#977)
Home

[Freeciv-Dev] Re: Extended connect dialog (PR#977)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: dspeyer@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Extended connect dialog (PR#977)
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 16 Mar 2004 16:42:15 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=977 >

The method of local authorization is quite a hack.

The server needs to make sure it is the correct client connecting that 
it's going to give HACK authorization to.  So the server sends (over the 
network) the name of a local file.  The client creates this file and 
puts some auth info into it.  The client then sends this auth info to 
the server, which it verifies against the data in the file.

The question is: is there a better way?

On posix systems, the answer is clearly yes.  The client should call 
socketpair() to generate a pair of sockets before the fork; client and 
server each get one of the sockets.  It then takes just a few lines for 
the server to use this socket as the client's automatic connection. 
It's fast, secure, and elegant.  The only drawback is that win32 has no 
socketpair() function.  Is there a way to do this on windows?  (I surely 
hope so, since I need to do this for another project.)  Any win32 
developers know how it might be done?  Win32 has various methods of 
creating pipes, but we need to create a two-way socket that can be 
accessed via the normal file descriptor functions (read, write).

jason




[Prev in Thread] Current Thread [Next in Thread]