• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7238: TWiki::Func::getRevisionInfo() may contaminate cUID-login mapping cache

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal Closed   patch 6.0.1

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

Environment

  • TWiki running on Apache HTTP server (or any CGI container)
  • User authentication is done by Apache HTTP server (or the CGI container) and the authenticated IDs are login names, lowercase alphanumeric string up to 8 characters long
  • A custom user mapping handler is used and canonical user IDs are login names preceded by "CM_"
  • login names to wikinames mapping is provided by the custom user mapping handler
  • Jane Smith's login name is janes, cUID CM_janes, wikiname JaneSmith
  • Solar.PlanetMercury was saved by Jane Smith a long time ago when cUIDs weren't there. It's recorded as JaneSmith's rather than CM_janes's

Symptom

TWiki::Func::getRevisionInfo('Solar', 'PlanetMercury') returns JaneSmith as the user who saved it. After that, TWiki::Func::wikiToLoginName('JaneSmith') returns a null string.

Background

Before canonical user IDs (cUIDs) were introduced, wikinames were like those and RCS operations were conducted under the name of wikinames. Meanwhile, TWiki::Store::getRevisionInfo() has been returning the user identity recorded in RCS as it is. As such, with a topic saved before the introduction of cUIDs and haven't updated since, TWiki::Store::getRevisionInfo() returns a wikiname instead of a cUID.

The cause of the problem

TWiki::Func::getRevision() calls TWiki::Store::getRevisionInfo() and then calls TWiki::Users::getWikiName() to convert the user identity to a wikiname. Because TWiki::Users::getWikiName() assumes cUID, if it's given a wikiname, it ends up contaminating the mapping cache between login names and wikinames.

How to fix it

Call TWiki::Func::getWikiName() instead of TWiki::Users:getWikiName().

-- TWiki:Main/HideyoImazu - 2013-04-23

Even though there is one check-in recorded here, as of 2014-10-05, {trunk,TWikiRelease06x00}/core/lib/TWiki/Func.pm are identical.

-- TWiki:Main.HideyoImazu - 2014-10-05

ItemTemplate
Summary TWiki::Func::getRevisionInfo() may contaminate cUID-login mapping cache
ReportedBy TWiki:Main.HideyoImazu
Codebase ~twiki4
SVN Range TWiki-5.1.3-trunk, Fri, 12 Apr 2013, build 25760
AppliesTo Engine
Component

Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:25823
TargetRelease patch
ReleasedIn 6.0.1
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r7 - 2014-10-06 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback