------------------------------------------------------------ revno: 12400 revision-id: squid3@treenet.co.nz-20121124021327-9eddvqdqx29rbr9h parent: squid3@treenet.co.nz-20121124021226-irs63csluyy4eh5f committer: Amos Jeffries branch nick: 3.3 timestamp: Fri 2012-11-23 19:13:27 -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-20121124021327-9eddvqdqx29rbr9h # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: bd0918e95463e6103c8a59c6a69206fbd46a2e67 # timestamp: 2012-11-24 02:14:43 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20121124021226-\ # irs63csluyy4eh5f # # Begin patch === modified file 'helpers/ntlm_auth/fake/ntlm_fake_auth.cc' --- helpers/ntlm_auth/fake/ntlm_fake_auth.cc 2012-09-01 14:38:36 +0000 +++ helpers/ntlm_auth/fake/ntlm_fake_auth.cc 2012-11-24 02:13:27 +0000 @@ -84,14 +84,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";