diff --git a/src/filepass/filepass.py b/src/filepass/filepass.py index e923ec1..ec8e3a3 100644 --- a/src/filepass/filepass.py +++ b/src/filepass/filepass.py @@ -1,4 +1,5 @@ import sys +from urllib.parse import quote import fs import fs.ftpfs @@ -28,8 +29,8 @@ def sftp_connection(logger, conn_details: ConnectionDetails): ) fs_conn = fs.open_fs( "sftp://{}:{}@{}:{}{}".format( - conn_details.user, - conn_details.password, + quote(conn_details.user), + quote(conn_details.password), conn_details.server, conn_details.port, conn_details.dir, @@ -57,8 +58,8 @@ def smb_connection(logger, conn_details: ConnectionDetails): ) fs_conn = fs.open_fs( "smb://{}:{}@{}:{}/{}?direct-tcp=True&name-port=139&timeout=15&domain=".format( - conn_details.user, - conn_details.password, + quote(conn_details.user), + quote(conn_details.password), conn_details.server, conn_details.port, conn_details.share + conn_details.dir,