[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 15/24] Make libs/light build on NetBSD


  • To: Manuel Bouyer <bouyer@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 29 Dec 2020 15:15:50 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GVHJj19dWVAuBnTsgJ6Nmz9h3IFaTTl39INuK9zhZ9o=; b=TWpwoCHbWitUgHVv1x9prgNO75GBUUoMBb6rKoHu0yLFid1+VIadl0QfPunCe32Nia2dNVomYOZ0q4bjWOBsZ6ixcptjCTOCykFUgSqzdEk/Uk/2YV9y4cfS+IF4ZUuUzhQ4ZaVO36N9oQ9zCNSQ+0ZKYE536S2rR35rp3M9zfv5RBvKwgIf2nzJEdxoePaEztnKh6RvWV235LPxKX0FctfJS0/AShYzb+P4vnJlqHOv8mPpKTle0YN7achOdacqagxRe2wgBDIazCcXdTEGgyagEA0UDc96Sz49Ed544QcgHmtdfvFK1YE1botii/1nml2A6XBwOunfEbF97CQiqw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ekWAYmdZOHYmKO5uc0yvEdzRfb756zeUwVNYRdpb6E63kR7HuwKI32X7AFVBk9wF9+EBkpAJT/qa/wwAR83uWZrNG0y3ZP4fcPMr631FMoYyGMWGxQscrl0eqX9p5tlJxHHrhLDA7rXlnaFnjgiT+iU02mWkYGpcY9wXynufjULYbgDUcqsqa3UojXxwXBdt/5jzPmwAj1YHvvZ26gh8JJvS/iT4EPo7OKHnz6TeQYHECk9/W0iiMXAnJPAavSVpsdbBAoWf66vQ7NGeGSJge+QKXQudJyBdwdKw7wr+lOcO1h4idTzuKdQ3AH1/D73w3yOaGMfkmCPgFKsLb3gEjA==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 29 Dec 2020 14:16:12 +0000
  • Ironport-sdr: Gjgz+P4QsIl9Ux2nkn++NwvNmKZ/VvB3P7bKbA12hYBqwD3A26XJrHC6MvPtl5g0ARqXOZDX02 7mAJCvVPC6dFUnEGLPZoNx+6mzwpE/MiniGCYIIflGPlDIFSFzVhTjNzaLZpiuL+txexPG3Gcb zCeN9uNvxOca566vd3n9Jo+/bkrrIAt3/RfuY1Fcgvg3BpmwKJHKJNTMTehORv4wWO49pB/kJK ww4y1C0FFOZiVkyQUZJyL72SIfnD9SAFMf06THct17DtjFEGaobtpC3EzEgmeQsGtvS+zVG2xW GH0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Dec 14, 2020 at 05:36:14PM +0100, Manuel Bouyer wrote:
> ---
>  tools/libs/light/libxl_dm.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
> index 5948ace60d..c93bdf2cc9 100644
> --- a/tools/libs/light/libxl_dm.c
> +++ b/tools/libs/light/libxl_dm.c
> @@ -3659,6 +3659,14 @@ static int 
> kill_device_model_uid_child(libxl__destroy_devicemodel_state *ddms,
>  
>      LOGD(DEBUG, domid, "DM reaper: calling setresuid(%d, %d, 0)",

For correctness you should change this log message also on NetBSD.

>           reaper_uid, dm_kill_uid);
> +#ifdef __NetBSD__
> +    r = setuid(dm_kill_uid);
> +    if (r) {
> +        LOGED(ERROR, domid, "setuid to %d", dm_kill_uid);
> +        rc = rc ?: ERROR_FAIL;
> +        goto out;
> +    }
> +#else /* __NetBSD__ */
>      r = setresuid(reaper_uid, dm_kill_uid, 0);
>      if (r) {
>          LOGED(ERROR, domid, "setresuid to (%d, %d, 0)",
> @@ -3666,6 +3674,7 @@ static int 
> kill_device_model_uid_child(libxl__destroy_devicemodel_state *ddms,
>          rc = rc ?: ERROR_FAIL;
>          goto out;
>      }
> +#endif /* __NetBSD__ */

Instead of adding this NetBSD specific bodge here I would add a test
for setresuid in tools/configure.ac using AC_CHECK_FUNCS and use the
result from that. Then if/when NetBSD implements setresuid the switch
will be done transparently.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.