rpms/powertop/F-7 powertop-1.7-less-gpm-slander-plz.patch, NONE, 1.1 powertop-1.7-strncpy.patch, NONE, 1.1 powertop.spec, 1.4, 1.5 sources, 1.5, 1.6

Adam Jackson (ajax) fedora-extras-commits at redhat.com
Mon Jul 9 18:04:14 UTC 2007


Author: ajax

Update of /cvs/pkgs/rpms/powertop/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8663

Modified Files:
	powertop.spec sources 
Added Files:
	powertop-1.7-less-gpm-slander-plz.patch 
	powertop-1.7-strncpy.patch 
Log Message:
rebase to 1.7 + rawhide

powertop-1.7-less-gpm-slander-plz.patch:

--- NEW FILE powertop-1.7-less-gpm-slander-plz.patch ---
diff -up powertop-1.7/powertop.c.jx powertop-1.7/powertop.c
--- powertop-1.7/powertop.c.jx	2007-06-17 21:16:31.000000000 -0400
+++ powertop-1.7/powertop.c	2007-07-05 16:07:16.000000000 -0400
@@ -631,12 +631,6 @@ int main(int argc, char **argv)
 				      "Beagle is the program that indexes for easy desktop search, however it's \n"
 				      "not very efficient and costs a significant amount of battery life."), 30);
 
