Repair path traversal on cache_master function

This commit is contained in:
Thomas S Hatch 2011-10-06 23:10:18 -06:00
parent 7bd23ed78a
commit 77e79c5636
2 changed files with 12 additions and 12 deletions

View File

@ -379,19 +379,20 @@ class AESFuncs(object):
environment
'''
ret = []
if not self.opts['file_roots'].has_key('env'):
if not self.opts['file_roots'].has_key(load['env']):
return ret
for root, dirs, files in os.walk(self.opts['file_roots'][load[env]]):
for fn in files:
ret.append(
os.path.relpath(
os.path.join(
root,
fn
),
self.opts['file_roots'][load['env']]
for path in self.opts['file_roots'][load['env']]:
for root, dirs, files in os.walk(path):
for fn in files:
ret.append(
os.path.relpath(
os.path.join(
root,
fn
),
path
)
)
)
return ret
def _master_opts(self, load):

View File

@ -537,7 +537,6 @@ class FileClient(object):
'''
List the files on the master
'''
path = self._check_proto(path)
payload = {'enc': 'aes'}
load = {'env': env,
'cmd': '_file_list'}