subuser-security / subuser

Run programs on linux with selectively restricted permissions.
http://subuser.org
GNU Lesser General Public License v3.0
890 stars 65 forks source link

Weird lock file issue when testing for race conditions #326

Open timthelion opened 7 years ago

timthelion commented 7 years ago
Welcome to the pre-release checklist!
To run without installing prerequesits for xpra-bridge test,
set the NO_XPRA_BRIDGE env var.
Please touch the device.
Starting xpra server...
Starting xpra client...
mkdir: cannot create directory ‘./test/mock-home’: File exists
Would you like to test the XPRA-X11 bridge? (Takes a long time) [y/n] y

Adding subuser xterm with image xterm@default
Verifying subuser configuration.
xterm: would like to have the following permissions:
 Prelude:
  - description: A trivial terminal emulator
  - maintainer: Timothy Hobbs <timothyhobbs (at) seznam dot cz>
  - executable: /usr/bin/xterm
 Conservative permissions(These are safe):
  - basic-common-permissions: 
   * To have its own home directory where it can save files and settings.
   * To find out which language you speak and what region you live in.
   * To find out your current timezone.
 Moderate permissions(These are probably safe):
  - gui: To be able to display windows.
   * To be able to access the host's clipboard.
   * To be able to change the mouse's cursor icon.
   * The border color will be red
  - access-working-directory: To access the directory from which it was launched.
  - allow-network-access: To access the network/internet.
A - Accept and apply changes
E - Apply changes and edit result
r - Reject permissions.
Please select an option:A
Checking if images need to be updated or installed...
Checking if subuser xterm is up to date.
Checking if subuser !service-subuser-xterm-xpra-server is up to date.
Checking if subuser !service-subuser-xterm-xpra-client is up to date.
New images for the following subusers need to be installed:
!service-subuser-xterm-xpra-client
!service-subuser-xterm-xpra-server
xterm
Installed new image <sha256:8dca3b4d15518722c90f624e939e6ca4661f38188b12252c5e31c04b31e096a3> for subuser !service-subuser-xterm-xpra-client
Installed new image <sha256:3c083aa777a1b16fcd5fd9051fa9c756fe187971b682868423581a09dbe8865c> for subuser !service-subuser-xterm-xpra-server
Installed new image <sha256:9076498dcae5109a13587b5546a66562aa2ef6e7415a958e6a1f8ea19339f0b3> for subuser xterm
Verify complete.
The following subusers are registered.
Subuser: xterm
------------------
xterm@default
Docker image Id: sha256:9076498dcae5109a13587b5546a66562aa2ef6e7415a958e6a1f8ea19339f0b3
 Prelude:
  - description: A trivial terminal emulator
  - maintainer: Timothy Hobbs <timothyhobbs (at) seznam dot cz>
  - executable: /usr/bin/xterm
 Conservative permissions(These are safe):
  - basic-common-permissions: 
   * To have its own home directory where it can save files and settings.
   * To find out which language you speak and what region you live in.
   * To find out your current timezone.
 Moderate permissions(These are probably safe):
  - gui: To be able to display windows.
   * To be able to access the host's clipboard.
   * To be able to change the mouse's cursor icon.
   * The border color will be red
  - access-working-directory: To access the directory from which it was launched.
  - allow-network-access: To access the network/internet.

2
1
3
Action run does not exist. Try:
 subuser subuser --help
Starting xpra server...
6
5
4
Starting xpra client...
9
7
8
Starting xpra server...
                       /usr/bin/xterm: Xt error: Can't open display: unix:100
                                                                             /usr/bin/xterm: Xt error: Can't open display: unix:100
/usr/bin/xterm: Xt error: Can't open display: unix:100
Starting xpra client...
                       Warning: locale not supported by C library, locale unchanged
Error in lock file. Failed to release lock:

                                           Expecting value: line 1 column 1 (char 0)
                                                                                    Starting xpra server...
            /usr/bin/xterm: Xt error: Can't open display: unix:100
/usr/bin/xterm: Xt error: Can't open display: unix:100
/usr/bin/xterm: Xt error: Can't open display: unix:100
Starting xpra client...
                       Warning: locale not supported by C library, locale unchanged
