public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH 0/8] Open socket and PID files as root, before switching
@ 2024-05-22 20:59 Stefano Brivio
  2024-05-22 20:59 ` [PATCH 1/8] conf: Don't lecture user about starting us as root Stefano Brivio
                   ` (7 more replies)
  0 siblings, 8 replies; 29+ messages in thread
From: Stefano Brivio @ 2024-05-22 20:59 UTC (permalink / raw)
  To: passt-dev; +Cc: David Gibson, 'Richard W . M . Jones', Minxi Hou

If libguestfs tools run as root, with the 'direct' backend (without
libvirt), we'll start as root as well.

As guest images might be owned by root, there are valid reasons to use
libguestfs tools as root, so be nice to them: open socket and PID
files *before* switching to nobody, so that we can still access their
paths.

Stefano Brivio (8):
  conf: Don't lecture user about starting us as root
  tap: Move all-ones initialisation of mac_guest to tap_sock_init()
  passt, tap: Don't use -1 as uninitialised value for fd_tap_listen
  tap: Split tap_sock_unix_init() into opening and listening parts
  util: Rename write_pidfile() to pidfile_write()
  passt, util: Move opening of PID file to its own function
  conf, passt, tap: Open socket and PID files before switching UID/GID
  conf, passt.h: Rename pid_file in struct ctx to pidfile

 conf.c  | 23 +++++++++++++++++++----
 passt.c | 17 ++++-------------
 passt.h |  8 ++++++--
 tap.c   | 57 +++++++++++++++++++++++++++++++++++----------------------
 tap.h   |  1 +
 util.c  | 28 +++++++++++++++++++++++++---
 util.h  |  3 ++-
 7 files changed, 92 insertions(+), 45 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2024-06-21  1:02 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-22 20:59 [PATCH 0/8] Open socket and PID files as root, before switching Stefano Brivio
2024-05-22 20:59 ` [PATCH 1/8] conf: Don't lecture user about starting us as root Stefano Brivio
2024-05-23  1:45   ` David Gibson
2024-05-23  9:52   ` Richard W.M. Jones
2024-05-22 20:59 ` [PATCH 2/8] tap: Move all-ones initialisation of mac_guest to tap_sock_init() Stefano Brivio
2024-05-23  1:46   ` David Gibson
2024-05-23  9:59   ` Richard W.M. Jones
2024-05-23 10:03     ` Richard W.M. Jones
2024-05-22 20:59 ` [PATCH 3/8] passt, tap: Don't use -1 as uninitialised value for fd_tap_listen Stefano Brivio
2024-05-23  1:48   ` David Gibson
2024-05-22 20:59 ` [PATCH 4/8] tap: Split tap_sock_unix_init() into opening and listening parts Stefano Brivio
2024-05-23 10:05   ` Richard W.M. Jones
2024-05-28  7:01   ` David Gibson
2024-05-22 20:59 ` [PATCH 5/8] util: Rename write_pidfile() to pidfile_write() Stefano Brivio
2024-05-23 10:06   ` Richard W.M. Jones
2024-05-22 20:59 ` [PATCH 6/8] passt, util: Move opening of PID file to its own function Stefano Brivio
2024-05-23 10:06   ` Richard W.M. Jones
2024-05-28  7:04   ` David Gibson
2024-05-22 20:59 ` [PATCH 7/8] conf, passt, tap: Open socket and PID files before switching UID/GID Stefano Brivio
2024-05-23 10:10   ` Richard W.M. Jones
2024-05-29  2:35   ` David Gibson
2024-06-20 11:30     ` Richard W.M. Jones
2024-06-20 12:12       ` Stefano Brivio
2024-06-20 12:47         ` Richard W.M. Jones
2024-06-20 14:22           ` Stefano Brivio
2024-06-21  1:02             ` David Gibson
2024-05-22 20:59 ` [PATCH 8/8] conf, passt.h: Rename pid_file in struct ctx to pidfile Stefano Brivio
2024-05-23 10:11   ` Richard W.M. Jones
2024-05-28  7:07   ` David Gibson

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).