Revision 235a4227 snf-pithos-backend/pithos/backends/lib/sqlalchemy/permissions.py
b/snf-pithos-backend/pithos/backends/lib/sqlalchemy/permissions.py | ||
---|---|---|
38 | 38 |
from groups import Groups |
39 | 39 |
from public import Public |
40 | 40 |
|
41 |
from dbworker import ESCAPE_CHAR |
|
42 |
|
|
41 | 43 |
|
42 | 44 |
READ = 0 |
43 | 45 |
WRITE = 1 |
... | ... | |
172 | 174 |
s = select([self.xfeatures.c.path], from_obj=[inner_join]).distinct() |
173 | 175 |
if prefix: |
174 | 176 |
s = s.where(self.xfeatures.c.path.like( |
175 |
self.escape_like(prefix) + '%', escape='\\')) |
|
177 |
self.escape_like(prefix) + '%', escape=ESCAPE_CHAR |
|
178 |
)) |
|
176 | 179 |
r = self.conn.execute(s) |
177 | 180 |
l = [row[0] for row in r.fetchall()] |
178 | 181 |
r.close() |
... | ... | |
182 | 185 |
"""Return the list of shared paths.""" |
183 | 186 |
|
184 | 187 |
s = select([self.xfeatures.c.path], |
185 |
self.xfeatures.c.path.like(self.escape_like(prefix) + '%', escape='\\')).order_by(self.xfeatures.c.path.asc()) |
|
188 |
self.xfeatures.c.path.like(self.escape_like(prefix) + '%', |
|
189 |
escape=ESCAPE_CHAR |
|
190 |
) |
|
191 |
).order_by(self.xfeatures.c.path.asc()) |
|
186 | 192 |
r = self.conn.execute(s) |
187 | 193 |
l = [row[0] for row in r.fetchall()] |
188 | 194 |
r.close() |
Also available in: Unified diff