Page MenuHomePhabricator

Anons who block themselves do not seem to appear in the Blocklist.
Closed, ResolvedPublic

Description

Author: nickpj

Description:
I have given anons permission to block people (LocalSettings contains:
$wgGroupPermissions['*']['block'] = true;)

So as an anon, I tried blocking myself (by IP address) for 2 hours.

This worked. So then I logged in to my named account, with the intention of
unblocking my IP address.

What I would expect at Special:Ipblocklist is to see the blocked IP address in
the list. However, it says "The blocklist is empty".

Bypassing mediawiki and going to the db layer shows this is not the case:

mysql> select * from ipblocks;
+--------+-------------+----------+--------+------------+----------------+----------+---------------+--------------------+----------------+-----------------+---------------+

ipb_idipb_addressipb_useripb_byipb_reasonipb_timestamp

ipb_auto | ipb_anon_only | ipb_create_account | ipb_expiry | ipb_range_start

ipb_range_end

+--------+-------------+----------+--------+------------+----------------+----------+---------------+--------------------+----------------+-----------------+---------------+

1192.168.0.20020060714044007
0 |             0 |                  1 | 20060714064007 |                 |  
          |

+--------+-------------+----------+--------+------------+----------------+----------+---------------+--------------------+----------------+-----------------+---------------+
1 row in set (0.00 sec)

Then when I try to edit as an the anon, I get this message:
" Your user name or IP address has been blocked. The block was made by
[[User:|]]. The reason given is ' "

Is this normal? Doesn't a limited time block still appear in the blocklist? It
seems to work as expected provided the block is done by a named account, but
seems to get its knickers in a twist when the blocking is done by an anon.


Version: 1.8.x
Severity: minor

Details

Reference
bz6678

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:20 PM
bzimport set Reference to bz6678.
bzimport added a subscriber: Unknown Object (MLST).

Don't do that, it will break if you ask the software to do
impossible things.

nickpj wrote:

Patch for the impossible

IPBlocklistPager::getQueryInfo() uses a join between the 'user' and 'ipblocks'
tables. In the case of a block made by an anon, there will be no corresponding
user row, hence the block still exists, is still enforced, but just is not
visible on Special:Ipblocklist. With this it is listed, but by user "unknown",
since the person who did the blocking is unknown by Special:Ipblocklist.

Attached:

Fixed some time ago with the advent of ipb_by_text.