chiark / gitweb /
authbind: get endianness right (again)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 11 Dec 2011 12:40:37 +0000 (12:40 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 11 Dec 2011 12:40:37 +0000 (12:40 +0000)
commit51b259535294bb46757a040596ab052e53f29483
treea7048c9fad7f9b53cb2f66fd6fb98235b39497dc
parent9ee89d429d8bb895daeb2cc5ddd21af5ce2ace2f
authbind: get endianness right (again)

It appears that:

 * authbind's documentation authbind-helper(8) describes the
   endianness convention of authbind's helper program incorrectly.
   See Debian #651694.

 * The version of secnet 0.1.16 tagged as such in revision control
   contains a "fix" which was based on the authbind documentation but
   not apparently tested against authbind.  Ie, this part from NEWS:
    4) Change the endianess of the arguments to authbind-helper.
       sprintf("%04X") already translates from machine repesentation to most
       significant octet first so htons reversed it again.

 * The version of secnet 0.1.16 actually in service on chiark had an
   out-of-version-control change to udp.c to make it work with
   chiark's authbind 1.2.0.  The actual code found has been recorded
   on the dead branch "chiark-0.1.16" in the master git repo, but the
   version of udp.c is exactly that from 0.1.15 so it looks like we
   just reverted to the previous udp.c during deployment of 0.1.16.

 * We (re)discovered all this after the release of secnet 0.2.0
   because my attempt to deploy 0.2.0 on chiark was not actually
   effective.

Therefore, undo the authbind endianness change introduced in secnet
0.1.16.  This is most easily achieved by constructing the arguments to
the helper from the sockaddr rather than the contents of "st".

Thanks are due to Simon Tatham for the bug report.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
udp.c