# Check for some functions
AC_CHECK_LIB(pthread, main)
AC_CHECK_FUNCS(pthread_atfork)
+AC_CHECK_FUNCS(statvfs)
AC_CHECK_LIB(util, openpty)
AC_CHECK_FUNCS([openpty hasmntopt setmntent endmntent utmpxname])
AC_CHECK_FUNCS([getline],
#include <pwd.h>
#include <grp.h>
#include <time.h>
+#ifdef HAVE_STATVFS
#include <sys/statvfs.h>
+#endif
#if HAVE_PTY_H
#include <pty.h>
static unsigned long add_required_remount_flags(const char *s, const char *d,
unsigned long flags)
{
+#ifdef HAVE_STATVFS
struct statvfs sb;
unsigned long required_flags = 0;
required_flags |= MS_NOEXEC;
return flags | required_flags;
+#else
+ return flags;
+#endif
}
static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_handler *handler)
const char *fstype, unsigned long mountflags,
const char *data, int optional)
{
+#ifdef HAVE_STATVFS
struct statvfs sb;
+#endif
if (mount(fsname, target, fstype, mountflags & ~MS_REMOUNT, data)) {
if (optional) {
DEBUG("remounting %s on %s to respect bind or remount options",
fsname ? fsname : "(none)", target ? target : "(none)");
+#ifdef HAVE_STATVFS
if (statvfs(fsname, &sb) == 0) {
unsigned long required_flags = 0;
if (sb.f_flag & MS_NOSUID)
}
mountflags |= required_flags;
}
+#endif
if (mount(fsname, target, fstype,
mountflags | MS_REMOUNT, data)) {
}
}
+#ifdef HAVE_STATVFS
skipremount:
+#endif
DEBUG("mounted '%s' on '%s', type '%s'", fsname, target, fstype);
return 0;