rpms/procps/devel procps-3.2.5-sysctl-writeonly.patch, NONE, 1.1 procps.spec, 1.33, 1.34

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Apr 26 09:53:45 UTC 2005


Author: kzak

Update of /cvs/dist/rpms/procps/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv13214

Modified Files:
	procps.spec 
Added Files:
	procps-3.2.5-sysctl-writeonly.patch 
Log Message:
- fix #144459 - sysctl reports error: unknown error <...> reading key '<key>'
  (now sysctl doesn't read data from write-only /proc/sys files)


procps-3.2.5-sysctl-writeonly.patch:
 sysctl.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

--- NEW FILE procps-3.2.5-sysctl-writeonly.patch ---
--- procps-3.2.5/sysctl.c.writeonly	2005-04-26 10:20:57.617343016 +0200
+++ procps-3.2.5/sysctl.c	2005-04-26 10:34:26.545367264 +0200
@@ -127,7 +127,8 @@
    char *restrict tmpname;
    char *restrict outname;
    char inbuf[1025];
-   FILE *restrict fp;
+   FILE *restrict fp = NULL;
+   struct stat st;
 
    if (!name || !*name) {
       fprintf(stderr, ERR_INVALID_KEY, name);
@@ -144,7 +145,13 @@
    outname = strdup(name);
    slashdot(outname,'/','.'); /* change / to . */
 
-   fp = fopen(tmpname, "r");
+   if (stat(tmpname, &st)==0) {
+	if (st.st_mode & (S_IRUSR|S_IROTH|S_IRGRP))	   
+	   	fp = fopen(tmpname, "r");
+	else
+		/* ignore write-only files  */
+		return -1;
+   }
 
    if (!fp) {
       switch(errno) {


Index: procps.spec
===================================================================
RCS file: /cvs/dist/rpms/procps/devel/procps.spec,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- procps.spec	17 Mar 2005 12:49:07 -0000	1.33
+++ procps.spec	26 Apr 2005 09:53:43 -0000	1.34
@@ -1,7 +1,7 @@
 Summary: System and process monitoring utilities.
 Name: procps
 Version: 3.2.5
-Release: 3
+Release: 4
 License: GPL
 Group: Applications/System
 Source: http://procps.sourceforge.net/procps-%{version}.tar.gz
@@ -16,6 +16,7 @@
 Patch6: procps-3.2.3-noproc.patch
 Patch7: procps-3.2.3-pseudo.patch
 Patch8: procps-3.2.4-0x9b.patch
+Patch9: procps-3.2.5-sysctl-writeonly.patch
 
 BuildRequires: ncurses-devel
 
@@ -51,6 +52,7 @@
 %patch6 -p1 -b .noproc
 %patch7 -p1 -b .pseudo
 %patch8 -p1 -b .0x9b
+%patch9 -p1 -b .writeonly
 
 cp %SOURCE1 .
 
@@ -84,6 +86,10 @@
 %attr(0644,root,root) %{_mandir}/man5/*
 
 %changelog
+* Tue Apr 26 2005 Karel Zak <kzak at redhat.com> 3.2.5-4
+- fix #144459 - sysctl reports error: unknown error <...> reading key '<key>'
+  (now sysctl doesn't read data from write-only /proc/sys files)
+
 * Thu Mar 17 2005 Karel Zak <kzak at redhat.com> 3.2.5-3
 - fix top crashes when terminal window is resized (#149319)
 




More information about the fedora-cvs-commits mailing list