iotop/iotop-0.4.3-rootpriv.patch
2011-10-13 15:06:21 +02:00

15 lines
656 B
Diff

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,