[chkrootkit/el5: 32/33] Update chkutmp-outofbounds.patch

wolfy wolfy at fedoraproject.org
Tue Feb 25 21:26:30 UTC 2014


commit 58c0743e1f0331b086f562f1946499ea7b0e486e
Merge: 79dd359 5d51787
Author: Manuel Wolfshant <wolfy at fedoraproject.org>
Date:   Tue Feb 25 23:23:30 2014 +0200

    Update chkutmp-outofbounds.patch

 chkrootkit-0.49-chkutmp-outofbounds.patch |   74 +++++++++++++++++++++++++++++
 chkrootkit.spec                           |   14 +++++
 2 files changed, 88 insertions(+), 0 deletions(-)
---
diff --cc chkrootkit-0.49-chkutmp-outofbounds.patch
index 367ae26,ffb620a..df4ba26
--- a/chkrootkit-0.49-chkutmp-outofbounds.patch
+++ b/chkrootkit-0.49-chkutmp-outofbounds.patch
@@@ -1,12 -1,74 +1,86 @@@
++<<<<<<< HEAD
 +--- chkutmp.c~	2009-07-22 08:09:41.000000000 -0500
 ++++ chkutmp.c	2009-07-22 08:11:17.000000000 -0500
 +@@ -60,3 +60,3 @@
++=======
+ diff -Nur chkrootkit-0.49-orig/chkutmp.c chkrootkit-0.49/chkutmp.c
+ --- chkrootkit-0.49-orig/chkutmp.c	2009-07-30 15:43:17.000000000 +0200
+ +++ chkrootkit-0.49/chkutmp.c	2010-10-14 22:31:16.000000000 +0200
+ @@ -43,7 +43,6 @@
+  #endif
+  #include <ctype.h>
+  
+ -#define MAXREAD 1024
+  #define MAXBUF 4096
+  #define MAXLENGTH 256
+  #define UT_PIDSIZE 12
+ @@ -58,13 +57,13 @@
+  #endif
+  
+  struct ps_line {
++>>>>>>> el6
  -    char ps_tty[UT_LINESIZE];
  -    char ps_user[UT_NAMESIZE];
  -    char ps_args[MAXLENGTH];
  +    char ps_tty[UT_LINESIZE+2];
  +    char ps_user[UT_NAMESIZE+2];
  +    char ps_args[MAXLENGTH+2];
++<<<<<<< HEAD
 +@@ -66 +66 @@
 +-    char ut_tty[UT_LINESIZE];
 ++    char ut_tty[UT_LINESIZE+2];
++=======
+      int ps_pid;
+  };
+  struct utmp_line {
+ -    char ut_tty[UT_LINESIZE];
+ +    char ut_tty[UT_LINESIZE+2];
+      int ut_pid;
+      int ut_type;
+  };
+ @@ -78,7 +77,9 @@
+  int fetchps(struct ps_line *psl_p)
+  {
+      FILE *ps_fp;
+ -    char line[MAXREAD + 1], pid[UT_PIDSIZE];
+ +    char *line = NULL;
+ +    size_t linelen = 0;
+ +    char pid[UT_PIDSIZE+2];
+      char *s, *d;
+      struct ps_line *curp = &psl_p[0];
+      struct ps_line *endp = &psl_p[MAXBUF-1];
+ @@ -86,8 +87,8 @@
+  
+      i = 0;
+      if ((ps_fp = (popen(cmd[PS_CMD], "r"))) != NULL) {
+ -	fgets(line, MAXREAD, ps_fp);	/* skip header */
+ -	while (fgets(line, MAXREAD, ps_fp)) {
+ +	getline(&line, &linelen, ps_fp);	/* skip header */
+ +	while (getline(&line, &linelen, ps_fp) != -1) {
+  	    s = line;
+  	    if (*s != '\?' && curp <= endp) {	/* only interested in lines that
+  						 * have a tty */
+ @@ -98,7 +99,7 @@
+  		while (isspace(*s))	/* skip spaces */
+  		    s++;
+  		d = pid;
+ -		for (x = 0; (!isspace(*s)) && (*d++ = *s++) && x <= UT_LINESIZE; x++)	/* grab pid */
+ +		for (x = 0; (!isspace(*s)) && (*d++ = *s++) && x <= UT_PIDSIZE; x++)	/* grab pid */
+  		    ;
+  		*d = '\0';
+  		curp->ps_pid = atoi(pid);
+ @@ -113,11 +114,13 @@
+  		    s++;
+  		for (x = 0; (*d++ = *s++) && x <= MAXLENGTH; x++)	/* cmd + args */
+  		    ;
+ +		*d = '\0';
+  		i++;
+  		curp++;
+  	    }
+  	}
+  	pclose(ps_fp);
+ +    free(line);
+      } else {
+  	fprintf(stderr, "\nfailed running 'ps' !\n");
+  	exit(EXIT_FAILURE);
++>>>>>>> el6
diff --cc chkrootkit.spec
index 814e2a5,b084e17..cf4c981
--- a/chkrootkit.spec
+++ b/chkrootkit.spec
@@@ -1,6 -1,6 +1,10 @@@
  Name:           chkrootkit
  Version:        0.49
++<<<<<<< HEAD
 +Release:        2%{?dist}
++=======
+ Release:        3%{?dist}
++>>>>>>> el6
  Summary:        Tool to locally check for signs of a rootkit
  Group:          Applications/System
  License:        BSD and GPLv2+ and Python
@@@ -56,7 -56,7 +60,11 @@@ It contains
  #%patch7 -p1 -b .anomalies
  %patch8 -p0 -b .nophpcheck
  %patch9 -p0 -b .chkproc-psver
++<<<<<<< HEAD
 +%patch10 -p0
++=======
+ %patch10 -p1 -b .chkutmp-outofbounds
++>>>>>>> el6
  sed -i -e 's!\s\+ at strip.*!!g' Makefile
  
  
@@@ -124,6 -124,9 +132,12 @@@ rm -rf ${RPM_BUILD_ROOT
  
  
  %changelog
++<<<<<<< HEAD
++=======
+ * Tue Feb 25 2014 Manuel "lonely wolf" Wolfshant <wolfy at fedoraproject.org> - 0.49-3
+ - update chkutmp-outofbounds.patch with the one from fedora. should fix #1069632
+ 
++>>>>>>> el6
  * Fri Jul 02 2010 Manuel "lonely wolf" Wolfshant <wolfy at fedoraproject.org> - 0.49 -2
  - add BR for glibc-static, allowing to build in EL-6
   


More information about the scm-commits mailing list