mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Repair path traversal on cache_master function
This commit is contained in:
parent
7bd23ed78a
commit
77e79c5636
@ -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):
|
||||
|
@ -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'}
|
||||
|
Loading…
Reference in New Issue
Block a user