Skip to content

Commit

Permalink
Protect against stale share permissions (Bug #14259).
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Feb 19, 2016
1 parent fa1002d commit 53a4e7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions framework/Share/lib/Horde/Share/Sql.php
Expand Up @@ -307,7 +307,9 @@ protected function _listAllShares()
throw new Horde_Share_Exception($e);
}
foreach ($rows as $row) {
$shares[$row['share_id']]['perm']['users'][$row['user_uid']] = $this->_buildPermsFromRow($row);
if (isset($shares[$row['share_id']])) {
$shares[$row['share_id']]['perm']['users'][$row['user_uid']] = $this->_buildPermsFromRow($row);
}
}

// Get groups permissions
Expand All @@ -317,7 +319,9 @@ protected function _listAllShares()
throw new Horde_Share_Exception($e->getMessage());
}
foreach ($rows as $row) {
$shares[$row['share_id']]['perm']['groups'][$row['group_uid']] = $this->_buildPermsFromRow($row);
if (isset($shares[$row['share_id']])) {
$shares[$row['share_id']]['perm']['groups'][$row['group_uid']] = $this->_buildPermsFromRow($row);
}
}

$sharelist = array();
Expand Down
4 changes: 2 additions & 2 deletions framework/Share/package.xml
Expand Up @@ -34,7 +34,7 @@ owns or has access to.</description>
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [jan] Protect against certain share tables corruption (Bug #14259).
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -1027,7 +1027,7 @@ Initial release as a PEAR package
<date>2016-02-02</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [jan] Protect against certain share tables corruption (Bug #14259).
</notes>
</release>
</changelog>
Expand Down

0 comments on commit 53a4e7c

Please sign in to comment.