Commit 7ee111fc authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Merge branch 'hotfix-0.14.5' into develop

Conflicts:
	snf-pithos-backend/pithos/backends/modular.py
	version
parents 1e71af55 2f1bdd0b
......@@ -6,6 +6,18 @@ Unified Changelog file for Synnefo versions >= 0.13
Since v0.13 most of the Synnefo components have been merged into a single
repository and have aligned versions.
.. _Changelog-0.14.5:
v0.14.5
=======
Released: Wed Aug 7 11:19:49 EEST 2013
Pithos
------
* Fix security issue with handling Pithos versions.
.. _Changelog-0.14.4:
......
......@@ -5,6 +5,17 @@ Unified NEWS file for Synnefo versions >= 0.13
Since v0.13 all Synnefo components have been merged into a single repository.
.. _NEWS-0.14.5:
v0.14.5
=======
Released: Wed Aug 7 11:19:49 EEST 2013
Pithos
------
* Bug fix version
.. _NEWS-0.14.4:
v0.14.4
......
......@@ -1809,6 +1809,7 @@ Changelog, NEWS
===============
* v0.14.4 :ref:`Changelog <Changelog-0.14.5>`, :ref:`NEWS <NEWS-0.14.5>`
* v0.14.4 :ref:`Changelog <Changelog-0.14.4>`, :ref:`NEWS <NEWS-0.14.4>`
* v0.14.3 :ref:`Changelog <Changelog-0.14.3>`, :ref:`NEWS <NEWS-0.14.3>`
* v0.14.2 :ref:`Changelog <Changelog-0.14.2>`, :ref:`NEWS <NEWS-0.14.2>`
......
......@@ -787,7 +787,8 @@ class Node(DBWorker):
r.close()
return (tuple(row.values()) for row in rproxy)
def version_get_properties(self, serial, keys=(), propnames=_propnames):
def version_get_properties(self, serial, keys=(), propnames=_propnames,
node=None):
"""Return a sequence of values for the properties of
the version specified by serial and the keys, in the order given.
If keys is empty, return all properties in the order
......@@ -800,6 +801,8 @@ class Node(DBWorker):
v.c.size, v.c.type, v.c.source,
v.c.mtime, v.c.muser, v.c.uuid,
v.c.checksum, v.c.cluster], v.c.serial == serial)
if node is not None:
s = s.where(v.c.node == node)
rp = self.conn.execute(s)
r = rp.fetchone()
rp.close()
......
......@@ -651,7 +651,8 @@ class Node(DBWorker):
self.execute(q, args)
return self.fetchall()
def version_get_properties(self, serial, keys=(), propnames=_propnames):
def version_get_properties(self, serial, keys=(), propnames=_propnames,
node=None):
"""Return a sequence of values for the properties of
the version specified by serial and the keys, in the order given.
If keys is empty, return all properties in the order
......@@ -662,8 +663,12 @@ class Node(DBWorker):
q = ("select serial, node, hash, size, type, source, mtime, muser, "
"uuid, checksum, cluster "
"from versions "
"where serial = ?")
self.execute(q, (serial,))
"where serial = ? ")
args = [serial]
if node is not None:
q += ("and node = ?")
args += [node]
self.execute(q, args)
r = self.fetchone()
if r is None:
return r
......
......@@ -1368,9 +1368,7 @@ class ModularBackend(BaseBackend):
version = int(version)
except ValueError:
raise VersionNotExists('Version does not exist')
props = self.node.version_get_properties(version)
if props is not None and node != props[self.NODE]:
raise NotAllowedError('Version does not belong to this path')
props = self.node.version_get_properties(version, node=node)
if props is None or props[self.CLUSTER] == CLUSTER_DELETED:
raise VersionNotExists('Version does not exist')
return props
......
# This is a comment!
0.14.4next
0.14.5next
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment