Page MenuHomePhabricator

AntiSpoof confused by users differing only in capitalisation (mysql case-insensitivity)
Closed, ResolvedPublic

Description

Author: overlordq

Description:
Say there's an existing user named Sriniw8z in the wiki. This get's normalized to: v2:5R1N1W8Z

Say this user has been gone for many many years so you override AntiSpoof to create a user named:

SRINIW8Z, which also gets normalized into v2:5R1N1W8Z.

Now in the spoofusers table, you'd expect to see both entries?

However in MySQL's case insenitive nature, it clobbers the old entry since the query in batchRecord uses a replace call, and you just get the second one listed. This throws off later AntiSpoof checks as they'll only show one similar user, instead of multiple.

Seems to work as intended with PG, I dont know if this is an artifact of the old DB style WMF uses, I dont have a new UTF-8 MySQL to test on.


Version: unspecified
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:35 PM
bzimport added a project: AntiSpoof.
bzimport set Reference to bz18447.
bzimport added a subscriber: Unknown Object (MLST).

Updated summary to vaguely reflect the problem.

Umherirrender edited subscribers, added: Umherirrender; removed: wikibugs-l-list.

The database field spoofuser.su_name should be made binary to be equal to the field user.user_name and behaviour correctly when the database collation not defaults to binary

Change 945669 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/AntiSpoof@master] schema: Make spoofuser.su_name binary

https://gerrit.wikimedia.org/r/945669

Change 945669 merged by jenkins-bot:

[mediawiki/extensions/AntiSpoof@master] schema: Make spoofuser.su_name binary

https://gerrit.wikimedia.org/r/945669