Skip to content

Commit

Permalink
--git-install: default disabled in ./configure script
Browse files Browse the repository at this point in the history
  • Loading branch information
netblue30 committed Feb 7, 2017
1 parent d17ce13 commit 6730f4c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
7 changes: 4 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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; }
Expand Down
7 changes: 4 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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] )])
Expand Down Expand Up @@ -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 ***]))
Expand Down
2 changes: 1 addition & 1 deletion src/fgit/fgit-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "**********************************************************************"
Expand Down
2 changes: 1 addition & 1 deletion src/fgit/fgit-uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions src/firejail/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6730f4c

Please sign in to comment.