From bbb8921591e2b5fa299eb7b1fad96bda5a2a762b Mon Sep 17 00:00:00 2001 From: "anthony.boulmier" <anthony.boulmier@hesge.ch> Date: Tue, 20 Sep 2016 09:47:04 +0200 Subject: [PATCH] security update --- TP1/soap/soap-client.py | 2 +- TP1/soap/soap-server.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/TP1/soap/soap-client.py b/TP1/soap/soap-client.py index b3ea35e..d470f3c 100644 --- a/TP1/soap/soap-client.py +++ b/TP1/soap/soap-client.py @@ -4,7 +4,7 @@ import pprint import os # put here your own ip -SERVER_URL = 'http://127.0.0.1:8123' +SERVER_URL = 'http://gw-hepiacloud.hesge.ch:10005' if __name__ == '__main__': parser = argparse.ArgumentParser(description='Simple SOAP FTP client') diff --git a/TP1/soap/soap-server.py b/TP1/soap/soap-server.py index c43384a..177b3ad 100644 --- a/TP1/soap/soap-server.py +++ b/TP1/soap/soap-server.py @@ -1,6 +1,7 @@ import SOAPpy import sys import argparse +import re from os.path import expanduser, join, isdir, abspath from os import listdir @@ -8,6 +9,7 @@ main_directory = None def list(relative_directory): global main_directory + relative_directory = re.sub('\.+', '.', relative_directory) target_directory = join(main_directory, relative_directory) if relative_directory != '.' else main_directory dirs = listdir(target_directory) s = [d for d in dirs if isdir(d)] @@ -16,12 +18,14 @@ def list(relative_directory): def get(relative_path): global main_directory + relative_path = re.sub('\.+', '.', relative_path) with open(join(main_directory,relative_path), 'r') as f: data = f.read() return (main_directory, relative_path, data) def put(relative_path, data): global main_directory + relative_path = re.sub('\.+', '.', relative_path) new_file = join(main_directory, relative_path) try: with open(new_file, 'w+') as f: -- GitLab