From d93cc906d4a2f42d11629e245fb13a2d08cf2a61 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 4 Dec 2008 16:56:56 -0800 Subject: Pad CreateAC packets with 0 auths to workaround xfs bug Versions of xfs before commit 3fe28a31a2974287acc182c7c9bfd68d94ea6292 will reject CreateAC packets with 0 auths unless they claim to have at least 4 bytes of authentication data that isn't actually read. --- src/fc/fserve.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/fc/fserve.c b/src/fc/fserve.c index fd1bd53..07ada34 100644 --- a/src/fc/fserve.c +++ b/src/fc/fserve.c @@ -2602,6 +2602,7 @@ _fs_client_access (FSFpePtr conn, pointer client, Bool sync) char *authorizations; int authlen; Bool new_cur = FALSE; + char padding[4] = { 0, 0, 0, 0 }; #ifdef DEBUG if (conn->blockState & (FS_RECONNECTING|FS_BROKEN_CONNECTION)) @@ -2647,7 +2648,14 @@ _fs_client_access (FSFpePtr conn, pointer client, Bool sync) crac.reqType = FS_CreateAC; crac.num_auths = set_font_authorizations(&authorizations, &authlen, client); - authlen = crac.num_auths ? (authlen + 3) & ~0x3 : 0; + /* Work around bug in xfs versions up through modular release 1.0.8 + which rejects CreateAC packets with num_auths = 0 & authlen < 4 */ + if (crac.num_auths == 0) { + authorizations = padding; + authlen = 4; + } else { + authlen = (authlen + 3) & ~0x3; + } crac.length = (sizeof (fsCreateACReq) + authlen) >> 2; crac.acid = cur->acid; _fs_add_req_log(conn, FS_CreateAC); -- cgit v1.2.3