tools/nss/libvirt_nss.c | 6 +++--- tools/nss/libvirt_nss.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
When switching to meson, some of HAVE_* macros were renamed to
WITH_ because they did not reflect whether the build platform has
or doesn't have something, but whether we are building with some
functionality turned on or off. This is the case with
HAVE_BSD_NSS macro too. As a result, the NSS plugin built on BSD
did not expose nss_module_register() function which made the
plugin unusable:
https://www.redhat.com/archives/libvir-list/2020-September/msg00000.html
Fixes: c74268705557a6781788ba011492c15df2e3df11
Reported-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
tools/nss/libvirt_nss.c | 6 +++---
tools/nss/libvirt_nss.h | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/nss/libvirt_nss.c b/tools/nss/libvirt_nss.c
index 3b89f72742..6331c65131 100644
--- a/tools/nss/libvirt_nss.c
+++ b/tools/nss/libvirt_nss.c
@@ -37,7 +37,7 @@
#include <time.h>
-#if defined(HAVE_BSD_NSS)
+#if defined(WITH_BSD_NSS)
# include <nsswitch.h>
#endif
@@ -451,7 +451,7 @@ NSS_NAME(gethostbyname4)(const char *name, struct gaih_addrtuple **pat,
}
#endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */
-#if defined(HAVE_BSD_NSS)
+#if defined(WITH_BSD_NSS)
NSS_METHOD_PROTOTYPE(_nss_compat_getaddrinfo);
NSS_METHOD_PROTOTYPE(_nss_compat_gethostbyname2_r);
@@ -598,4 +598,4 @@ nss_module_register(const char *name __attribute__((unused)),
*unregister = NULL;
return methods;
}
-#endif /* HAVE_BSD_NSS */
+#endif /* WITH_BSD_NSS */
diff --git a/tools/nss/libvirt_nss.h b/tools/nss/libvirt_nss.h
index 95ebafdc71..121b9e8722 100644
--- a/tools/nss/libvirt_nss.h
+++ b/tools/nss/libvirt_nss.h
@@ -84,8 +84,8 @@ NSS_NAME(gethostbyname4)(const char *name, struct gaih_addrtuple **pat,
int *herrnop, int32_t *ttlp);
#endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */
-#if defined(HAVE_BSD_NSS)
+#if defined(WITH_BSD_NSS)
ns_mtab*
nss_module_register(const char *name, unsigned int *size,
nss_module_unregister_fn *unregister);
-#endif /* HAVE_BSD_NSS */
+#endif /* WITH_BSD_NSS */
--
2.26.2
On Tue, Sep 01, 2020 at 11:26:58AM +0200, Michal Privoznik wrote: > When switching to meson, some of HAVE_* macros were renamed to > WITH_ because they did not reflect whether the build platform has > or doesn't have something, but whether we are building with some > functionality turned on or off. This is the case with > HAVE_BSD_NSS macro too. As a result, the NSS plugin built on BSD > did not expose nss_module_register() function which made the > plugin unusable: I've always thought the whole HAVE_ vs WITH_ distinction is a pretty arbitrary and unhelpful part of autoconf. Given this stat: $ git grep WITH_ | grep meson | wc -l 261 $ git grep HAVE_ | grep meson | wc -l 31 I think we should try to eliminate 100% of using of HAVE_ so that all our conditionals use WITH_ Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
On 9/1/20 11:42 AM, Daniel P. Berrangé wrote: > On Tue, Sep 01, 2020 at 11:26:58AM +0200, Michal Privoznik wrote: >> When switching to meson, some of HAVE_* macros were renamed to >> WITH_ because they did not reflect whether the build platform has >> or doesn't have something, but whether we are building with some >> functionality turned on or off. This is the case with >> HAVE_BSD_NSS macro too. As a result, the NSS plugin built on BSD >> did not expose nss_module_register() function which made the >> plugin unusable: > > I've always thought the whole HAVE_ vs WITH_ distinction is a pretty > arbitrary and unhelpful part of autoconf. > > Given this stat: > > $ git grep WITH_ | grep meson | wc -l > 261 > $ git grep HAVE_ | grep meson | wc -l > 31 > > I think we should try to eliminate 100% of using of HAVE_ so that all our > conditionals use WITH_ > I'm up for this. Let me see if I can write a patch for that. Michal
On Tue, Sep 01, 2020 at 11:26:58 +0200, Michal Privoznik wrote: > When switching to meson, some of HAVE_* macros were renamed to > WITH_ because they did not reflect whether the build platform has > or doesn't have something, but whether we are building with some > functionality turned on or off. This is the case with > HAVE_BSD_NSS macro too. As a result, the NSS plugin built on BSD > did not expose nss_module_register() function which made the > plugin unusable: > > https://www.redhat.com/archives/libvir-list/2020-September/msg00000.html > > Fixes: c74268705557a6781788ba011492c15df2e3df11 > Reported-by: Roman Bogorodskiy <bogorodskiy@gmail.com> > Signed-off-by: Michal Privoznik <mprivozn@redhat.com> > --- > tools/nss/libvirt_nss.c | 6 +++--- > tools/nss/libvirt_nss.h | 4 ++-- > 2 files changed, 5 insertions(+), 5 deletions(-) Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Michal Privoznik wrote: > When switching to meson, some of HAVE_* macros were renamed to > WITH_ because they did not reflect whether the build platform has > or doesn't have something, but whether we are building with some > functionality turned on or off. This is the case with > HAVE_BSD_NSS macro too. As a result, the NSS plugin built on BSD > did not expose nss_module_register() function which made the > plugin unusable: > > https://www.redhat.com/archives/libvir-list/2020-September/msg00000.html > > Fixes: c74268705557a6781788ba011492c15df2e3df11 > Reported-by: Roman Bogorodskiy <bogorodskiy@gmail.com> > Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com> > --- > tools/nss/libvirt_nss.c | 6 +++--- > tools/nss/libvirt_nss.h | 4 ++-- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/tools/nss/libvirt_nss.c b/tools/nss/libvirt_nss.c > index 3b89f72742..6331c65131 100644 > --- a/tools/nss/libvirt_nss.c > +++ b/tools/nss/libvirt_nss.c > @@ -37,7 +37,7 @@ > #include <time.h> > > > -#if defined(HAVE_BSD_NSS) > +#if defined(WITH_BSD_NSS) > # include <nsswitch.h> > #endif > > @@ -451,7 +451,7 @@ NSS_NAME(gethostbyname4)(const char *name, struct gaih_addrtuple **pat, > } > #endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */ > > -#if defined(HAVE_BSD_NSS) > +#if defined(WITH_BSD_NSS) > NSS_METHOD_PROTOTYPE(_nss_compat_getaddrinfo); > NSS_METHOD_PROTOTYPE(_nss_compat_gethostbyname2_r); > > @@ -598,4 +598,4 @@ nss_module_register(const char *name __attribute__((unused)), > *unregister = NULL; > return methods; > } > -#endif /* HAVE_BSD_NSS */ > +#endif /* WITH_BSD_NSS */ > diff --git a/tools/nss/libvirt_nss.h b/tools/nss/libvirt_nss.h > index 95ebafdc71..121b9e8722 100644 > --- a/tools/nss/libvirt_nss.h > +++ b/tools/nss/libvirt_nss.h > @@ -84,8 +84,8 @@ NSS_NAME(gethostbyname4)(const char *name, struct gaih_addrtuple **pat, > int *herrnop, int32_t *ttlp); > #endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */ > > -#if defined(HAVE_BSD_NSS) > +#if defined(WITH_BSD_NSS) > ns_mtab* > nss_module_register(const char *name, unsigned int *size, > nss_module_unregister_fn *unregister); > -#endif /* HAVE_BSD_NSS */ > +#endif /* WITH_BSD_NSS */ > -- > 2.26.2 > Roman Bogorodskiy
© 2016 - 2024 Red Hat, Inc.