diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-12-04 16:56:56 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-12-04 16:56:56 -0800 |
commit | d93cc906d4a2f42d11629e245fb13a2d08cf2a61 (patch) | |
tree | 0387a2d923fae61e326d11ea06f5e7e30995393d /src/fc | |
parent | f859a76b0f325b07952ad1c5c818318307c589b0 (diff) |
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.
Diffstat (limited to 'src/fc')
-rw-r--r-- | src/fc/fserve.c | 10 |
1 files changed, 9 insertions, 1 deletions
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); |