On 11/27/18 11:45 AM, Chuck Lever wrote: > Ping! My apologies for taking so long to get to this... I took an extended Thanksgiving then completely for got about it... Thanks for the ping... but :-) When I enable junctions via --enable-junction I get the following compile error with or w/out these patches gcc -DHAVE_CONFIG_H -I. -I../../support/include -I. -I../../support/include -D_GNU_SOURCE -pipe -Wall -Wextra -Werror=strict-prototypes -Werror=missing-prototypes -Werror=missing-declarations -Werror=format=2 -Werror=undef -Werror=missing-include-dirs -Werror=strict-aliasing=2 -Werror=init-self -Werror=implicit-function-declaration -Werror=return-type -Werror=switch -Werror=overflow -Werror=parentheses -Werror=aggregate-return -Werror=unused-result -fno-strict-aliasing -Werror=format-overflow=2 -Werror=int-conversion -Werror=incompatible-pointer-types -Werror=misleading-indentation -g -O2 -MT remove.o -MD -MP -MF .deps/remove.Tpo -c -o remove.o remove.c In file included from lookup.c:31: ../../support/include/rpcsvc/nfs_prot.h:9:10: fatal error: rpc/rpc.h: No such file or directory #include <rpc/rpc.h> ^~~~~~~~~~~ I know how to fix it... Add the following to CFLAGS and LDFLAGS `pkg-config --cflags libtirpc` `pkg-config --libs libtirpc` First I'm wonder how you got things to compile w/out making these changes and secondly I'm wondering where we should make these changes... Maybe we should hardcode the -I/usr/include/tirpc and -ltirpc flags in aclocal/libtirpc.m4? steved. > > >> On Oct 31, 2018, at 4:02 PM, Chuck Lever <chuck.lever@xxxxxxxxxx> wrote: >> >> CONFIG_JUNCTION was defined for use in Makefiles, but that does not >> provide a -DCONFIG_JUNCTION on the compiler command line. Add logic >> to configure.ac to get the compiler flags right. >> >> Now that mountd junction support is getting built, a few last minute >> porting bugs popped out. Fix those up. >> >> Reported-by: Yongcheng Yang <yoyang@xxxxxxxxxx> >> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1543126 >> Fixes: 79978ed34973 ("mountd: Solder in support for NFS basic ... ") >> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx> >> --- >> configure.ac | 8 +++++++- >> utils/mountd/cache.c | 18 +++++++++--------- >> 2 files changed, 16 insertions(+), 10 deletions(-) >> >> diff --git a/configure.ac b/configure.ac >> index 16eae06..b458891 100644 >> --- a/configure.ac >> +++ b/configure.ac >> @@ -185,7 +185,13 @@ AC_ARG_ENABLE(junction, >> [enable support for NFS junctions @<:@default=no@:>@])], >> enable_junction=$enableval, >> enable_junction=no) >> -AM_CONDITIONAL(CONFIG_JUNCTION, [test "$enable_junction" = "yes" ]) >> + if test "$enable_junction" = yes; then >> + AC_DEFINE(HAVE_JUNCTION_SUPPORT, 1, >> + [Define this if you want junction support compiled in]) >> + else >> + enable_junction= >> + fi >> + AM_CONDITIONAL(CONFIG_JUNCTION, [test "$enable_junction" = "yes" ]) >> >> AC_ARG_ENABLE(tirpc, >> [AC_HELP_STRING([--disable-tirpc], >> diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c >> index 6f42512..7e8d403 100644 >> --- a/utils/mountd/cache.c >> +++ b/utils/mountd/cache.c >> @@ -976,8 +976,9 @@ lookup_export(char *dom, char *path, struct addrinfo *ai) >> return found; >> } >> >> -#ifdef CONFIG_JUNCTION >> +#ifdef HAVE_JUNCTION_SUPPORT >> >> +#include <libxml/parser.h> >> #include "junction.h" >> >> struct nfs_fsloc_set { >> @@ -1084,8 +1085,7 @@ static bool locations_to_fslocdata(struct nfs_fsloc_set *locations, >> *ttl = 0; >> >> for (;;) { >> - enum jp_status status; >> - int len; >> + int len, status; >> >> status = get_next_location(locations, &server, >> &rootpath, ttl); >> @@ -1219,7 +1219,7 @@ nfs_get_basic_junction(const char *junct_path, struct nfs_fsloc_set **locset) >> return EINVAL; >> } >> >> - locset->ns_current = locset->ns_list; >> + new->ns_current = new->ns_list; >> new->ns_ttl = 300; >> *locset = new; >> return 0; >> @@ -1242,7 +1242,7 @@ static struct exportent *lookup_junction(char *dom, const char *pathname, >> status = nfs_get_basic_junction(pathname, &locations); >> switch (status) { >> xlog(L_WARNING, "Dangling junction %s: %s", >> - pathname, strerro(status)); >> + pathname, strerror(status)); >> goto out; >> } >> >> @@ -1252,8 +1252,8 @@ static struct exportent *lookup_junction(char *dom, const char *pathname, >> >> exp = locations_to_export(locations, pathname, parent); >> >> - nfs_free_locations(locset->ns_list); >> - free(locset); >> + nfs_free_locations(locations->ns_list); >> + free(locations); >> >> out: >> xmlCleanupParser(); >> @@ -1273,7 +1273,7 @@ static void lookup_nonexport(int f, char *buf, int buflen, char *dom, char *path >> free(eep); >> } >> >> -#else /* !CONFIG_JUNCTION */ >> +#else /* !HAVE_JUNCTION_SUPPORT */ >> >> static void lookup_nonexport(int f, char *buf, int buflen, char *dom, char *path, >> struct addrinfo *UNUSED(ai)) >> @@ -1281,7 +1281,7 @@ static void lookup_nonexport(int f, char *buf, int buflen, char *dom, char *path >> dump_to_cache(f, buf, buflen, dom, path, NULL, 0); >> } >> >> -#endif /* !CONFIG_JUNCTION */ >> +#endif /* !HAVE_JUNCTION_SUPPORT */ >> >> static void nfsd_export(int f) >> { >> > > -- > Chuck Lever > > >