Commit graph

3 commits

Author SHA1 Message Date
Beniamino Galvani
bb0d29a8f1 libnm: add function to copy a certificate or key as user
Add a new public function nm_utils_copy_cert_as_user() to libnm. It
reads a certificate or key file on behalf of the given user and writes
it to a directory in /run/NetworkManager. It is useful for VPN plugins
that run as root and need to verify that the user owning the
connection (the one listed in the connection.permissions property) can
access the file.

(cherry picked from commit 1a52bbe7c9)
(cherry picked from commit 3d85bace3d)
(cherry picked from commit 4587832735)
2025-12-12 13:35:39 +01:00
Beniamino Galvani
5ad3a752b9 daemon-helper: add read-file-as-user
Add a new command to read the content of a file after switching to the
given user. This command can be used to enforce Unix filesystem
permissions when accessing a file on behalf of a user.

(cherry picked from commit 285457a5f8)
(cherry picked from commit 022b992846)
(cherry picked from commit 310887be71)
2025-12-10 11:26:22 +01:00
Beniamino Galvani
4074f9e2c6 helpers: move helper programs to the same directory
Create a new 'nm-helpers' directory for all the helper programs, to
avoid having too many subdirs in the src directory.

(cherry picked from commit 3d76d12eee)
(cherry picked from commit afa6fc951b)
(cherry picked from commit d1776c5394)
2025-12-10 11:26:22 +01:00