-		/* suggest to stop gnome-power-manager if it shows up in the top 10 and wakes up more than 10 times in the measurement */
-		suggest_process_death("gnome-power-man : schedule_timeout (process_timeout)", "gnome-power-manager", lines, min(linehead,10), 10.0,
-				    _("Suggestion: Disable or remove 'gnome-power-manager' from your system. \n"
-				      "Despite its name, some versions of gnome-power-manager end up costing more power \n"
-				      "than it'll ever save."), 5);
-
 		/* suggest to stop pcscd if it shows up in the top 50 and wakes up at all*/
 		suggest_process_death("pcscd : ", "pcscd", lines, min(linehead,50), 1.0,
 				    _("Suggestion: Disable or remove 'pcscd' from your system. \n"

powertop-1.7-strncpy.patch:

--- NEW FILE powertop-1.7-strncpy.patch ---
diff -u powertop-1.7.orig/display.c powertop-1.7/display.c
--- powertop-1.7.orig/display.c	2007-06-18 03:16:33.000000000 +0200
+++ powertop-1.7/display.c	2007-07-05 02:43:51.000000000 +0200
@@ -44,7 +44,7 @@
 static WINDOW *status_bar_window;
 
 
-char status_bar_slots[10][40];
+char status_bar_slots[STATUS_BAR_NR_SLOTS][STATUS_BAR_SLOTSIZE + 1];
 
 static void cleanup_curses(void) {
 	endwin();
@@ -104,8 +104,8 @@
 	suggestion_window = subwin(stdscr, 3, maxx, maxy-4, 0);	
 	status_bar_window = subwin(stdscr, 1, maxx, maxy-1, 0);
 
-	strcpy(status_bar_slots[0], _(" Q - Quit "));
-	strcpy(status_bar_slots[1], _(" R - Refresh "));
+	strncpy(status_bar_slots[0], _(" Q - Quit "), STATUS_BAR_SLOTSIZE);
+	strncpy(status_bar_slots[1], _(" R - Refresh "), STATUS_BAR_SLOTSIZE);
 
 	werase(stdscr);
 	refresh();
@@ -148,7 +148,7 @@
 	werase(status_bar_window);
 
 	x = 0;
-	for (i=0; i<10; i++) {
+	for (i=0; i < STATUS_BAR_NR_SLOTS; i++) {
 		if (strlen(status_bar_slots[i])==0)
 			continue;
 		wattron(status_bar_window, A_REVERSE);
Gemeinsame Unterverzeichnisse: powertop-1.7.orig/po und powertop-1.7/po.
diff -u powertop-1.7.orig/powertop.h powertop-1.7/powertop.h
--- powertop-1.7.orig/powertop.h	2007-06-17 08:21:37.000000000 +0200
+++ powertop-1.7/powertop.h	2007-07-05 02:39:53.000000000 +0200
@@ -64,7 +64,10 @@
 extern int topcstate;
 extern int topfreq;  
 
-extern char status_bar_slots[10][40];
+#define STATUS_BAR_NR_SLOTS 10
+#define STATUS_BAR_SLOTSIZE 40 
+char status_bar_slots[STATUS_BAR_NR_SLOTS][STATUS_BAR_SLOTSIZE + 1];
+
 extern char suggestion_key;
 extern suggestion_func *suggestion_activate; 
 
diff -u powertop-1.7.orig/suggestions.c powertop-1.7/suggestions.c
--- powertop-1.7.orig/suggestions.c	2007-06-08 07:33:13.000000000 +0200
+++ powertop-1.7/suggestions.c	2007-07-05 02:42:59.000000000 +0200
@@ -70,7 +70,7 @@
 		ptr = next;
 	}
 	suggestions = NULL;
-	strcpy(status_bar_slots[9],"");
+	strncpy(status_bar_slots[9], "", STATUS_BAR_SLOTSIZE);
 	suggestion_key = 255;
 	suggestion_activate = NULL;
 	total_weight = 0;
@@ -103,7 +103,7 @@
 	int value, running = 0;
 	struct suggestion *ptr;
 
-	strcpy(status_bar_slots[9],"");
+	strncpy(status_bar_slots[9], "", STATUS_BAR_SLOTSIZE);
 	suggestion_key = 255;
 	suggestion_activate = NULL;
 
@@ -119,7 +119,7 @@
 		running += ptr->weight;
 		if (running > value) {
 			if (ptr->keystring)
-				strcpy(status_bar_slots[9],ptr->keystring);
+	                        strncpy(status_bar_slots[9], ptr->keystring, STATUS_BAR_SLOTSIZE);
 			suggestion_key = ptr->key;
 			suggestion_activate = ptr->func;
 			show_suggestion(ptr->string);


Index: powertop.spec
===================================================================
RCS file: /cvs/pkgs/rpms/powertop/F-7/powertop.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- powertop.spec	31 May 2007 22:09:32 -0000	1.4
+++ powertop.spec	9 Jul 2007 18:03:33 -0000	1.5
@@ -1,6 +1,6 @@
 Name:           powertop
-Version:        1.5
-Release:        1%{?dist}
+Version:        1.7
+Release:        3%{?dist}
 Summary:        Power consumption monitor
 
 Group:          Applications/System
@@ -12,12 +12,17 @@
 BuildRequires: gettext
 BuildRequires: ncurses-devel
 
+Patch0: powertop-1.7-less-gpm-slander-plz.patch
+Patch1: powertop-1.7-strncpy.patch
+
 %description
 PowerTOP is a tool that finds the software component(s) that make your
 computer use more power than necessary while it is idle.
 
 %prep
 %setup -q
+%patch0 -p1 -b .g-p-m
+%patch1 -p1 -b .strncpy
 
 %build
 export CFLAGS="$RPM_OPT_FLAGS"
@@ -38,8 +43,25 @@
 %{_mandir}/man1/powertop.1*
 
 %changelog
-* Thu May 31 2007 Josh Boyer <jwboyer at jdub.homelinux.org> 1.5-1
-- powertop 1.5
+* Mon Jul 09 2007 Adam Jackson <ajax at redhat.com> 1.7-3
+- powertop-1.7-strncpy.patch: Use strncpy() to avoid stack smash. Patch from
+  Till Maas. (#246796)
+
+* Thu Jul 05 2007 Adam Jackson <ajax at redhat.com> 1.7-2
+- Don't suggest disabling g-p-m.  Any additional power consumption is more
+  than offset by the ability to suspend.
+
+* Mon Jun 18 2007 Adam Jackson <ajax at redhat.com> 1.7-1
+- powertop 1.7.
+
+* Mon Jun 11 2007 Adam Jackson <ajax at redhat.com> 1.6-1
+- powertop 1.6.
+
+* Tue May 29 2007 Adam Jackson <ajax at redhat.com> 1.5-1
+- powertop 1.5.
+
+* Mon May 21 2007 Adam Jackson <ajax at redhat.com> 1.3-1
+- powertop 1.3.
 
 * Tue May 15 2007 Adam Jackson <ajax at redhat.com> 1.2-1
 - powertop 1.2.  Fixes power reports on machines that report power in Amperes


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/powertop/F-7/sources,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- sources	31 May 2007 22:09:32 -0000	1.5
+++ sources	9 Jul 2007 18:03:33 -0000	1.6
@@ -1 +1 @@
-163c65bde5aa4edc5b1b578035cbc72b  powertop-1.5.tar.gz
+84c012fe5e866b5deb588606a6b9822b  powertop-1.7.tar.gz




More information about the scm-commits mailing list