/usr/bin/xterm: fatal IO error 11 (Resource temporarily unavailable) or KillClient on X server "unix:100"
Traceback (most recent call last):
                                    File "./logic/subuser", line 52, in <module>
                                                                                Traceback (most recent call last):
                     File "./logic/subuser", line 52, in <module>
                                                                     command(sys.argv[2:])
                                                                                            File "/home/timothy/pu/projects/subuser/logic/subuserlib/builtInCommands/run.py", line 90, in runCommand
          command(sys.argv[2:])
                                 File "/home/timothy/pu/projects/subuser/logic/subuserlib/builtInCommands/run.py", line 90, in runCommand
                                          Traceback (most recent call last):
                                                                              File "./logic/subuser", line 52, in <module>
                               command(sys.argv[2:])
                                                      File "/home/timothy/pu/projects/subuser/logic/subuserlib/builtInCommands/run.py", line 90, in runCommand
                                                                   runtime.run(argParser.subuserArgs)
          runtime.run(argParser.subuserArgs)
                                              File "/home/timothy/pu/projects/subuser/logic/subuserlib/classes/subuserSubmodules/run/runtime.py", line 337, in run
                                                                     File "/home/timothy/pu/projects/subuser/logic/subuserlib/classes/subuserSubmodules/run/runtime.py", line 337, in run
                                                                                              runtime.run(argParser.subuserArgs)
                                   File "/home/timothy/pu/projects/subuser/logic/subuserlib/classes/subuserSubmodules/run/runtime.py", line 337, in run
                                                            return reallyRun()
                                                                                File "/home/timothy/pu/projects/subuser/logic/subuserlib/classes/subuserSubmodules/run/runtime.py", line 321, in reallyRun
                return reallyRun()
                                    File "/home/timothy/pu/projects/subuser/logic/subuserlib/classes/subuserSubmodules/run/runtime.py", line 321, in reallyRun
                                                                   self.subuser.x11Bridge.removeClient()
           File "/home/timothy/pu/projects/subuser/logic/subuserlib/classes/service.py", line 113, in removeClient
                       self.subuser.x11Bridge.removeClient()
                                                              File "/home/timothy/pu/projects/subuser/logic/subuserlib/classes/service.py", line 113, in removeClient
                                                                          return reallyRun()
                                                                                              File "/home/timothy/pu/projects/subuser/logic/subuserlib/classes/subuserSubmodules/run/runtime.py", line 321, in reallyRun
                              raise RemoveClientException("The client-counter is already zero. Client cannot be removed! \n" + str(serviceStatus))
                                                   subuserlib.classes.service.RemoveClientException: The client-counter is already zero. Client cannot be removed! 
                                                                    OrderedDict([('client-counter', -1), ('xpra-server-service-cid', 'cd1faa67bdceb874a9205755c42d116d7dfc52d598dba1257d5b964e23082613'), ('xpra-client-service-cid', '49686d5271ad5773b5067709fd511c2dc23a338f0df04340c44475b9ba3ad760')])
                  raise RemoveClientException("The client-counter is already zero. Client cannot be removed! \n" + str(serviceStatus))
                                       subuserlib.classes.service.RemoveClientException: The client-counter is already zero. Client cannot be removed! 
                                                        OrderedDict([('client-counter', -1), ('xpra-server-service-cid', 'cd1faa67bdceb874a9205755c42d116d7dfc52d598dba1257d5b964e23082613'), ('xpra-client-service-cid', '49686d5271ad5773b5067709fd511c2dc23a338f0df04340c44475b9ba3ad760')])
      self.subuser.x11Bridge.removeClient()
                                             File "/home/timothy/pu/projects/subuser/logic/subuserlib/classes/service.py", line 113, in removeClient
                                                         raise RemoveClientException("The client-counter is already zero. Client cannot be removed! \n" + str(serviceStatus))
                                                                              subuserlib.classes.service.RemoveClientException: The client-counter is already zero. Client cannot be removed! 
OrderedDict([('client-counter', -1), ('xpra-server-service-cid', 'cd1faa67bdceb874a9205755c42d116d7dfc52d598dba1257d5b964e23082613'), ('xpra-client-service-cid', '49686d5271ad5773b5067709fd511c2dc23a338f0df04340c44475b9ba3ad760')])
                                         Error in lock file. Failed to release lock:

                                                                                    Expecting value: line 1 column 1 (char 0)
                              Removing subuser xterm
                                                     If you wish to remove the subusers home directory, issule the command $ rm -r /home/timothy/pu/projects/subuser/test/mock-home/.subuser/homes/xterm
           If you wish to remove the subusers image, issue the command $ subuser remove-old-images
   Verifying subuser configuration.
                                                                    Unregistering any non-exist                     Removing left over permissions for no-longer extant subuser !service-subus                    Removing left over permissions for no-longer extant subuser !service-subuse                                                                                  Running garba                                         Clearing directory /home/timothy/pu/projects/subuser/t                                      Clearing directory /home/timothy/pu/projects/subuser/test                               Verify complete.
                                               
Adding subuser foo with image foo@/home/timothy/pu/projects/subuser/test/test-repos/default-test-repo
      Verifying subuser configuration.
                                                                       Unregistering any non-ex                        foo: would like to have the following permissions:
                                                                           Prelude:
                                                                                     - executable: /usr/bin/foo
                  - entrypoints: 'foo', 'bar'
                                             A - Accept and apply changes
                                                                         E - Apply changes and edit result
           r - Reject permissions.
                                  Please select an option:Error in lock file. Failed to release lock:

      Expecting value: line 1 column 1 (char 0)