rpms/procps/devel procps-3.2.7-sysctl-ignore.patch, NONE, 1.1 procps.spec, 1.59, 1.60 procps-3.2.5-sysctl-ignore.patch, 1.1, NONE

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Apr 2 23:32:50 UTC 2007


Author: kzak

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

Modified Files:
	procps.spec 
Added Files:
	procps-3.2.7-sysctl-ignore.patch 
Removed Files:
	procps-3.2.5-sysctl-ignore.patch 
Log Message:
* Tue Apr  3 2007 Karel Zak <kzak at redhat.com> 3.2.7-11
- fix #234546 - 'w' doesn't give correct information about what's being run.
- fix #228870 - process `sysctl' is using deprecated sysctl
- cleanup spec file
- Resolves: rhbz#234546 rhbz#228870


procps-3.2.7-sysctl-ignore.patch:
 sysctl.c |   50 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 47 insertions(+), 3 deletions(-)

--- NEW FILE procps-3.2.7-sysctl-ignore.patch ---
--- procps-3.2.7/sysctl.c.kzak	2007-04-03 01:26:01.000000000 +0200
+++ procps-3.2.7/sysctl.c	2007-04-03 01:26:13.000000000 +0200
@@ -63,6 +63,44 @@
 static const char ERR_PRELOAD_FILE[] = "error: unable to open preload file \"%s\"\n";
 static const char WARN_BAD_LINE[] = "warning: %s(%d): invalid syntax, continuing...\n";
 
+/* Ignore deprecated sysctls
+ * -- we use this list when we scan (DisplayAll) /proc/sys only. We don't use it
+ *    in case when user direcly uses deprecated key. It's better when user can read
+ *    an error message from kernel.
+ */
+struct sysctl_ignore {
+	const char *prefix;
+	int        prefix_len;
+	const char *option;
+	int        option_len;
+};
+
+#define IGNORE_ENTRY(prefix, option) \
+		{ prefix, sizeof(prefix)-1, option, sizeof(option)-1 }
+
+static struct sysctl_ignore Ignore[] =
+{
+	IGNORE_ENTRY( "net.ipv6.neigh", "base_reachable_time" ),
+	IGNORE_ENTRY( "net.ipv6.neigh", "retrans_time" )
+};
+
+static bool IsIgnored(const char *name)
+{
+  unsigned int i;
+  int sz = strlen(name);
+
+  for (i = 0; i < sizeof(Ignore)/sizeof(struct sysctl_ignore); i++) {
+     struct sysctl_ignore *p = &Ignore[i];
+
+     if (sz < (p->prefix_len + p->option_len))
+	     continue;
+
+     if (strncmp(name, p->prefix, p->prefix_len) == 0 &&
+         strcmp(name + (sz - p->option_len), p->option) == 0)
+       return true;
+  }
+  return false;
+}
 
 static void slashdot(char *restrict p, char old, char new){
   p = strpbrk(p,"/.");
@@ -122,7 +160,7 @@
  *     Read a sysctl setting 
  *
  */
-static int ReadSetting(const char *restrict const name) {
+static int ReadSetting(const char *restrict const name, bool useign) {
    int rc = 0;
    char *restrict tmpname;
    char *restrict outname;
@@ -145,6 +183,12 @@
    outname = strdup(name);
    slashdot(outname,'/','.'); /* change / to . */
 
+   if (useign && IsIgnored(outname)) {
+     free(outname);
+     free(tmpname);
+     return rc;
+   }
+
    if (stat(tmpname, &st)==0) {
 	if (st.st_mode & (S_IRUSR|S_IROTH|S_IRGRP))	   
 	   	fp = fopen(tmpname, "r");
@@ -257,7 +301,7 @@
                strcat(tmpdir, "/");
                DisplayAll(tmpdir);
             } else {
-               rc |= ReadSetting(tmpdir+strlen(PROC_PATH));
+               rc |= ReadSetting(tmpdir+strlen(PROC_PATH), true);
             }
          }
          free(tmpdir);
@@ -519,7 +563,7 @@
          if (WriteMode || index(*argv, '='))
             ReturnCode = WriteSetting(*argv);
          else
-            ReturnCode = ReadSetting(*argv);
+            ReturnCode = ReadSetting(*argv, false);
       }
    }
 


Index: procps.spec
===================================================================
RCS file: /cvs/dist/rpms/procps/devel/procps.spec,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- procps.spec	5 Feb 2007 10:19:04 -0000	1.59
+++ procps.spec	2 Apr 2007 23:32:48 -0000	1.60
@@ -1,13 +1,13 @@
-Summary: System and process monitoring utilities.
+Summary: System and process monitoring utilities
 Name: procps
 Version: 3.2.7
-Release: 10%{?dist}
+Release: 11%{?dist}
 License: GPL
 Group: Applications/System
+URL: http://procps.sourceforge.net
 Source: http://procps.sourceforge.net/procps-%{version}.tar.gz
 Source1: FAQ
-
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
+Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
@@ -43,9 +43,12 @@
 # 199174 - top returns with exit code 1 even if no error occurs
 Patch20: procps-3.2.7-top-exitcode.patch
 # 212637 - sysctl using deprecated syscall
-Patch21: procps-3.2.5-sysctl-ignore.patch
+# 228870 - process `sysctl' is using deprecated sysctl ...
+Patch21: procps-3.2.7-sysctl-ignore.patch
 # 140975 - top corrupts screen when sorting on first column
 Patch22: procps-3.2.7-top-sorthigh.path
+# 234546 - 'w' doesn't give correct information about what's being run.
+Patch23: procps-3.2.7-w-best.patch
 
 BuildRequires: ncurses-devel
 
@@ -93,6 +96,7 @@
 %patch20 -p1
 %patch21 -p1
 %patch22 -p1
+%patch23 -p1
 
 cp %SOURCE1 .
 
@@ -121,15 +125,20 @@
 %defattr(0644,root,root,755)
 %doc NEWS BUGS TODO FAQ
 %attr(755,root,root) /%{_lib}/*
-%attr(555,root,root) /bin/ps
-%attr(555,root,root) /sbin/sysctl
-%attr(555,root,root) /usr/bin/*
+%attr(755,root,root) /bin/ps
+%attr(755,root,root) /sbin/sysctl
+%attr(755,root,root) /usr/bin/*
 
 %attr(0644,root,root) %{_mandir}/man1/*
 %attr(0644,root,root) %{_mandir}/man8/*
 %attr(0644,root,root) %{_mandir}/man5/*
 
 %changelog
+* Tue Apr  3 2007 Karel Zak <kzak at redhat.com> 3.2.7-11
+- fix #234546 - 'w' doesn't give correct information about what's being run.
+- fix #228870 - process `sysctl' is using deprecated sysctl
+- cleanup spec file
+
 * Mon Feb  5 2007 Karel Zak <kzak at redhat.com> 3.2.7-10
 - fix #212637 - sysctl using deprecated syscall
 - fix #140975 - top corrupts screen when sorting on first column
@@ -458,7 +467,7 @@
 - automated rebuild
 
 * Mon Apr 15 2002 Bill Nottingham <notting at redhat.com> 2.0.7-12
-- add ldconfig in %postun
+- add ldconfig in postun section
 
 * Mon Aug 27 2001 Trond Eivind Glomsrod <teg at redhat.com> 2.0.7-11
 - Add ncurses-devel as a build dependency (#49562)


--- procps-3.2.5-sysctl-ignore.patch DELETED ---




More information about the fedora-cvs-commits mailing list