Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(892)

Issue 75770044: Escape username and domain values to avoid SQL injection (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by JohnL
Modified:
11 years, 11 months ago
Reviewers:
brett.michael.johnson, Brett
CC:
connector-cr_google.com
Base URL:
http://google-enterprise-connector-dctm.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Escape username and domain values to avoid SQL injection in string concatenation (b/13399766, 2 of 2).

Patch Set 1 #

Total comments: 10

Patch Set 2 : Code review comments #

Patch Set 3 : Fixed a test failure I forgot to run #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M projects/dctm-core/source/javatests/com/google/enterprise/connector/dctm/DqlUtilsTest.java View 1 2 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 8
JohnL
11 years, 11 months ago (2014-03-14 05:59:09 UTC) #1
Brett
LGTM https://codereview.appspot.com/75770044/diff/1/projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java File projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java (right): https://codereview.appspot.com/75770044/diff/1/projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java#newcode150 projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java:150: queryBuff.append("' escape '\\"); I almost want to declare ...
11 years, 11 months ago (2014-03-14 07:36:26 UTC) #2
JohnL
11 years, 11 months ago (2014-03-14 08:28:20 UTC) #3
JohnL
Committed: https://code.google.com/p/google-enterprise-connector-dctm/source/detail?r=761 John L https://codereview.appspot.com/75770044/diff/1/projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java File projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java (right): https://codereview.appspot.com/75770044/diff/1/projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java#newcode150 projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java:150: queryBuff.append("' escape '\\"); On 2014/03/14 ...
11 years, 11 months ago (2014-03-14 08:30:08 UTC) #4
Brett
On 2014/03/14 08:30:08, John L wrote: > Committed: > https://code.google.com/p/google-enterprise-connector-dctm/source/detail?r=761 > > John L > ...
11 years, 11 months ago (2014-03-14 08:38:33 UTC) #5
Brett
On 2014/03/14 08:38:33, Brett wrote: > On 2014/03/14 08:30:08, John L wrote: > > Committed: ...
11 years, 11 months ago (2014-03-14 08:41:42 UTC) #6
JohnL
11 years, 11 months ago (2014-03-14 09:07:23 UTC) #7
JohnL
11 years, 11 months ago (2014-03-14 09:11:31 UTC) #8
Committed:
https://code.google.com/p/google-enterprise-connector-dctm/source/detail?r=762

On 2014/03/14 08:41:42, Brett wrote:
> On 2014/03/14 08:38:33, Brett wrote:
> > On 2014/03/14 08:30:08, John L wrote:
>
https://codereview.appspot.com/75770044/diff/1/projects/dctm-core/source/java...
> > >
> >
>
projects/dctm-core/source/javatests/com/google/enterprise/connector/dctm/DqlUtilsTest.java:72:
> > > String escaped = "'' \\\\ \\% \\_ \\\\'' \\\\\\\\ \\\\\\% \\\\\\_";
> > > On 2014/03/14 07:36:26, Brett wrote:
> > > > How many times did it take you to get the expected string right? or did
> you
> > > > cheat, then verify?
> > > 
> > > I typed them by hand, and got them all right on the first try. Not sure
> that's
> > a
> > > good use of luck or concentration.
> > 
> > Yeah. Luck or concentration - I applaud the late-night octo-whatever
> > backslashes.
> 
> In other words, if I believed you had a cat, I would also believe it walked
> across the keyboard and got that right.

"Got them all right", except quotedSlash, which I butchered and apparently
forgot to ever run.

John L
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b