diff --git a/agent/unixsocketagent.go b/agent/unixsocketagent.go index d1c6033..e80924c 100644 --- a/agent/unixsocketagent.go +++ b/agent/unixsocketagent.go @@ -139,6 +139,8 @@ func serveAgentSession(c net.Conn, vault *vault.Vault, cfg *config.Config) { payload := messages.PinentryRegistrationResponse{ Success: pinnentrySetError == nil, } + log.Info("Pinentry registration success: %t", payload.Success) + responsePayload, err := messages.IPCMessageFromPayload(payload) if err != nil { writeError(c, err) diff --git a/gui/src/linux/main.py b/gui/src/linux/main.py index f04500d..15e90fd 100644 --- a/gui/src/linux/main.py +++ b/gui/src/linux/main.py @@ -6,6 +6,7 @@ from .monitors import dbus_autofill_monitor from .monitors import dbus_monitor import sys from src.services import goldwarden +from src.services import pinentry from threading import Thread import os import secrets @@ -36,6 +37,7 @@ def main(): # start daemons dbus_autofill_monitor.run_daemon(token) # todo: remove after migration dbus_monitor.run_daemon(token) + pinentry.daemonize() if not "--hidden" in sys.argv: p = subprocess.Popen(["python3", "-m", "src.gui.settings"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, cwd=root_path, start_new_session=True) diff --git a/gui/src/services/goldwarden.py b/gui/src/services/goldwarden.py index 1d2eded..4937412 100644 --- a/gui/src/services/goldwarden.py +++ b/gui/src/services/goldwarden.py @@ -175,7 +175,7 @@ def run_daemon(token): daemon_env = os.environ.copy() daemon_env["GOLDWARDEN_DAEMON_AUTH_TOKEN"] = token - print("starting goldwarden daemon", BINARY_PATH, token) + print("starting goldwarden daemon", BINARY_PATH) # print while running result = subprocess.Popen([f"{BINARY_PATH}", "daemonize"], stdout=subprocess.PIPE, text=True, env=daemon_env) diff --git a/gui/src/services/pinentry.py b/gui/src/services/pinentry.py index 47946cc..b8920f0 100644 --- a/gui/src/services/pinentry.py +++ b/gui/src/services/pinentry.py @@ -1,11 +1,13 @@ import subprocess import os -from gui.src.services import goldwarden +from src.services import goldwarden +from threading import Thread +import time root_path = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir)) def get_pin(message): - p = subprocess.Popen(["python3", "-m", "src.ui.pinentry"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=root_path, start_new_session=True) + p = subprocess.Popen(["python3", "-m", "src.gui.pinentry"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=root_path, start_new_session=True) p.stdin.write(f"{message}\n".encode()) p.stdin.flush() pin = p.stdout.readline().decode().strip() @@ -14,7 +16,7 @@ def get_pin(message): return pin def get_approval(message): - p = subprocess.Popen(["python3", "-m", "src.ui.pinentry_approval"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, cwd=root_path, start_new_session=True) + p = subprocess.Popen(["python3", "-m", "src.gui.pinentry_approval"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, cwd=root_path, start_new_session=True) p.stdin.write(f"{message}\n".encode()) p.stdin.flush() result = p.stdout.readline().decode().strip() @@ -25,4 +27,8 @@ def get_approval(message): def daemon(): goldwarden.listen_for_pinentry(get_pin, get_approval) -daemon() \ No newline at end of file +def daemonize(): + #todo fix this + time.sleep(3) + thread = Thread(target=daemon) + thread.start() \ No newline at end of file