diff options
author | netblue30 <netblue30@yahoo.com> | 2017-02-07 13:03:28 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2017-02-07 13:03:28 -0500 |
commit | 6730f4c0cce738b79bdd3a661ab9077ec7839176 (patch) | |
tree | 532e27c7d39511e84a59039dcf388c9ef55d8cbd | |
parent | disable --git-install at compile time (diff) | |
download | firejail-6730f4c0cce738b79bdd3a661ab9077ec7839176.tar.gz firejail-6730f4c0cce738b79bdd3a661ab9077ec7839176.tar.zst firejail-6730f4c0cce738b79bdd3a661ab9077ec7839176.zip |
--git-install: default disabled in ./configure script
-rwxr-xr-x | configure | 7 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rwxr-xr-x | src/fgit/fgit-install.sh | 2 | ||||
-rw-r--r-- | src/fgit/fgit-uninstall.sh | 2 | ||||
-rw-r--r-- | src/firejail/main.c | 6 |
5 files changed, 16 insertions, 8 deletions
@@ -1351,7 +1351,7 @@ Optional Features: | |||
1351 | --enable-busybox-workaround | 1351 | --enable-busybox-workaround |
1352 | enable busybox workaround | 1352 | enable busybox workaround |
1353 | --enable-gcov Gcov instrumentation | 1353 | --enable-gcov Gcov instrumentation |
1354 | --disable-git-install disable git install feature | 1354 | --enable-git-install enable git install feature |
1355 | 1355 | ||
1356 | Some influential environment variables: | 1356 | Some influential environment variables: |
1357 | CC C compiler command | 1357 | CC C compiler command |
@@ -3103,6 +3103,7 @@ if test "x$enable_apparmor" = "xyes"; then : | |||
3103 | fi | 3103 | fi |
3104 | 3104 | ||
3105 | 3105 | ||
3106 | |||
3106 | ac_ext=c | 3107 | ac_ext=c |
3107 | ac_cpp='$CPP $CPPFLAGS' | 3108 | ac_cpp='$CPP $CPPFLAGS' |
3108 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | 3109 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' |
@@ -3713,20 +3714,20 @@ if test "x$enable_gcov" = "xyes"; then : | |||
3713 | 3714 | ||
3714 | fi | 3715 | fi |
3715 | 3716 | ||
3717 | |||
3716 | HAVE_GIT_INSTALL="" | 3718 | HAVE_GIT_INSTALL="" |
3717 | # Check whether --enable-git-install was given. | 3719 | # Check whether --enable-git-install was given. |
3718 | if test "${enable_git_install+set}" = set; then : | 3720 | if test "${enable_git_install+set}" = set; then : |
3719 | enableval=$enable_git_install; | 3721 | enableval=$enable_git_install; |
3720 | fi | 3722 | fi |
3721 | 3723 | ||
3722 | if test "x$enable_git_install" != "xno"; then : | 3724 | if test "x$enable_git_install" = "xyes"; then : |
3723 | 3725 | ||
3724 | HAVE_GIT_INSTALL="-DHAVE_GIT_INSTALL" | 3726 | HAVE_GIT_INSTALL="-DHAVE_GIT_INSTALL" |
3725 | 3727 | ||
3726 | 3728 | ||
3727 | fi | 3729 | fi |
3728 | 3730 | ||
3729 | |||
3730 | # checking pthread library | 3731 | # checking pthread library |
3731 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5 | 3732 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5 |
3732 | $as_echo_n "checking for main in -lpthread... " >&6; } | 3733 | $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"], [ | |||
17 | AC_SUBST(HAVE_APPARMOR) | 17 | AC_SUBST(HAVE_APPARMOR) |
18 | ]) | 18 | ]) |
19 | 19 | ||
20 | |||
20 | AS_IF([test "x$enable_apparmor" = "xyes"], [ | 21 | AS_IF([test "x$enable_apparmor" = "xyes"], [ |
21 | AC_CHECK_HEADER(sys/apparmor.h, , [AC_MSG_ERROR( | 22 | AC_CHECK_HEADER(sys/apparmor.h, , [AC_MSG_ERROR( |
22 | [Couldn't find sys/apparmor.h... please install apparmor user space library and development files] )]) | 23 | [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"], [ | |||
145 | AC_SUBST(HAVE_GCOV) | 146 | AC_SUBST(HAVE_GCOV) |
146 | ]) | 147 | ]) |
147 | 148 | ||
149 | |||
148 | HAVE_GIT_INSTALL="" | 150 | HAVE_GIT_INSTALL="" |
149 | AC_ARG_ENABLE([git-install], | 151 | AC_ARG_ENABLE([git-install], |
150 | AS_HELP_STRING([--disable-git-install], [disable git install feature])) | 152 | AS_HELP_STRING([--enable-git-install], [enable git install feature])) |
151 | AS_IF([test "x$enable_git_install" != "xno"], [ | 153 | AS_IF([test "x$enable_git_install" = "xyes"], [ |
152 | HAVE_GIT_INSTALL="-DHAVE_GIT_INSTALL" | 154 | HAVE_GIT_INSTALL="-DHAVE_GIT_INSTALL" |
153 | AC_SUBST(HAVE_GIT_INSTALL) | 155 | AC_SUBST(HAVE_GIT_INSTALL) |
154 | ]) | 156 | ]) |
155 | 157 | ||
156 | |||
157 | # checking pthread library | 158 | # checking pthread library |
158 | AC_CHECK_LIB([pthread], [main], [], AC_MSG_ERROR([*** POSIX thread support not installed ***])) | 159 | AC_CHECK_LIB([pthread], [main], [], AC_MSG_ERROR([*** POSIX thread support not installed ***])) |
159 | AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not installed ***])) | 160 | 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 | |||
6 | cd /tmp # by the time we start this, we should have a tmpfs mounted on top of /tmp | 6 | cd /tmp # by the time we start this, we should have a tmpfs mounted on top of /tmp |
7 | git clone --depth=1 https://www.github.com/netblue30/firejail.git | 7 | git clone --depth=1 https://www.github.com/netblue30/firejail.git |
8 | cd firejail | 8 | cd firejail |
9 | ./configure | 9 | ./configure --enable-git-install |
10 | make | 10 | make |
11 | sudo make install-strip | 11 | sudo make install-strip |
12 | echo "**********************************************************************" | 12 | 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 | |||
6 | cd /tmp # by the time we start this, we should have a tmpfs mounted on top of /tmp | 6 | cd /tmp # by the time we start this, we should have a tmpfs mounted on top of /tmp |
7 | git clone --depth=1 https://www.github.com/netblue30/firejail.git | 7 | git clone --depth=1 https://www.github.com/netblue30/firejail.git |
8 | cd firejail | 8 | cd firejail |
9 | ./configure | 9 | ./configure --enable-git-install |
10 | sudo make uninstall | 10 | sudo make uninstall |
11 | echo "**********************************************************************" | 11 | echo "**********************************************************************" |
12 | echo "Firejail mainline git version uninstalled from /usr/local" | 12 | 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) { | |||
2143 | return 1; | 2143 | return 1; |
2144 | } | 2144 | } |
2145 | } | 2145 | } |
2146 | else if (strcmp(argv[i], "--git-install") == 0 || | ||
2147 | strcmp(argv[i], "--git-uninstall") == 0) { | ||
2148 | fprintf(stderr, "This feature is not enabled in the current build\n"); | ||
2149 | exit(1); | ||
2150 | } | ||
2151 | |||
2146 | else if (strcmp(argv[i], "--") == 0) { | 2152 | else if (strcmp(argv[i], "--") == 0) { |
2147 | // double dash - positional params to follow | 2153 | // double dash - positional params to follow |
2148 | arg_doubledash = 1; | 2154 | arg_doubledash = 1; |