Tags:
create new tag
view all tags

Bug: Unlock button makes URL with unlocking as side effect

If you start editing a page, and then cancel that edit, the result is a browser window visiting a URL ending in ?unlock=on. This URL will (perhaps unexpectedly) unlock the page at any time in the future when visited.

Test case

Start editing a page. Select `Cancel'. Note that the URL in the browser URL box ends in `?unlock=on'. Bookmark this URL (as if you hadn't noticed the bug). Once more, start editing the page and leave that browser window open on the edit page. In a second browser window, select the previously created bookmark entry. Observe that a second user can now edit the page, as it is unlocked.

Environment

TWiki version: TWikiRelease01Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin, many more
Server OS: Debian GNU/Linux 3.0 i386
Web server: Apache/1.3.26 (Unix) Debian GNU/Linux
Perl version: v5.6.1 built for i386-linux
Client OS: Debian GNU/Linux 3.1 i386
Web Browser: Mozilla 1.6 (Debian mozilla 1.6-5)

-- IanJackson - 23 Nov 2004

Follow up

Perhaps the value to the unlock parameter should be the timestamp of the lock?

-- SamHasler - 26 Nov 2004

Alternatively, we modified setLock so that it will only let you break your own lock:

    if( $lock ) {
        my $lockTime = time();
        $self->_saveFile( $lockFilename, "$userName\n$lockTime" );    
    } else {
#       Check to see if $username matches username stored in lockfile.
        my $tmp = TWiki::Store::readFile( $lockFilename );
        my( $lockUser, $lockTime ) = split( /\n/, $tmp );

        if ($lockUser eq $userName) {
            unlink "$lockFilename";    
        }
    }

-- RobertoHoyle - 01 Feb 2006

Fix record

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2006-02-01 - RobertoHoyle
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.