[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] libs/light: make it build without setresuid()
- To: George Dunlap <george.dunlap@xxxxxxxxxx>, Manuel Bouyer <bouyer@xxxxxxxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Mon, 18 Jan 2021 19:16:56 +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=gwMKGUN8vhdHzuu9gr067va/Oa2z+zyBU/lAsHaCxv0=; b=fcQImsSmMLAWtBWzTEJFcsYDrHBtiKsjB9t6Om5FfvFHlgVDMARUB3yWndRkRkYAOkxI1DTJp4AmVFrkXKa2dyH6425+57nLRev6/vYeE9NCub/qsn1UrjAvmBgOnefBwKcypFN/cicvk5HSNQPC2B4wlEzoHcbcAcS4molbbFUsGhXy4b45FPaqnz0/QuXPPB3h0JURkcC7A0OpiV04sn9i9w0G9GgI2KZAr5J/eSqVzTs24rCV/kbifmqrXmKlwt1DIenZPZ9mY66pkOW3KaxcaAVOvCMAwnsv3NiVM9QDXLFU5+frDCjARFDro/1MAGr0nnu9YBLUZ/YiLrOf4A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nvpRkVDubSePJxzMlxpSt8XQqaoMm7hNXy6NPeXQCeiBtuYRTYmHGQfAoHkT9205SMwKFbgOzMsaL+dcp/hJg1iz962vINSAEetFyTZhClUPi/b0nPeo1fOxuegfxq3Kajh+wLKlylls/2Fq8lTB5Q9R8IGo1EANG4kU8beVJfYCq45y6B4OSFcynk9cjO0UeKgPQ1jhhmW3g94i5E6bfE1vqDUEZCY8URq+rNOIM/fz5XQAPDJERMW0QPiqtBrvf1a+N8PtbWokeTvuXx7ySbDaRIPSkuXvSKtw7EILilDhqJYgjD/NK/SBebtl0fuSpOVO0vmnQAMq68XB1bDWyw==
- Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Manuel Bouyer <bouyer@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
- Delivery-date: Mon, 18 Jan 2021 18:17:21 +0000
- Ironport-sdr: qauVHwANAjmSBNHYwsUm0pALiuAg4RHiOzuzsQXp+6CXl61u7AXPeAZRFKa3x7XMYdmab29oUF t6AmSbEKBj4emDYP5frrX5raJIh+/SmbZ2uNgi+qCLl4LBCpmLaRFzVI32PDOLpw1cX4S7p3sL JXeUaTLXSFa5NUhiHxzUXsDwfyy609Y5LwNuuKKzlwaBLPaVP6BwQrDHxmIF5je+/EBFVy3uC6 enErWy6kEM/UX3YeBUuSHWOwMxVBcRClDKANfjE155BprxqqStpqL5x8WQKRCihFHofn+AQhYD PaE=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Tue, Jan 12, 2021 at 07:12:36PM +0100, Manuel Bouyer wrote:
> From: Manuel Bouyer <bouyer@xxxxxxxxxx>
>
> NetBSD doesn't have setresuid(). Add a configure check for it,
> and use plain setuid() if !HAVE_SETRESUID
>
> Signed-off-by: Manuel Bouyer <bouyer@xxxxxxxxxx>
LGTM from a code PoV, but I think George/Ian should take a look, since
they know exactly what this is supposed to do, and I would bet there
are some reasons why setresuid is used instead of setuid, which should
likely be taken into account in the commit message to justify why
using setuid in it's place it's fine.
> ---
> tools/configure | 13 +++++++++++++
> tools/configure.ac | 3 +++
> tools/libs/light/libxl_dm.c | 10 ++++++++++
> 3 files changed, 26 insertions(+)
>
> diff --git a/tools/configure b/tools/configure
> index 131112c41e..5e3793709e 100755
> --- a/tools/configure
> +++ b/tools/configure
> @@ -9299,6 +9299,19 @@ _ACEOF
>
> esac
>
> +# NetBSD doesnt have setresuid (yet)
> +for ac_func in setresuid
> +do :
> + ac_fn_c_check_func "$LINENO" "setresuid" "ac_cv_func_setresuid"
> +if test "x$ac_cv_func_setresuid" = xyes; then :
> + cat >>confdefs.h <<_ACEOF
> +#define HAVE_SETRESUID 1
> +_ACEOF
> +
> +fi
> +done
> +
We usually leave the changes to the generated configure script out of
the patch since it's usually a PITA to run the same autoconf version
in order to not generate tons of unrelated changes. You have managed
to run the same version, so I guess it's fine.
Just so that you know that you can ask commtters to re-run autoconf for
you by adding a note to the commit message to that effect.
Thanks, Roger.
|