--- /home/lav/work/build/BUILD/submount-0.9/submountd-0.9/configure.ac 2005-02-20 17:24:46 +0300 +++ submountd-0.9/configure.ac 2005-02-20 15:46:30 +0300 @@ -37,6 +37,15 @@ fi AC_SUBST(LIB_RESMGR) +# Checks for libnatspec. +check_natspec="" +AC_CHECK_LIB([natspec], [main], check_natspec=true) +if test ! "x$check_natspec" == x ; then +NATSPEC_LIBS=-lnatspec +AC_SUBST(NATSPEC_LIBS) +AC_DEFINE(HAVE_natspec,1,[Define if you have the natspec library]) +fi + AC_PREFIX_DEFAULT(/) AC_CONFIG_FILES([Makefile]) AC_OUTPUT --- /home/lav/work/build/BUILD/submount-0.9/submountd-0.9/Makefile.am 2005-02-20 17:24:46 +0300 +++ submountd-0.9/Makefile.am 2005-02-20 15:49:35 +0300 @@ -2,7 +2,7 @@ sbin_PROGRAMS = submountd net-submountd submountd_SOURCES = submountd.c mount_guess_fstype.c -submountd_LDADD = $(LIB_RESMGR) +submountd_LDADD = $(LIB_RESMGR) $(NATSPEC_LIBS) net_submountd_SOURCES = net-submountd.c man_MANS = submount.8 --- /home/lav/work/build/BUILD/submount-0.9/submountd-0.9/submountd.c 2005-02-20 17:24:46 +0300 +++ submountd-0.9/submountd.c 2005-02-20 15:56:00 +0300 @@ -40,6 +40,10 @@ #include #endif +#ifdef HAVE_natspec +#include +#endif + #include "submountd.h" @@ -163,6 +167,9 @@ unsigned long flags, char *options) { int retval; +#ifdef HAVE_natspec + char *mount_opts; +#endif #if USE_RESMGR struct passwd *pwd; int uid = 0; @@ -190,7 +197,15 @@ } } #endif + +#ifndef HAVE_natspec retval = mount(device, mountpoint, fstype, flags, options); +#else + mount_opts = strdup(options); + natspec_enrich_fs_options(fstype, &mount_opts); + retval = mount(device, mountpoint, fstype, flags, mount_opts); + free(mount_opts); +#endif if (retval) { if ((errno == EROFS) && (!(flags & MS_RDONLY))) {