------------------------------------------------------------ revno: 11720 revision-id: squid3@treenet.co.nz-20121130131830-w6wz6rrlwjtyfbcn parent: squid3@treenet.co.nz-20121130110455-q32hvtw0425j3mix committer: Amos Jeffries branch nick: 3.2 timestamp: Fri 2012-11-30 06:18:30 -0700 message: ntlm_fake_auth: Fix nesting error Broken macro wrapping leads to the fake authenticator sending bad responses to Squid. This can ead to users being rejected by the fake helper whose purpose is to accept everything. Detected by Coverity Scan. Issue 740394 ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20121130131830-w6wz6rrlwjtyfbcn # target_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_2 # testament_sha1: 675c621983613f8f1bed330d91b99573abe6cbff # timestamp: 2012-11-30 13:26:44 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_2 # base_revision_id: squid3@treenet.co.nz-20121130110455-\ # q32hvtw0425j3mix # # Begin patch === modified file 'helpers/ntlm_auth/fake/ntlm_fake_auth.cc' --- helpers/ntlm_auth/fake/ntlm_fake_auth.cc 2012-02-05 06:09:46 +0000 +++ helpers/ntlm_auth/fake/ntlm_fake_auth.cc 2012-11-30 13:18:30 +0000 @@ -86,14 +86,14 @@ #endif /* A couple of harmless helper macros */ -#define SEND(X) debug("sending '%s' to squid\n",X); printf(X "\n"); +#define SEND(X) {debug("sending '%s' to squid\n",X); printf(X "\n");} #ifdef __GNUC__ -#define SEND2(X,Y...) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y); -#define SEND4(X,Y...) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y); +#define SEND2(X,Y...) {debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);} +#define SEND4(X,Y...) {debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);} #else /* no gcc, no debugging. varargs macros are a gcc extension */ -#define SEND2(X,Y) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y); -#define SEND4(X,Y,Z,W) debug("sending '" X "' to squid\n",Y,Z,W); printf(X "\n",Y,Z,W); +#define SEND2(X,Y) {debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);} +#define SEND4(X,Y,Z,W) {debug("sending '" X "' to squid\n",Y,Z,W); printf(X "\n",Y,Z,W);} #endif const char *authenticate_ntlm_domain = "WORKGROUP";