NetworkManager/src/core/nm-sudo-call.h
Thomas Haller de5dddccbe
core: get file descriptor to ovsdb unix socket from nm-sudo
To talk to ovsdb, we use the unix socket at
/var/run/openvswitch/db.sock. But that socket is owned by another user
and NetworkManager would need dac_override capability to open it.

We want to drop dac_override, but we still need to talk to ovsdb. Add a
GetFD() method to nm-sudo.

We still first try to open the socket directly. Maybe it just works.

Note that SELinux may block passing file descriptors from nm-sudo. If it
doesn't work for you, test with SELinux permissive mode and wait for an
SELinux update.
2021-07-26 15:31:46 +02:00

15 lines
507 B
C

/* SPDX-License-Identifier: LGPL-2.1-or-later */
#ifndef __NM_SUDO_CALL_H__
#define __NM_SUDO_CALL_H__
#include "libnm-base/nm-sudo-utils.h"
typedef void (*NMSudoCallGetFDCallback)(int fd_take, GError *error, gpointer user_data);
void nm_sudo_call_get_fd(NMSudoGetFDType fd_type,
GCancellable * cancellable,
NMSudoCallGetFDCallback callback,
gpointer user_data);
#endif /* __NM_SUDO_CALL_H__ */