fixed wrong permissions on directory creation

This commit is contained in:
Marco Pfomann
2016-05-31 16:09:21 +02:00
parent ee8483f83e
commit 69ceef6782

View File

@@ -87,17 +87,20 @@ else:
domain = http.client.HTTPConnection(konachan) domain = http.client.HTTPConnection(konachan)
# chdir in $path and create directory if it not exists # chdir in $path and create directory if it not exists
dir_tags = tags.replace(":", "_")
if not os.path.isdir(path.rstrip()): if not os.path.isdir(path.rstrip()):
os.makedirs(path.rstrip(), 0o755, True) os.makedirs(path.rstrip(), 0o755, True)
os.chdir(path.rstrip()) os.chdir(path.rstrip())
if safemode == "yes": if safemode == "yes":
if not os.path.isdir("Safemode: Tags: " + tags): if not os.path.isdir("Safemode Tags " + dir_tags):
os.makedirs("Safemode: Tags: " + tags, 0o7555, True) os.makedirs("Safemode Tags " + dir_tags, 0o755, True)
os.chdir("Safemode: Tags: " + tags) os.chdir("Safemode Tags " + dir_tags)
else: else:
if not os.path.isdir("Tags: " + tags): if not os.path.isdir("Tags " + dir_tags):
os.makedirs("Tags: " + tags, 0o755, True) os.makedirs("Tags " + dir_tags, 0o755, True)
os.chdir("Tags: " + tags) os.chdir("Tags " + dir_tags)
# creating directory for pics # creating directory for pics