[BUG] libassuan's (HEAD) assuan-domain-connect.c fails on systems with 4.3BSD sockets

Nicholas Wourms nwourms at netscape.net
Tue Feb 24 10:47:03 CET 2004


[I tried filing this on gnupg's gnats, but everytime I hit submit, it 
gave me a "malformed multipart POST"]

SYSTEM:
CYGWIN_NT-5.0 1.5.8(0.116/4/2) 2004-02-19 18:59 i686 unknown unknown Cygwin

Before I describe the problem, I might note that this isn't unique to 
Cygwin.  This is going to cause problems on Solaris =< 2.6, Unixware < 
2.1, older  versions of IRIX, and some older versions of AIX (basically 
anything using BSD4.3 sockets).

The source will not compile on these platforms due to two issues. 
First, the cmsghdr structure and related macros are not present. 
Second, the msghdr structure found on these platforms is not fully 
compatible with the newer versions since:
A)It lacks the msg_flags member
B)The msg_control & msg_controllen members are called msg_accrights &
   msg_accrightslen

Suggested fix:
As has been done by other opensource projects, the code should be 
adapted to support 4.3BSD-style sockets using an autoconf test.  I do 
not have the expertise to do this, but I can point to a source which 
others have used in the past.

Examples of sending and receiving fd's in this manner can be found in
the samples from Steven's APUE:
http://www.cs.auc.dk/~bnielsen/Tricks/apue/lib.sun/sendfd.c
http://www.cs.auc.dk/~bnielsen/Tricks/apue/lib.sun/recvfd.c

Some examples from projects which have addressed this issue:
BIND: http://idsa.irisa.fr/cgi-bin/bind/http/source/lib/isc/unix/socket.c
OpenSSH (portable): http://www.eviladmin.org/cvs/cvsweb.cgi/monitor_fdpass.c

Since libassuan will become a requirement in future versions of gnupg, I 
think it would be worthwile to fix this.

Cheers,
Nicholas

P.S. - I'm not subscribed, so please CC: me in any replies.




More information about the Gnupg-devel mailing list