Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clipboard permission of 'true' or 'false' is not granular enough #364

Open
lestephane opened this issue Mar 15, 2023 · 3 comments
Open

clipboard permission of 'true' or 'false' is not granular enough #364

lestephane opened this issue Mar 15, 2023 · 3 comments

Comments

@lestephane
Copy link

I'm assuming that the way X11 works, there was no way to split the clipboard permission into read and write permissions.

But on the off change that there is a way, could this be improved by either supporting additional keys:

  • clipboard-read
  • clipboard-write

or by having the existing clipboard key support additional values

  • read, write, read-write
  • r, w, rw

If that is not possible due to X11, then disregard / close this issue. But if it is, it would be a great addition. This is my main use case for sandboxing (ie preventing the sandboxed app from reading the clipboard, but still being able to write to it).

@timthelion
Copy link
Contributor

I think this should be a very easy addition. Just add the new config granularity and set the direction of the clipboard in the xpra bridge https://github.com/Xpra-org/xpra/blob/master/docs/Features/Clipboard.md#configuration-options should be like 6 linesof code. If you need pointers I'd be glad to help, but don't have time to code it up myself.

@timthelion
Copy link
Contributor

You'll want to look at the following locations in the code:

  1. Update the docs and add an OrderedDict type to the clipboard permission and add a sub-permission for the clipboard direction.

  2. Set the clipboard direction flag: https://github.com/subuser-security/subuser/blob/master/subuserlib/classes/subuserSubmodules/run/x11Bridge.py#L219

  3. Test

  4. Create a pull request

  5. Profit?

@timthelion
Copy link
Contributor

Also see the developer documentation on adding permissions: https://subuser.org/developers/common-tasks.html#adding-a-new-permission

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants