From 60f040576ba63811b53541aec90761998286b95d Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Fri, 16 Feb 2018 14:03:41 +0200 Subject: [PATCH 1/3] makedirs with chown --- code/app.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/code/app.py b/code/app.py index 99866e8..370fbfb 100644 --- a/code/app.py +++ b/code/app.py @@ -310,8 +310,7 @@ def get_share(name, require_auth = True): "authenticated": authenticated }) if not os.path.exists(share['path']): - os.makedirs(share['path']) - set_rights(share['path']) + makedirs_rights(share['path']) return (True,share) def is_expired(share): @@ -326,6 +325,16 @@ def print_debug(s): sys.stderr.write(str(s)+"\n") sys.stderr.flush() +def makedirs_rights(path): + # os.makedirs with chown + path_list = path.split(os.sep) + for p in range(len(path_list)): + current_path = os.sep.join(path_list[0:(p+1)]) + if not os.path.exist(current_path): + os.mkdir(current_path) + set_rights(current_path) + + def set_rights(path): os.chown(path, app.config['UID'], app.config['GID']) st = os.stat(path) From 8c3cacf523c943b9233c714c8fff1f679074b7a4 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Fri, 16 Feb 2018 14:06:00 +0200 Subject: [PATCH 2/3] always the same typo --- code/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/app.py b/code/app.py index 370fbfb..cf1141c 100644 --- a/code/app.py +++ b/code/app.py @@ -330,7 +330,7 @@ def makedirs_rights(path): path_list = path.split(os.sep) for p in range(len(path_list)): current_path = os.sep.join(path_list[0:(p+1)]) - if not os.path.exist(current_path): + if not os.path.exists(current_path): os.mkdir(current_path) set_rights(current_path) From 1430477b146dc2d10050b37e9cd7b64ba568a5cc Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Fri, 16 Feb 2018 14:17:48 +0200 Subject: [PATCH 3/3] upload help for multifile --- utils/flees-manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/flees-manager.py b/utils/flees-manager.py index 39138a3..209e916 100755 --- a/utils/flees-manager.py +++ b/utils/flees-manager.py @@ -291,7 +291,7 @@ def print_rest_api(shares, config, opts): share['name'], share['pass_hash'] )) - print("or \n\n# curl -s %s/script/upload/%s/%s | bash /dev/stdin file_to_upload.ext"%( + print("or \n\n# curl -s %s/script/upload/%s/%s | bash /dev/stdin file_to_upload.ext [second.file.ext]"%( config['public_url'], share['name'], share['pass_hash']