after CVE-2011-2494 fix, iotop needs root privileges

This commit is contained in:
Michal Hlavinka 2011-10-13 15:06:21 +02:00
parent 380040b41f
commit 0600938b42
2 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,14 @@
diff -up iotop-0.4.3/iotop/ui.py.rootpriv iotop-0.4.3/iotop/ui.py
--- iotop-0.4.3/iotop/ui.py.rootpriv 2011-10-11 16:59:48.204722984 +0200
+++ iotop-0.4.3/iotop/ui.py 2011-10-11 16:59:55.833780660 +0200
@@ -511,6 +511,10 @@ def main():
locale.setlocale(locale.LC_ALL, '')
except locale.Error:
print 'unable to set locale, falling back to the default locale'
+ if os.getuid() != 1:
+ print 'root privileges required'
+ exit(1)
+
parser = optparse.OptionParser(usage=USAGE, version='iotop ' + VERSION)
parser.add_option('-o', '--only', action='store_true',
dest='only', default=False,

View File

@ -1,13 +1,17 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Name: iotop
Version: 0.4.3
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Top like utility for I/O
Group: Applications/System
License: GPLv2
URL: http://guichaz.free.fr/iotop/
Source0: http://guichaz.free.fr/iotop/files/%{name}-%{version}.tar.bz2
# after CVE-2011-2494 fix, iotop needs root privileges
Patch1: iotop-0.4.3-rootpriv.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@ -16,6 +20,7 @@ Requires: python
%prep
%setup
%patch1 -p1 -b .rootpriv
%build
%{__python} setup.py build
@ -44,6 +49,9 @@ rm -rf $RPM_BUILD_ROOT
%{python_sitelib}/*
%changelog
* Thu Oct 13 2011 Michal Hlavinka <mhlavink@redhat.com> 0.4.3-2
- after CVE-2011-2494 fix, iotop needs root privileges
* Sun Sep 18 2011 Adel Gadllah <adel.gadllah@gmail.com> 0.4.3-1
- New upstream version