GNOME Bugzilla – Bug 783707
[RFE] lr/systemd-ask-password: utilize the systemd-ask-password protocol for connection secrets
Last modified: 2020-11-12 14:27:15 UTC
There's no way to request secrets for a connection during early boot or on servers. systemd-ask-password provides a way to ask for a single password which might be sufficient in most cases. A PoC branch asks for a single secret from systemd-ask-password as if it were a secret agent: https://cgit.freedesktop.org/NetworkManager/NetworkManager/?h=lr/systemd-ask-password An alternative solution would be to implement a secret agent that would forward the requests to systemd-ask-password. The downside would be that a D-Bus or private connection would be needed. On the other hand we could avoid adding complexity to the server.
>> nm-agent: add NMAgent interface for secret agents indentation is wrong at several places. - req->current_call_id = nm_secret_agent_get_secrets (req->current, + req->current_call_id = nm_agent_get_secrets (req->current, req->con.path, tmp, - req->current_call_id = nm_secret_agent_save_secrets (req->current, + req->current_call_id = nm_agent_save_secrets (req->current, req->con.path, indentation +1 for adding tooltip to new fields. It's not clear (to me) what "Domains" is. Rest lgtm. Nice!!
(In reply to Thomas Haller from comment #1) > >> nm-agent: add NMAgent interface for secret agents > > +1 for adding tooltip to new fields. It's not clear (to me) what "Domains" is. oh, wrong bug :) Was intended for rh#1457542
why does request_start() use link() instead of rename()? request_start() can leak @tmpname. Why not gs_free (inside the while loop)? request_start() handles error from nm_utils_fd_set_contents() wrong. nm_utils_fd_set_contents() doesn't properly handle lenght==-1. If you fix that, request_start() could just pass -1 as length. + if (secs) + req->timeout_id = g_timeout_add_seconds (secs, request_timeout, req); the name "secs" is not great... timeout_s would be better. Anyway, it seems you can disable timeout by setting it to zero. However + if (clock_gettime (CLOCK_MONOTONIC, &tp) == 0) + tp.tv_sec += secs; doesn't consider whether the timeout is disabled. + "NotAfter=%ld%ld\n" + getpid (), req->sockname, tp.tv_sec, tp.tv_nsec / 1000, the timeout is wrong. Should be (tp.tv_sec * 10000000 + tp.tv_nsec / 1000).
(In reply to Thomas Haller from comment #3) > why does request_start() use link() instead of rename()? ignore that, I figured it out myself
request_start(): + tmpname = g_strdup (RUNSTATEDIR "/systemd/ask-password/tmp.XXXXXX"); char tmpname[] = RUNSTATEDIR "/systemd/ask-password/tmp.XXXXXX"; sizeof (RUNSTATEDIR "/systemd/ask-password/") - 1 NM_STRLEN()? leaks @error. gs_free_error.
bugzilla.gnome.org is being shut down in favor of a GitLab instance. We are closing all old bug reports and feature requests in GNOME Bugzilla which have not seen updates for a long time. If you still use NetworkManager and if you still see this bug / want this feature in a recent and supported version of NetworkManager, then please feel free to report it at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/ Thank you for creating this report and we are sorry it could not be implemented (workforce and time is unfortunately limited).