container-structure-test icon indicating copy to clipboard operation
container-structure-test copied to clipboard

Incorrect permissions inside test container with setuid turned on

Open x-Xymos opened this issue 4 years ago • 0 comments

I'm not exactly sure if this is a bug but when running a test against an image to check the permissions of a binary executable with the setuid bit turned on, it reports different permissions to what they actually are when manually starting the container.

fileExistenceTests:
- name: 'my-test'
  path: '/app/build/usr/local/bin/my-binary'
  uid: 998
  gid: 998
  permissions: '-rwsr-xr-x'
  shouldExist: true

Error: /app/build/usr/local/bin/my-binary has incorrect permissions. Expected: -rwsr-xr-x, Actual: urwxr-xr-x

My own container:

user@my-pod-c75584fb7-4p6wh:/usr/local/sbin$ ls -latr /app/build/usr/local/bin/
total 31108
-rwsr-xr-x 1 user user 31837352 Jul 30 10:32 my-binary
drwxr-xr-x 1 user user     4096 Aug  4 14:50 ..

x-Xymos avatar Aug 05 '20 13:08 x-Xymos