Skip to content

Commit

Permalink
Fixed critical file locking error in del method. Tried to lock file t…
Browse files Browse the repository at this point in the history
…wice instead of locking and releasing.

Signed-off-by: Michael Wilmes <mwilmes@wilminator.com>
  • Loading branch information
Michael Wilmes committed Sep 10, 2015
1 parent 2808564 commit 5f59334
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
# attribute # attribute
Arbitrary attribute definition and storage for user associated data. Arbitrary attribute definition and storage for user associated data.


See detail on: (I hope) https://www.dokuwiki.org/plugin:attribute See detail on: https://www.dokuwiki.org/plugin:attribute
5 changes: 2 additions & 3 deletions helper.php
Expand Up @@ -21,7 +21,7 @@ public function __construct() {
$this->loadConfig(); $this->loadConfig();
// Create the path used for attribute data. // Create the path used for attribute data.
$path = substr($this->conf['store'], 0, 1) == '/' ? $this->conf['store'] : DOKU_INC . $this->conf['store']; $path = substr($this->conf['store'], 0, 1) == '/' ? $this->conf['store'] : DOKU_INC . $this->conf['store'];
$this->storepath = ($this->conf['store'] === '' || !is_dir($path)) ? null : $path; $this->storepath = ($this->conf['store'] === '' || !io_mkdir_p($path)) ? null : $path;
// A directory is needed. // A directory is needed.
if(is_null($this->storepath)) { if(is_null($this->storepath)) {
msg("Attribute: Configuration item 'store' is not set to a writeable directory.", -1); msg("Attribute: Configuration item 'store' is not set to a writeable directory.", -1);
Expand Down Expand Up @@ -395,8 +395,7 @@ public function del($namespace, $attribute, $user = null) {
$result = false; $result = false;
} }


$lock = $namespace . '.' . $user; io_unlock($lock);
io_lock($lock);


return $result; return $result;
} }
Expand Down
4 changes: 2 additions & 2 deletions plugin.info.txt
Expand Up @@ -4,10 +4,10 @@ author Michael Wilmes


email mwilmes@avc.edu email mwilmes@avc.edu


date 2015-09-03 date 2015-09-10


name attribute plugin name attribute plugin


desc Arbitrary attribute definition and storage for user associated data. desc Arbitrary attribute definition and storage for user associated data.


url None at this time, would like https://www.dokuwiki.org/plugin:attribute url https://www.dokuwiki.org/plugin:attribute

0 comments on commit 5f59334

Please sign in to comment.