Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
salt.5686
add-clean_id-function-to-salt.utils.verify.py.p...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File add-clean_id-function-to-salt.utils.verify.py.patch of Package salt.5686
From 2c5837efa3d5f30279cd6e3fc4b277994e639a82 Mon Sep 17 00:00:00 2001 From: Ch3LL <megan.wilhite@gmail.com> Date: Mon, 31 Jul 2017 11:50:21 -0400 Subject: [PATCH] Add clean_id function to salt.utils.verify.py --- salt/utils/verify.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/salt/utils/verify.py b/salt/utils/verify.py index 5e320c3..db513ba 100644 --- a/salt/utils/verify.py +++ b/salt/utils/verify.py @@ -481,12 +481,21 @@ def clean_path(root, path, subdir=False): return '' +def clean_id(id_): + ''' + Returns if the passed id is clean. + ''' + if re.search(r'\.\.{sep}'.format(sep=os.sep), id_): + return False + return True + + def valid_id(opts, id_): ''' Returns if the passed id is valid ''' try: - return bool(clean_path(opts['pki_dir'], id_)) + return bool(clean_path(opts['pki_dir'], id_)) and clean_id(id_) except (AttributeError, KeyError) as e: return False -- 2.10.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor