diff --git a/.gitignore b/.gitignore index 684b364..3f0733e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -SOURCES/gpm-1.20.7.tar.xz +gpm-1.20.6.tar.lzma +/gpm-1.20.7.tar.lzma /gpm-1.20.7.tar.xz diff --git a/gpm-1.20.6-capability.patch b/gpm-1.20.6-capability.patch new file mode 100644 index 0000000..a121188 --- /dev/null +++ b/gpm-1.20.6-capability.patch @@ -0,0 +1,48 @@ +diff -urp gpm-1.20.6.orig/configure.ac gpm-1.20.6/configure.ac +--- gpm-1.20.6.orig/configure.ac 2009-08-15 13:39:33.000000000 -0400 ++++ gpm-1.20.6/configure.ac 2009-08-15 13:51:14.000000000 -0400 +@@ -129,6 +129,9 @@ No|no|N|n) SHARED_LIBS=-lc ;; + LIBS=$SAVELIBS ;; + esac + ++# look for capabilities library ++LIBCAP_NG_PATH ++ + GPMXTERM= + AC_SUBST(GPMXTERM) + AC_SUBST(abi_lev) +diff -urp gpm-1.20.6.orig/src/daemon/main.c gpm-1.20.6/src/daemon/main.c +--- gpm-1.20.6.orig/src/daemon/main.c 2009-08-15 13:39:33.000000000 -0400 ++++ gpm-1.20.6/src/daemon/main.c 2009-08-15 13:47:39.000000000 -0400 +@@ -26,9 +26,18 @@ + + #include "headers/daemon.h" + #include "headers/gpmInt.h" ++#ifdef HAVE_LIBCAP_NG ++#include ++#endif + + int main(int argc, char **argv) + { ++#ifdef HAVE_LIBCAP_NG ++ capng_clear(CAPNG_SELECT_BOTH); ++ capng_updatev(CAPNG_ADD, CAPNG_EFFECTIVE|CAPNG_PERMITTED, ++ CAP_SYS_ADMIN, CAP_SYS_TTY_CONFIG, -1); ++ capng_apply(CAPNG_SELECT_BOTH); ++#endif + startup(argc,argv); /* setup configurations */ + old_main(); /* LATER: exit(daemon()); */ + return 0; /* if we didn't exit before, just give back success */ +diff -urp gpm-1.20.6.orig/src/Makefile.in gpm-1.20.6/src/Makefile.in +--- gpm-1.20.6.orig/src/Makefile.in 2009-08-15 13:39:33.000000000 -0400 ++++ gpm-1.20.6/src/Makefile.in 2009-08-15 13:49:45.000000000 -0400 +@@ -82,7 +82,8 @@ prog/%: prog/%.o + all: gpm lib/libgpm.so.@abi_lev@ lib/libgpm.a $(PROG) + + gpm: $(GOBJ) +- $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm ++ $(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) \ ++ -lm $(CAPNG_LDADD) + + # construct dependings of sourcefiles and link sourcefiles + $(DEPFILE) dep: prog/gpm-root.c