Compare commits

...

No commits in common. "c9s" and "c8" have entirely different histories.
c9s ... c8

18 changed files with 100 additions and 797 deletions

4
.gitignore vendored
View File

@ -1,3 +1 @@
gpm-1.20.6.tar.lzma
/gpm-1.20.7.tar.lzma
/gpm-1.20.7.tar.xz
SOURCES/gpm-1.20.7.tar.xz

View File

@ -1 +1 @@
79c4c5f4af8000f0bcea98f189b5ecf8b2c94dff gpm-1.20.7.tar.xz
79c4c5f4af8000f0bcea98f189b5ecf8b2c94dff SOURCES/gpm-1.20.7.tar.xz

View File

@ -1,555 +0,0 @@
diff --git a/.gitignore b/.gitignore
index 87df93b..5f79b9d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,7 @@ Makefile
Makefile.include
/aclocal.m4
/autom4te.cache
+/config.cache
/config.log
/config.status
/configure
@@ -29,7 +30,7 @@ Makefile.include
/src/gpm
/src/gpm2/tmp
/src/gpm2/out
-/src/lib/libgpm.so.*
+/src/lib/libgpm.so*
/src/prog/disable-paste
/src/prog/display-buttons
/src/prog/display-coords
diff --git a/Makefile.in b/Makefile.in
index 5412334..0aa6a78 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -102,19 +102,24 @@ TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS
### RELEASE STUFF
TARS =../gpm-$(release).tar.gz
-TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.lzma
+TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.xz
M_HOST=arcana.linux.it
M_DIR=gpm/
tars: $(TARS)
+ chmod a+r $<
# configure headers, produce new configure script
distconf: Makefile.in Makefile.include.in configure acinclude.m4 $(versionfiles)
../gpm-$(release).tar: $(srcdir) distclean distconf
# no exclude possible of .git with pax it seems, so the following is not possible:
- git archive --prefix "gpm-$(release)/" -o $@ HEAD
+ rm -rf "gpm-$(release)/"
+ git archive --prefix "gpm-$(release)/" HEAD | tar xf -
+ cd "gpm-$(release)/" && ./autogen.sh && rm -rf autom4te.cache
+ tar cf $@ "gpm-$(release)/"
+ rm -rf "gpm-$(release)/"
../gpm-$(release).tar.gz: ../gpm-$(release).tar
gzip -9 -c $< > $@
@@ -122,11 +127,11 @@ distconf: Makefile.in Makefile.include.in configure acinclude.m4 $(versionfiles)
../gpm-$(release).tar.bz2: ../gpm-$(release).tar
bzip2 -9 -c $< > $@
-../gpm-$(release).tar.lzma: ../gpm-$(release).tar
- lzma -9 -c $< > $@
+../gpm-$(release).tar.xz: ../gpm-$(release).tar
+ xz -9 -c $< > $@
# 3. Put package together into .tar.gz and .tar.bz2
-dist: disttest distclean distconf $(TARS)
+dist: disttest distclean distconf $(TARS) tars
scp $(TARS) $(M_HOST):$(M_DIR)
mv $(TARS) ~/niconetz/software/gpm/archives
diff --git a/configure.ac.footer b/configure.ac.footer
index 89a4cd9..1e5e4da 100644
--- a/configure.ac.footer
+++ b/configure.ac.footer
@@ -124,7 +124,7 @@ No|no|N|n) SHARED_LIBS=-lc ;;
done
TERMLIBS=$LIBS
LIBS=
- for i in ncurses curses; do
+ for i in ncurses curses ncursesw; do
if test x$LIBS = x; then
AC_CHECK_LIB($i, wgetch,,,$TERMLIBS)
else :; fi
diff --git a/doc/changelog b/doc/changelog
index de64bcf..1581fd1 100644
--- a/doc/changelog
+++ b/doc/changelog
@@ -1,3 +1,7 @@
+1.20.8:
+ * Remove lzma, use xz (Mike Frysinger)
+ * Install shared lib with +x perms (Mike Frysinger)
+
1.20.7: 2012-10-26
* Fix inclusion of unwanted binary data
* Even more cleanups (Mike Frysinger)
@@ -5,7 +9,7 @@
* Don't build static libgpm by default (Sean McGovern)
* autogen.sh is now required to create setup version in autoconf (Nico Schottelius)
-1.20.5: 9th of February 2009
+1.20.6: 9th of February 2009
* Some cleanups (Mike Frysinger/Nico Schottelius)
* Pull in fcntl.h rather than unistd.h for open() (Mike Frysinger)
* Fix gcc warning "control reaches end of non-void function" (Mike Frysinger)
diff --git a/doc/doc.gpm.in b/doc/doc.gpm.in
index afd5a29..795b958 100644
--- a/doc/doc.gpm.in
+++ b/doc/doc.gpm.in
@@ -88,7 +88,7 @@ by the Free Software Foundation.
@subtitle A general purpose mouse server for the Linux console
@subtitle @value{update-month}
-@author by Nico Schottelius <nico@@schottelius.org>
+@author by Nico Schottelius <nico-gpm2008@@schottelius.org>
@end titlepage
@setchapternewpage off
@@ -525,7 +525,7 @@ security risks when using them.
Andrew Haylett <ajh@gec-mrc.co.uk> (the original selection code)
Ian Zimmerman <itz@speakeasy.org> (old maintainer)
Alessandro Rubini <rubini@linux.it> (old maintainer (still helps a lot))
-Nico Schottelius <nico@schottelius.org> (maintainer)
+Nico Schottelius <nico-gpm2008@schottelius.org> (maintainer)
Many many contributors, to both selection and gpm.
.fi
diff --git a/src/Makefile.in b/src/Makefile.in
index d3b1dcd..2f92989 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -79,7 +79,7 @@ prog/%: prog/%.o
# | $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@'
# Do it all!
-all: gpm lib/libgpm.so.@abi_lev@ @LIBGPM_A@ $(PROG)
+all: gpm lib/libgpm.so.@abi_lev@ lib/libgpm.so @LIBGPM_A@ $(PROG)
gpm: $(GOBJ)
$(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm
@@ -96,7 +96,7 @@ $(DEPFILE) dep: prog/gpm-root.c
# create dependencies
for DEPS in `echo *.c */*.c`; do \
- $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \
+ $(CC) -I. -I $(srcdir) -I $(srcdir)/headers -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \
$(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done
### INSTALL
@@ -113,7 +113,7 @@ install: check
# 2.x goes along; unfortunately that means an additional
# headache in cases like this
if test "x@SHLIB@" != "x" ; then \
- $(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ; \
+ $(INSTALL_DATA) -m 755 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@ ; \
cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so.@abi_lev@ ; \
echo "WARNING: We installed a lib, you should now call ldconfig" ; \
echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" ; \
@@ -168,9 +168,8 @@ lib/libgpm.so.@abi_full@: $(PICS)
@LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS)
lib/libgpm.so.@abi_lev@: lib/libgpm.so.@abi_full@
$(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so.@abi_lev@
-# unneeded, isn't it?
-#lib/libgpm.so: lib/libgpm.so.@abi_full@
-# $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so
+lib/libgpm.so: lib/libgpm.so.@abi_full@
+ $(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so
include $(DEPFILE)
diff --git a/src/daemon/gpm.c b/src/daemon/gpm.c
index 771da5c..6806dce 100644
--- a/src/daemon/gpm.c
+++ b/src/daemon/gpm.c
@@ -29,7 +29,7 @@
#include <signal.h> /* SIGPIPE */
#include <time.h> /* time() */
#include <sys/param.h>
-#include <sys/fcntl.h> /* O_RDONLY */
+#include <fcntl.h> /* O_RDONLY */
#include <sys/wait.h> /* wait() */
#include <sys/stat.h> /* mkdir() */
#include <sys/time.h> /* timeval */
diff --git a/src/daemon/old_main.c b/src/daemon/old_main.c
index 9cd4e56..ab7a87f 100644
--- a/src/daemon/old_main.c
+++ b/src/daemon/old_main.c
@@ -25,6 +25,7 @@
#include <signal.h> /* guess again */
#include <errno.h> /* guess again */
#include <unistd.h> /* unlink */
+#include <string.h> /* strcpy, bzero */
#include <sys/stat.h> /* chmod */
#include <linux/kd.h> /* linux hd* */
@@ -192,10 +193,11 @@ int old_main()
* or to the default handler, if any
* or to the selection handler
*/ /* FIXME -- check event.vc */
- /* can't we please rewrite the following a bit nicer?*/
- (cinfo[event.vc] && do_client(cinfo[event.vc], &event))
- || (cinfo[0] && do_client(cinfo[0], &event))
- || do_selection(&event);
+ if(!cinfo[event.vc] || !do_client(cinfo[event.vc], &event)) {
+ if(!cinfo[0] || !do_client(cinfo[0],&event)) {
+ do_selection(&event);
+ }
+ }
}
}
diff --git a/src/daemon/open_console.c b/src/daemon/open_console.c
index 98297c9..6dd43e6 100644
--- a/src/daemon/open_console.c
+++ b/src/daemon/open_console.c
@@ -21,8 +21,13 @@
#include <fcntl.h> /* open and co. */
#include <sys/stat.h> /* stat() */
+#include <sys/types.h> /* major() */
#include <sys/ioctl.h> /* ioctl */
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h> /* major() w/newer glibc */
+#endif
+
/* Linux specific (to be outsourced in gpm2 */
#include <linux/serial.h> /* for serial console check */
#include <asm/ioctls.h> /* for serial console check */
diff --git a/src/daemon/processconn.c b/src/daemon/processconn.c
index a5839a3..e92fa63 100644
--- a/src/daemon/processconn.c
+++ b/src/daemon/processconn.c
@@ -67,7 +67,8 @@ int processConn(int fd)
return -1;
}
- if((vc = request->vc) > MAX_VC) {
+ vc = request->vc;
+ if(vc > MAX_VC || vc < 0) {
gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC);
free(info);
close(newfd);
diff --git a/src/headers/daemon.h b/src/headers/daemon.h
index a8936ad..24a1a97 100644
--- a/src/headers/daemon.h
+++ b/src/headers/daemon.h
@@ -180,7 +180,7 @@ extern struct mouse_features mouse_table[3],
extern Gpm_Type mice[];
extern Gpm_Type *repeated_type;
-time_t last_selection_time;
+extern time_t last_selection_time;
diff --git a/src/headers/gpm.h b/src/headers/gpm.h
index 57dc618..fe52e53 100644
--- a/src/headers/gpm.h
+++ b/src/headers/gpm.h
@@ -280,10 +280,16 @@ int Gpm_GetSnapshot(Gpm_Event *ePtr);
char *Gpm_get_console( void );
int Gpm_x_high_y(int base, int pot_y);
int Gpm_cnt_digits(int number);
-void gpm_oops(int line, char *file, char *text, ... );
+#ifdef __GNUC__
+__attribute__((__format__(printf, 3, 4)))
+#endif
+void gpm_oops(int line, const char *file, const char *text, ... );
/* report.c / report-lib.c */
-void gpm_report(int line, char *file, int stat, char *text, ... );
+#ifdef __GNUC__
+__attribute__((__format__(printf, 4, 5)))
+#endif
+void gpm_report(int line, const char *file, int stat, const char *text, ... );
#ifdef __cplusplus
};
diff --git a/src/headers/message.h b/src/headers/message.h
index a0fed0e..4b60291 100644
--- a/src/headers/message.h
+++ b/src/headers/message.h
@@ -226,7 +226,10 @@
/* #define GPM_MESS_ "" */
/* functions */
-void gpm_report(int line, char *file, int stat, char *text, ... );
+#ifdef __GNUC__
+__attribute__((__format__(printf, 4, 5)))
+#endif
+void gpm_report(int line, const char *file, int stat, const char *text, ... );
/* rest of wd.h */
#ifdef HAVE_SYSLOG_H
diff --git a/src/lib/liblow.c b/src/lib/liblow.c
index e789d09..8b40b71 100644
--- a/src/lib/liblow.c
+++ b/src/lib/liblow.c
@@ -29,11 +29,12 @@
#include <string.h> /* strncmp */
#include <unistd.h> /* select(); */
#include <errno.h>
+#include <fcntl.h> /* O_RDONLY */
+
#include <sys/time.h> /* timeval */
#include <sys/types.h> /* socket() */
#include <sys/socket.h> /* socket() */
#include <sys/un.h> /* struct sockaddr_un */
-#include <sys/fcntl.h> /* O_RDONLY */
#include <sys/stat.h> /* stat() */
#ifdef SIGTSTP /* true if BSD system */
@@ -173,7 +174,7 @@ static void gpm_suspend_hook (int signum)
/* Reincarnation. Prepare for another death early. */
sigemptyset(&sa.sa_mask);
sa.sa_handler = gpm_suspend_hook;
- sa.sa_flags = SA_NOMASK;
+ sa.sa_flags = SA_NODEFER;
sigaction (SIGTSTP, &sa, 0);
/* Pop the gpm stack by closing the useless connection */
@@ -364,7 +365,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag)
/* if signal was originally ignored, job control is not supported */
if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) {
- sa.sa_flags = SA_NOMASK;
+ sa.sa_flags = SA_NODEFER;
sa.sa_handler = gpm_suspend_hook;
sigaction(SIGTSTP, &sa, 0);
}
diff --git a/src/lib/report-lib.c b/src/lib/report-lib.c
index c0ae086..03230b4 100644
--- a/src/lib/report-lib.c
+++ b/src/lib/report-lib.c
@@ -24,9 +24,9 @@
#include "headers/message.h"
-void gpm_report(int line, char *file, int stat, char *text, ... )
+void gpm_report(int line, const char *file, int stat, const char *text, ... )
{
- char *string = NULL;
+ const char *string = NULL;
int log_level;
va_list ap;
@@ -47,7 +47,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... )
log_level = LOG_CRIT; break;
}
#ifdef HAVE_VSYSLOG
- syslog(log_level, string);
+ syslog(log_level, "%s", string);
vsyslog(log_level, text, ap);
#else
fprintf(stderr,"%s[%s(%d)]:\n",string,file,line);
diff --git a/src/prog/display-buttons.c b/src/prog/display-buttons.c
index de8e5b2..38d2f11 100644
--- a/src/prog/display-buttons.c
+++ b/src/prog/display-buttons.c
@@ -36,6 +36,7 @@
#include <stdio.h> /* printf() */
#include <time.h> /* time() */
#include <errno.h> /* errno */
+#include <sys/select.h> /* fd_set and FD_* */
#include <gpm.h> /* gpm information */
/* display resulting data */
diff --git a/src/prog/display-coords.c b/src/prog/display-coords.c
index ed15c8a..82afd12 100644
--- a/src/prog/display-coords.c
+++ b/src/prog/display-coords.c
@@ -33,10 +33,12 @@
*/
#include <unistd.h> /* write, read, open */
+#include <stdint.h>
#include <stdlib.h> /* strtol() */
#include <stdio.h> /* printf() */
#include <time.h> /* time() */
#include <errno.h> /* errno */
+#include <sys/select.h> /* fd_set and FD_* */
#include <gpm.h> /* gpm information */
/* display resulting data */
@@ -50,7 +52,7 @@ int display_data(Gpm_Event *event, void *data)
last = now;
/* display time, delta time */
- printf("[%d] delta: %ds",now,delta);
+ printf("[%jd] delta: %ds",(intmax_t)now,delta);
/* display mouse information */
printf(": x=%2i, y=%2i, dx=%2i, dy=%2i\n", event->x, event->y, event->dx, event->dy);
diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y
index 069d801..76c896c 100644
--- a/src/prog/gpm-root.y
+++ b/src/prog/gpm-root.y
@@ -443,6 +443,7 @@ void f__fix(struct passwd *pass)
}
/*---------------------------------------------------------------------*/
+#if 0
static int f_debug_one(FILE *f, Draw *draw)
{
DrawItem *ip;
@@ -465,6 +466,7 @@ static int f_debug_one(FILE *f, Draw *draw)
#undef LINE
return 0;
}
+#endif
int f_debug(int mode, DrawItem *self, int uid)
{
@@ -960,10 +962,8 @@ static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc)
/*------------*/
static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc)
{
- int x,y, dumpfd;
+ int dumpfd;
char dumpname[20];
-
- x=buffer[2]; y=buffer[3];
/* WILL NOT WORK WITH DEVFS! FIXME! */
sprintf(dumpname,"/dev/vcsa%i",vc);
@@ -1196,12 +1196,8 @@ int main(int argc, char **argv)
LOG_DAEMON : LOG_USER);
/* reap your zombies */
childaction.sa_handler=reap_children;
-#if defined(__GLIBC__)
- __sigemptyset(&childaction.sa_mask);
-#else /* __GLIBC__ */
- childaction.sa_mask=0;
-#endif /* __GLIBC__ */
- childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */
+ sigemptyset(&childaction.sa_mask);
+ childaction.sa_flags=0;
sigaction(SIGCHLD,&childaction,NULL);
/*....................................... Connect and get your buffer */
diff --git a/src/prog/mouse-test.c b/src/prog/mouse-test.c
index 0bb1982..d7d1027 100644
--- a/src/prog/mouse-test.c
+++ b/src/prog/mouse-test.c
@@ -182,14 +182,14 @@ Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type,
/*-----------------------------------------------------------------------------
Place the description here.
-----------------------------------------------------------------------------*/
-int mousereopen(int oldfd, char *name, Gpm_Type *type)
+int mousereopen(int oldfd, const char *name, Gpm_Type *type)
{
int fd;
if (!type) type=mice+1; /* ms */
close(oldfd);
usleep(100000);
fd=open(name,O_RDWR);
- if (fd < 0) gpm_report(GPM_PR_OOPS,name);
+ if (fd < 0) gpm_report(GPM_PR_OOPS, "%s", name);
(*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */
return fd;
}
diff --git a/src/report.c b/src/report.c
index 6c7c2ee..286c1b7 100644
--- a/src/report.c
+++ b/src/report.c
@@ -69,7 +69,7 @@
*
*/
-void gpm_report(int line, char *file, int stat, char *text, ... )
+void gpm_report(int line, const char *file, int stat, const char *text, ...)
{
FILE *console = NULL;
va_list ap, ap3;
diff --git a/src/synaptics.c b/src/synaptics.c
index 2418c75..a978ef0 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -214,6 +214,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
+#include <limits.h>
#include <sys/time.h>
#include <sys/ioctl.h>
@@ -2241,8 +2242,7 @@ static void syn_process_config (info_type ident,
-static unsigned char tp_hextoint (unsigned char byte1,
- unsigned char byte2)
+static unsigned char tp_hextoint (unsigned byte1,unsigned byte2)
{
unsigned char bytes [3];
int result;
@@ -2250,7 +2250,7 @@ static unsigned char tp_hextoint (unsigned char byte1,
bytes [0] = byte1;
bytes [1] = byte2;
bytes [2] = '\0';
- sscanf (bytes, "%x", &result);
+ sscanf ((char *)bytes, "%x", &result);
return result;
}
@@ -2311,8 +2311,7 @@ static void tp_serial_read (int fd,
}
/* Write a string of commands */
-static void tp_serial_send_cmd(int fd,
- unsigned char *cmd)
+static void tp_serial_send_cmd(int fd, const char *cmd)
{
unsigned char junk [15];
@@ -2329,7 +2328,7 @@ static void tp_serial_send_cmd(int fd,
static void syn_serial_set_mode (int fd,
unsigned char mode)
{
- unsigned char bytes [15];
+ char bytes [15];
sprintf (bytes, "%%C3B%02X5555", mode);
#if DEBUG_SENT_DATA
diff --git a/src/twiddler.c b/src/twiddler.c
index 1d2bd50..972a616 100644
--- a/src/twiddler.c
+++ b/src/twiddler.c
@@ -250,7 +250,6 @@ static inline int twiddler_use_item(char *item)
int twiddler_key(unsigned long message)
{
char **table = twiddler_get_table(message);
- char *val;
/*
* These two are needed to avoid transmitting single keys when typing
* chords. When the number of keys being held down decreases, data
@@ -269,7 +268,6 @@ int twiddler_key(unsigned long message)
if (!table) return 0;
message &= 0xff;
- val = table[message];
if ((message < last_message) && !marked) { /* ok, do it */
marked++; /* don't retransmit on release */
@@ -428,8 +426,11 @@ char *twiddler_rest_to_value(char *s)
buf[ibuf]='\0';
return strdup(buf);
}
- if (*ptr == '\\')
- return (char *)twiddler_escape_sequence(ptr+1, &len /* unused */);
+ if (*ptr == '\\') {
+ buf[ibuf++] = twiddler_escape_sequence(ptr+1, &len /* unused */);
+ buf[ibuf] = '\0';
+ return strdup(buf);
+ }
if (strlen(ptr)==1) return ((char *)((unsigned long)*ptr & 0xFF));

View File

@ -9,11 +9,11 @@
+ return 0;
+}
+
void gpm_report(int line, const char *file, int stat, const char *text, ... )
void gpm_report(int line, char *file, int stat, char *text, ... )
{
+ if ( gpm_silent() && stat != GPM_STAT_OOPS )
+ return;
+
const char *string = NULL;
char *string = NULL;
int log_level;
va_list ap;

View File

@ -14,9 +14,9 @@
int Gpm_Wgetch(WINDOW *win)
{
--- gpm-1.20.1/configure.ac.weak-wgetch 2004-03-22 15:49:51.000000000 -0500
--- gpm-1.20.1/configure.ac.footer.weak-wgetch 2004-03-22 15:49:51.000000000 -0500
+++ gpm-1.20.1/configure.ac.footer 2004-03-22 15:51:24.000000000 -0500
@@ -115,7 +115,7 @@
@@ -129,7 +129,7 @@
AC_CHECK_LIB($i, wgetch,,,$TERMLIBS)
else :; fi
done

View File

@ -0,0 +1,12 @@
diff -Naur gpm-1.20.6.orig/src/Makefile.in gpm-1.20.6/src/Makefile.in
--- gpm-1.20.6.orig/src/Makefile.in 2009-02-09 10:58:53.000000000 +0100
+++ gpm-1.20.6/src/Makefile.in 2013-03-19 14:33:58.092659991 +0100
@@ -96,7 +96,7 @@
# create dependencies
for DEPS in `echo *.c */*.c`; do \
- $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \
+ $(CC) -I. -Iheaders -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \
$(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done
### INSTALL

View File

@ -0,0 +1,16 @@
diff -r -u gpm-1.20.7-orig/src/prog/gpm-root.y gpm-1.20.7/src/prog/gpm-root.y
--- gpm-1.20.7-orig/src/prog/gpm-root.y 2012-10-26 16:21:38.000000000 -0500
+++ gpm-1.20.7/src/prog/gpm-root.y 2017-10-10 13:50:02.115721252 -0500
@@ -1196,11 +1196,7 @@
LOG_DAEMON : LOG_USER);
/* reap your zombies */
childaction.sa_handler=reap_children;
-#if defined(__GLIBC__)
- __sigemptyset(&childaction.sa_mask);
-#else /* __GLIBC__ */
- childaction.sa_mask=0;
-#endif /* __GLIBC__ */
+ sigemptyset(&childaction.sa_mask);
childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */
sigaction(SIGCHLD,&childaction,NULL);

View File

@ -0,0 +1,14 @@
diff -r -u gpm-1.20.7-orig/src/daemon/open_console.c gpm-1.20.7/src/daemon/open_console.c
--- gpm-1.20.7-orig/src/daemon/open_console.c 2012-10-26 16:21:38.000000000 -0500
+++ gpm-1.20.7/src/daemon/open_console.c 2017-10-10 13:40:39.896316258 -0500
@@ -23,6 +23,10 @@
#include <sys/stat.h> /* stat() */
#include <sys/ioctl.h> /* ioctl */
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h> /* major() w/newer glibc */
+#endif
+
/* Linux specific (to be outsourced in gpm2 */
#include <linux/serial.h> /* for serial console check */
#include <asm/ioctls.h> /* for serial console check */

View File

@ -0,0 +1,12 @@
diff -Naur gpm-1.20.6.orig/src/lib/report-lib.c gpm-1.20.6/src/lib/report-lib.c
--- gpm-1.20.6.orig/src/lib/report-lib.c 2014-02-05 19:11:58.688000000 +0100
+++ gpm-1.20.6/src/lib/report-lib.c 2014-02-05 19:11:23.968000000 +0100
@@ -55,7 +55,7 @@
log_level = LOG_CRIT; break;
}
#ifdef HAVE_VSYSLOG
- syslog(log_level, string);
+ syslog(log_level, "%s", string);
vsyslog(log_level, text, ap);
#else
fprintf(stderr,"%s[%s(%d)]:\n",string,file,line);

View File

@ -1,6 +1,5 @@
[Unit]
Description=Console Mouse manager
ConditionVirtualization=!container
# This could probably benefit from socket activation, but honestly I think it
# is time for gpm to go away, and hence I am not planning to spend the time
@ -9,7 +8,7 @@ ConditionVirtualization=!container
[Service]
ExecStart=/usr/sbin/gpm -m /dev/input/mice -t exps2
Type=forking
PIDFile=/run/gpm.pid
PIDFile=/var/run/gpm.pid
[Install]
WantedBy=multi-user.target

View File

@ -1,8 +1,9 @@
Summary: A mouse server for the Linux console
Name: gpm
Version: 1.20.7
Release: 29%{?dist}
License: GPLv2 and OFSFDL
Release: 17%{?dist}
License: GPLv2 and GPLv2+ with exceptions and GPLv3+ and Verbatim and Copyright only
Group: System Environment/Daemons
URL: http://www.nico.schottelius.org/software/gpm/
#URL2 : http://freecode.com/projects/gpm
@ -17,25 +18,25 @@ URL: http://www.nico.schottelius.org/software/gpm/
Source: %{name}-%{version}.tar.xz
Source1: gpm.service
Patch0: https://github.com/telmich/gpm/compare/1.20.7...e82d1a653ca94aa4ed12441424da6ce780b1e530.diff
Patch1: gpm-1.20.6-multilib.patch
Patch2: gpm-1.20.1-lib-silent.patch
Patch4: gpm-1.20.5-close-fds.patch
Patch5: gpm-1.20.1-weak-wgetch.patch
Patch7: gpm-1.20.7-rhbz-668480-gpm-types-7-manpage-fixes.patch
Patch8: gpm-1.20.7-covscan.patch
# Disabled, need to be reviewed
#Patch9: gpm-1.20.6-capability.patch
Requires(post): systemd info
Patch8: gpm-1.20.6-missing-header-dir-in-make-depend.patch
Patch9: gpm-format-security.patch
# Include patch from upstream pull request: https://github.com/telmich/gpm/pull/12
Patch10: gpm-1.20.7-sysmacros.patch
# Include patch from upstream pull request: https://github.com/telmich/gpm/pull/20
Patch11: gpm-1.20.7-sigemptyset.patch
#Patch7: gpm-1.20.6-capability.patch
Requires(post): systemd systemd-sysv info
Requires(preun): systemd info
Requires(postun): systemd
# this defines the library version that this package builds.
%define LIBVER 2.1.0
BuildRequires: sed gawk texinfo bison ncurses-devel autoconf automake libtool libcap-ng-devel
BuildRequires: systemd
BuildRequires: make
Requires: linuxconsoletools
Requires: %{name}-libs = %{version}-%{release}
@ -48,6 +49,7 @@ mouse button.
%package libs
Summary: Dynamic library for gpm
Group: System Environment/Libraries
%description libs
This package contains the libgpm.so dynamic library which contains
@ -57,6 +59,7 @@ the gpm system calls and library functions.
Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
Summary: Development files for the gpm library
Group: Development/Libraries
%description devel
The gpm-devel package includes header files and libraries necessary
@ -66,6 +69,7 @@ mouse support to text-based Linux applications.
%package static
Requires: %{name} = %{version}-%{release}
Summary: Static development files for the gpm library
Group: Development/Libraries
%description static
The gpm-static package includes static libraries of gpm. The gpm provides
@ -75,22 +79,26 @@ mouse support to text-based Linux applications.
%prep
%setup -q
%patch0 -p1 -b .master
%patch1 -p1 -b .multilib
%patch2 -p1 -b .lib-silent
%patch4 -p1 -b .close-fds
%patch5 -p1 -b .weak-wgetch
%patch7 -p1 -b .manpage
%patch8 -p1 -b .covscan
#patch9 -p1 -b .capability
%patch7 -p1
# not sure if this is really needed
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
#%%patch7 -p1 -b .capability
%build
./autogen.sh
%configure
%make_build
make %{?_smp_mflags}
%install
%make_install
%makeinstall
chmod 0755 %{buildroot}/%{_libdir}/libgpm.so.%{LIBVER}
ln -sf libgpm.so.%{LIBVER} %{buildroot}/%{_libdir}/libgpm.so
@ -117,18 +125,26 @@ rm -rf %{buildroot}%{_mandir}
%ifnarch s390 s390x
%systemd_post gpm.service
%endif
if [ -e %{_infodir}/gpm.info.gz ]; then
/sbin/install-info %{_infodir}/gpm.info.gz %{_infodir}/dir || :
fi
%preun
%ifnarch s390 s390x
%systemd_preun gpm.service
%endif
if [ $1 = 0 -a -e %{_infodir}/gpm.info.gz ]; then
/sbin/install-info %{_infodir}/gpm.info.gz --delete %{_infodir}/dir || :
fi
%postun
%ifnarch s390 s390x
%systemd_postun_with_restart gpm.service
%endif
%ldconfig_scriptlets libs
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%files
%doc COPYING README TODO
@ -153,52 +169,13 @@ rm -rf %{buildroot}%{_mandir}
%{_libdir}/libgpm.a
%changelog
* Mon Aug 16 2021 Jiri Kucera <jkucera@redhat.com> - 1.20.7-29
- Review covscan issues
Resolves: #1938733
* Mon Jan 18 2021 Jiri Kucera <jkucera@redhat.com> - 1.20.7-17
- Put autogen.sh to proper place
Related: #1854555
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.20.7-28
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 1.20.7-27
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Mar 24 2021 Jiri Kucera <jkucera@redhat.com> - 1.20.7-26
- Fix License tag
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.20.7-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.20.7-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jun 24 2020 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.20.7-23
- Do not run gpm in the container (#1524034)
* Thu Jun 18 2020 Sérgio Basto <sergio@serjux.com> - 1.20.7-22
- Two patches have been upstreamed
* Sat Feb 22 2020 Sérgio Basto <sergio@serjux.com> - 1.20.7-21
- Better comments in spec file
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.20.7-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
- Add upstream commits for git master which contains patches 9, 10 and 11
- Add GCC10 fix
- Cleanups
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.20.7-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Mar 24 2019 Sérgio Basto <sergio@serjux.com> - 1.20.7-18
- updating /var/run/gpm.pid /run/gpm.pid (rhbz #1692104)
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.20.7-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.20.7-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jan 15 2021 Jiri Kucera <jkucera@redhat.com> - 1.20.7-16
- Fix typo in description of gpm-libs subpackage
Resolves: #1854555
* Fri Feb 23 2018 Florian Weimer <fweimer@redhat.com> - 1.20.7-15
- Use default build flags (PIE works now)

View File

@ -1,6 +0,0 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

View File

@ -1,48 +0,0 @@
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

View File

@ -1,115 +0,0 @@
diff --git a/src/daemon/check_uniqueness.c b/src/daemon/check_uniqueness.c
index 4972413..d0eb4e4 100644
--- a/src/daemon/check_uniqueness.c
+++ b/src/daemon/check_uniqueness.c
@@ -36,6 +36,7 @@ void check_uniqueness(void)
if((fp = fopen(GPM_NODE_PID, "r")) != NULL) {
fscanf(fp, "%d", &old_pid);
+ fclose(fp);
if (kill(old_pid,0) == -1) {
gpm_report(GPM_PR_INFO,GPM_MESS_STALE_PID, GPM_NODE_PID);
unlink(GPM_NODE_PID);
diff --git a/src/lib/liblow.c b/src/lib/liblow.c
index 8b40b71..d197dae 100644
--- a/src/lib/liblow.c
+++ b/src/lib/liblow.c
@@ -250,9 +250,9 @@ int Gpm_Open(Gpm_Connect *conn, int flag)
memcpy(tty, consolename, strlen(consolename)-1);
sprintf(&tty[strlen(consolename) - 1], "%i", flag);
} else if (flag==0) { /* use your current vc */
- if (isatty(0)) tty = ttyname(0); /* stdin */
- if (!tty && isatty(1)) tty = ttyname(1); /* stdout */
- if (!tty && isatty(2)) tty = ttyname(2); /* stderr */
+ if (isatty(0) && ttyname(0)) tty = strdup(ttyname(0)); /* stdin */
+ if (!tty && isatty(1) && ttyname(1)) tty = strdup(ttyname(1)); /* stdout */
+ if (!tty && isatty(2) && ttyname(2)) tty = strdup(ttyname(2)); /* stderr */
if (tty == NULL) {
gpm_report(GPM_PR_ERR,"checking tty name failed");
goto err;
@@ -373,10 +373,12 @@ int Gpm_Open(Gpm_Connect *conn, int flag)
#endif
}
+ if (tty) free(tty);
return gpm_fd;
/*....................................... Error: free all memory */
err:
+ if (tty) free(tty);
if (gpm_is_disabled < 2) /* be quiet if no gpmctl socket found */
gpm_report(GPM_PR_ERR,"Oh, oh, it's an error! possibly I die! ");
while(gpm_stack) {
diff --git a/src/lib/report-lib.c b/src/lib/report-lib.c
index 03230b4..ff74b8c 100644
--- a/src/lib/report-lib.c
+++ b/src/lib/report-lib.c
@@ -63,5 +63,6 @@ void gpm_report(int line, const char *file, int stat, const char *text, ... )
fprintf(stderr,"\n");
#endif
+ va_end(ap);
if(stat == GPM_STAT_OOPS) exit(1); /* may a lib function call exit ???? */
}
diff --git a/src/mice.c b/src/mice.c
index 6cbd491..090dfed 100644
--- a/src/mice.c
+++ b/src/mice.c
@@ -905,7 +905,7 @@ static int M_wacom(Gpm_Event *state, unsigned char *data)
} else { /* Relative Mode */
/* Treshold; if greather then treat tool as first time in proximity */
if( abs(x-ox)>(wmaxx/wcmodell[WacomModell].treshold)
- || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) ox=x; oy=y;
+ || abs(y-oy)>(wmaxy/wcmodell[WacomModell].treshold) ) { ox=x; oy=y; }
state->dx= (x-ox) / (wmaxx / win.ws_col / wcmodell[WacomModell].treshold);
state->dy= (y-oy) / (wmaxy / win.ws_row / wcmodell[WacomModell].treshold);
diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y
index 76c896c..ded326a 100644
--- a/src/prog/gpm-root.y
+++ b/src/prog/gpm-root.y
@@ -555,12 +555,15 @@ int f_jptty(int mode, DrawItem *self, int uid)
} /*if*/
if (ioctl(fd, VT_ACTIVATE, i)<0) {
gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno));
+ close(fd);
return 1;
} /*if*/
if (ioctl(fd, VT_WAITACTIVE, i)<0) {
gpm_report(GPM_PR_ERR, "%s: %s", consolename,strerror(errno));
+ close(fd);
return 1;
}
+ close(fd);
default: return 0;
}
return 0; /* silly gcc -Wall */
@@ -586,14 +589,17 @@ int f_mktty(int mode, DrawItem *self, int uid)
} /*if*/
if (ioctl(fd, VT_OPENQRY, &vc)<0) {
gpm_report(GPM_PR_ERR, "%s: %s",consolename, strerror(errno));
+ close(fd);
return 1;
} /*if*/
switch(pid=fork()) {
case -1:
gpm_report(GPM_PR_ERR, "fork(): %s", strerror(errno));
+ close(fd);
return 1;
case 0: /* child: exec getty */
sprintf(name,"tty%i",vc);
+ close(fd);
execl("/sbin/mingetty","mingetty",name,(char *)NULL);
exit(1); /* shouldn't happen */
default: /* father: jump to the tty */
@@ -601,8 +607,10 @@ int f_mktty(int mode, DrawItem *self, int uid)
,pid,vc);
consolepids[vc]=pid;
sprintf(self->arg,"%i",vc);
+ close(fd);
return f_jptty(mode,self,uid);
}
+ close(fd);
default: return 0;
}
return 0;

View File

@ -1 +0,0 @@
859c3fc083593d68f0d13af25daa5a19 gpm-1.20.7.tar.xz