Page MenuHomePhabricator

Detect if l10n_cache-<language code>.cdb is writable
Open, LowestPublic

Description

T127127 and T124027 both show the LocalisationCache code tries several instructions after the first failure in a write operation.

We should detect if the file is writeable, and throw directly an exception if not instead to let PHP call several filesystem functions.

Event Timeline

Dereckson raised the priority of this task from to Needs Triage.
Dereckson updated the task description. (Show Details)
Dereckson moved this task to Backlog on the MediaWiki-Internationalization board.
Dereckson added a subscriber: Dereckson.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptFeb 17 2016, 4:13 PM
Dereckson updated the task description. (Show Details)Feb 17 2016, 4:14 PM
Dereckson set Security to None.
Dereckson updated the task description. (Show Details)
Seb35 added a subscriber: Seb35.Sep 28 2018, 12:41 PM

I propose to close this task.

It was a subtask of T127127 in which, in 1.27.0 and 1.27.1, /tmp (or equivalent) was used as directory for CDB localisation files leading to conflicts on shared hosts. This default /tmp was reverted as insecure in T161453 (MW 1.27.2 or greater).

It is still possible to trigger this issue, but I would say it is intentionally because:

  • either you set $wgCacheDirectory to "/tmp" (a directory with +t Unix permission with multiple Unix users writing in it). I documented against it in https://www.mediawiki.org/wiki/Manual:$wgCacheDirectory,
  • either you set $wgLocalisationCacheConf['store'] to "files" or "array" without setting $wgCacheDirectory or $wgLocalisationCacheConf['storeDirectory']; in this case it tries to write files on the root directly / because the directory is is evaluated as an empty string.

The first case is now documented against, and the second is advanced configuration and I guess people would read documentation before changing this parameter. In any case there is an explicit exception saying it cannot be written.

Seb35 triaged this task as Lowest priority.Sep 28 2018, 12:41 PM