On Tue, Jan 12, 2021 at 07:12:36PM +0100, Manuel Bouyer wrote: > From: Manuel Bouyer <bou...@netbsd.org> > > NetBSD doesn't have setresuid(). Add a configure check for it, > and use plain setuid() if !HAVE_SETRESUID > > Signed-off-by: Manuel Bouyer <bou...@netbsd.org>
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.