From 6730f4c0cce738b79bdd3a661ab9077ec7839176 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Tue, 7 Feb 2017 13:03:28 -0500 Subject: --git-install: default disabled in ./configure script --- configure | 7 ++++--- configure.ac | 7 ++++--- src/fgit/fgit-install.sh | 2 +- src/fgit/fgit-uninstall.sh | 2 +- src/firejail/main.c | 6 ++++++ 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/configure b/configure index bdffba2ad..74f47a7c4 100755 --- a/configure +++ b/configure @@ -1351,7 +1351,7 @@ Optional Features: --enable-busybox-workaround enable busybox workaround --enable-gcov Gcov instrumentation - --disable-git-install disable git install feature + --enable-git-install enable git install feature Some influential environment variables: CC C compiler command @@ -3103,6 +3103,7 @@ if test "x$enable_apparmor" = "xyes"; then : fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3713,20 +3714,20 @@ if test "x$enable_gcov" = "xyes"; then : fi + HAVE_GIT_INSTALL="" # Check whether --enable-git-install was given. if test "${enable_git_install+set}" = set; then : enableval=$enable_git_install; fi -if test "x$enable_git_install" != "xno"; then : +if test "x$enable_git_install" = "xyes"; then : HAVE_GIT_INSTALL="-DHAVE_GIT_INSTALL" fi - # checking pthread library { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5 $as_echo_n "checking for main in -lpthread... " >&6; } diff --git a/configure.ac b/configure.ac index 252f82cde..6a6c40b40 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,7 @@ AS_IF([test "x$enable_apparmor" = "xyes"], [ AC_SUBST(HAVE_APPARMOR) ]) + AS_IF([test "x$enable_apparmor" = "xyes"], [ AC_CHECK_HEADER(sys/apparmor.h, , [AC_MSG_ERROR( [Couldn't find sys/apparmor.h... please install apparmor user space library and development files] )]) @@ -145,15 +146,15 @@ AS_IF([test "x$enable_gcov" = "xyes"], [ AC_SUBST(HAVE_GCOV) ]) + HAVE_GIT_INSTALL="" AC_ARG_ENABLE([git-install], - AS_HELP_STRING([--disable-git-install], [disable git install feature])) -AS_IF([test "x$enable_git_install" != "xno"], [ + AS_HELP_STRING([--enable-git-install], [enable git install feature])) +AS_IF([test "x$enable_git_install" = "xyes"], [ HAVE_GIT_INSTALL="-DHAVE_GIT_INSTALL" AC_SUBST(HAVE_GIT_INSTALL) ]) - # checking pthread library AC_CHECK_LIB([pthread], [main], [], AC_MSG_ERROR([*** POSIX thread support not installed ***])) AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not installed ***])) diff --git a/src/fgit/fgit-install.sh b/src/fgit/fgit-install.sh index 9e43559a1..1f710c688 100755 --- a/src/fgit/fgit-install.sh +++ b/src/fgit/fgit-install.sh @@ -6,7 +6,7 @@ set -e # exit immediately if one of the commands fails cd /tmp # by the time we start this, we should have a tmpfs mounted on top of /tmp git clone --depth=1 https://www.github.com/netblue30/firejail.git cd firejail -./configure +./configure --enable-git-install make sudo make install-strip echo "**********************************************************************" diff --git a/src/fgit/fgit-uninstall.sh b/src/fgit/fgit-uninstall.sh index 9a370546d..bc7cc9563 100644 --- a/src/fgit/fgit-uninstall.sh +++ b/src/fgit/fgit-uninstall.sh @@ -6,7 +6,7 @@ set -e # exit immediately if one of the commands fails cd /tmp # by the time we start this, we should have a tmpfs mounted on top of /tmp git clone --depth=1 https://www.github.com/netblue30/firejail.git cd firejail -./configure +./configure --enable-git-install sudo make uninstall echo "**********************************************************************" echo "Firejail mainline git version uninstalled from /usr/local" diff --git a/src/firejail/main.c b/src/firejail/main.c index 0d4cf2595..b90e30cca 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c @@ -2143,6 +2143,12 @@ int main(int argc, char **argv) { return 1; } } + else if (strcmp(argv[i], "--git-install") == 0 || + strcmp(argv[i], "--git-uninstall") == 0) { + fprintf(stderr, "This feature is not enabled in the current build\n"); + exit(1); + } + else if (strcmp(argv[i], "--") == 0) { // double dash - positional params to follow arg_doubledash = 1; -- cgit v1.2.3-70-g09d2