#617 display suid bit in web ui
Merged 4 years ago by mikem. Opened 4 years ago by tkopecek.
tkopecek/koji issue616  into  master

file modified
+1 -1
@@ -66,7 +66,7 @@ 

  

  test:

  	coverage erase

- 	PYTHONPATH=hub/.:plugins/hub/.:plugins/builder/.:plugins/cli/.:cli/. coverage run \

+ 	PYTHONPATH=hub/.:plugins/hub/.:plugins/builder/.:plugins/cli/.:cli/.:www/lib coverage run \

  	    --source . /usr/bin/nosetests

  	coverage report

  	coverage html

@@ -0,0 +1,18 @@ 

+ import unittest

+ 

+ from kojiweb.util import formatMode

+ 

+ class TestFormatMode(unittest.TestCase):

+     def test_format_mode(self):

+         formats = (

+             ('drwxrwxr-x', 0x41fd), # dir

+             ('-rw-------', 0x8180), # reg. file

+             ('crw--w----', 0x2190), # /dev/tty0

+             ('brw-rw----', 0x61b0), # /dev/sda

+             ('lrwxrwxrwx', 0xa1ff), # symlink

+             ('srwxr-xr-x', 0xc1ed), # socket

+             ('-rwsrwsr--', 0x8db4), # suid

+         )

+ 

+         for s, mode in formats:

+             self.assertEqual(formatMode(mode), s)

file modified
+5
@@ -459,6 +459,11 @@ 

              else:

                  result += '-'

  

+     if mode & stat.S_ISUID:

+         result = result[:3] + 's' + result[4:]

+     if mode & stat.S_ISGID:

+         result = result[:6] + 's' + result[7:]

+ 

      return result

  

  def rowToggle(template):

Commit 8f78389 fixes this pull-request

Pull-Request has been merged by mikem@redhat.com

4 years ago