shlomi-noach / openarkkit

Automatically exported from code.google.com/p/openarkkit
24 stars 16 forks source link

oak-security-audit --defaults-file=~~myuser/.my.oak.cnf --audit-level=strict #38

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run this oak-security-audit --defaults-file=~myuser/.my.oak.cnf 
--audit-level=strict
2. exits with this error 'users.user' isn't in GROUP BY at the Looking for 
accounts with identical (non empty) passwords
3. On percona 5.6 server

What is the expected output? What do you see instead?
Get to this:
-- Looking for accounts with identical (non empty) passwords
-- ---------------------------------------------------------
'users.user' isn't in GROUP BY

What version of the product are you using? On what operating system?
downloaded version 1.0.5 but that was not displayed in the --help info.
Ubuntu wheezy (64 bit)

Please provide any additional information below.

Original issue reported on code.google.com by eona...@gmail.com on 13 Aug 2014 at 6:53

GoogleCodeExporter commented 9 years ago
This is the query that it barfs on!
cursor.execute("SELECT CONCAT('''', user, '''@''', host, '''' ) AS account, 
pass FROM (SELECT user1.user, user1.host, user2.user AS u2, user2.host AS h2, 
left(user1.password,5) as pass FROM mysql.user AS user1 INNER JOIN mysql.user 
AS user2 ON (user1.password = user2.password) WHERE user1.user != user2.user 
AND user1.password != '') users GROUP BY (CONCAT(user,'@',host)) ORDER BY pass")

Original comment by eona...@gmail.com on 13 Aug 2014 at 6:55

GoogleCodeExporter commented 9 years ago
So my perl translates into python! changed this:
  GROUP BY (CONCAT(user,'@',host))
to this:
  GROUP BY account,pass
Now on to the next query!

Original comment by eona...@gmail.com on 13 Aug 2014 at 7:07

GoogleCodeExporter commented 9 years ago
ARG! it is my sql_mode that is causing the problem. I removed 
ONLY_FULL_GROUP_BY. I suddenly thought to check my sql_mode. 

Original comment by eona...@gmail.com on 13 Aug 2014 at 7:23