mirror of https://github.com/n1nj4sec/pupy.git
Fix path parts in value substitutions
This commit is contained in:
parent
f16f65b66f
commit
2a228b03e1
|
@ -6,6 +6,7 @@ except ImportError:
|
||||||
|
|
||||||
from os import path, makedirs
|
from os import path, makedirs
|
||||||
from netaddr import IPAddress
|
from netaddr import IPAddress
|
||||||
|
import platform
|
||||||
|
|
||||||
class PupyConfig(ConfigParser):
|
class PupyConfig(ConfigParser):
|
||||||
def __init__(self, config='pupy.conf'):
|
def __init__(self, config='pupy.conf'):
|
||||||
|
@ -36,6 +37,9 @@ class PupyConfig(ConfigParser):
|
||||||
retfolder = path.join(self.user_root, folder)
|
retfolder = path.join(self.user_root, folder)
|
||||||
|
|
||||||
for key, value in substitutions.iteritems():
|
for key, value in substitutions.iteritems():
|
||||||
|
value = value.replace('/', '_').replace('..', '_')
|
||||||
|
if platform.system == 'Windows':
|
||||||
|
value = value.replace(':', '_')
|
||||||
retfolder = retfolder.replace(key, value)
|
retfolder = retfolder.replace(key, value)
|
||||||
|
|
||||||
if path.isdir(retfolder):
|
if path.isdir(retfolder):
|
||||||
|
|
Loading…
Reference in New Issue