re-import sources as agreed with the maintainer

This commit is contained in:
Adam Samalik 2023-07-10 09:17:11 +02:00
parent a6679776bf
commit 0af4d1921e
2 changed files with 50 additions and 1 deletions

3
.gitignore vendored
View File

@ -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 /gpm-1.20.7.tar.xz

View File

@ -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 <cap-ng.h>
+#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