An interpreted, interactive, object-oriented programming language
CentOS Sources
2017-08-01 71084d584ff953f5463757ec6536406320560b4d
commit | author | age
6e8c2f 1 diff -up Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows Python-2.7.3/Lib/test/test_os.py
CB 2 --- Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows    2012-04-09 19:07:32.000000000 -0400
3 +++ Python-2.7.3/Lib/test/test_os.py    2012-06-26 14:51:36.000817929 -0400
4 @@ -677,30 +677,36 @@ if sys.platform != 'win32':
5              def test_setuid(self):
6                  if os.getuid() != 0:
7                      self.assertRaises(os.error, os.setuid, 0)
8 +                self.assertRaises(TypeError, os.setuid, 'not an int')
9                  self.assertRaises(OverflowError, os.setuid, 1<<32)
10  
11          if hasattr(os, 'setgid'):
12              def test_setgid(self):
13                  if os.getuid() != 0:
14                      self.assertRaises(os.error, os.setgid, 0)
15 +                self.assertRaises(TypeError, os.setgid, 'not an int')
16                  self.assertRaises(OverflowError, os.setgid, 1<<32)
17  
18          if hasattr(os, 'seteuid'):
19              def test_seteuid(self):
20                  if os.getuid() != 0:
21                      self.assertRaises(os.error, os.seteuid, 0)
22 +                self.assertRaises(TypeError, os.seteuid, 'not an int')
23                  self.assertRaises(OverflowError, os.seteuid, 1<<32)
24  
25          if hasattr(os, 'setegid'):
26              def test_setegid(self):
27                  if os.getuid() != 0:
28                      self.assertRaises(os.error, os.setegid, 0)
29 +                self.assertRaises(TypeError, os.setegid, 'not an int')
30                  self.assertRaises(OverflowError, os.setegid, 1<<32)
31  
32          if hasattr(os, 'setreuid'):
33              def test_setreuid(self):
34                  if os.getuid() != 0:
35                      self.assertRaises(os.error, os.setreuid, 0, 0)
36 +                self.assertRaises(TypeError, os.setreuid, 'not an int', 0)
37 +                self.assertRaises(TypeError, os.setreuid, 0, 'not an int')
38                  self.assertRaises(OverflowError, os.setreuid, 1<<32, 0)
39                  self.assertRaises(OverflowError, os.setreuid, 0, 1<<32)
40  
41 @@ -715,6 +721,8 @@ if sys.platform != 'win32':
42              def test_setregid(self):
43                  if os.getuid() != 0:
44                      self.assertRaises(os.error, os.setregid, 0, 0)
45 +                self.assertRaises(TypeError, os.setregid, 'not an int', 0)
46 +                self.assertRaises(TypeError, os.setregid, 0, 'not an int')
47                  self.assertRaises(OverflowError, os.setregid, 1<<32, 0)
48                  self.assertRaises(OverflowError, os.setregid, 0, 1<<32)
49