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

subuser install should show a program's permissions in a nicely formatted way, like in android. #17

Closed timthelion closed 10 years ago

peter1000 commented 10 years ago

What do you mean by that: output the permission json file content or something completely different

timthelion commented 10 years ago

Yeah, just print the content of the file in a nice way.

timthelion commented 10 years ago

The hard part about this commit, is making commands like update(which end up installing a bunch of programs) not print that information ;)

peter1000 commented 10 years ago

I do not really understand the purpose of install to print it: because the program runs already...

would it not make more sense to have an separate command for just showing this or do it with subuser list --fullor something like that

anyway I probably missunderstand the purpose

timthelion commented 10 years ago

This isn't an important feature. The only reason I put it on the list, is that android does this, it shows you what permissions a program will have once it is installed, at install time, so I thought it might be nice to have that here as well. I don't personally care at all though.

peter1000 commented 10 years ago

In my opinion there is usually to much console output when one installs the program:

but maybe at the very end: might look into it if I find a fast way - still have some couple of minutes for today

peter1000 commented 10 years ago

My Suggestion

Refactor the many subprocessCheckedCall to subuser commands actually it would be much better to call the relevant function from code (might need some adjustments)

This is a fast grep output

grep -nHIirF -- "subuser" (in directory: /home/workerm/subuser/logic/subuserCommands)
./update:64: subuserlib.utils.subprocessCheckedCall(["subuser","uninstall",program])
./update:67: subuserlib.utils.subprocessCheckedCall(["subuser","install",program])
./update:150:   subprocess.call(["subuser","install",program])
./subuserlib/dockerImages.py:15:  utils.subprocessCheckedCall(["subuser","install",programName])
./clean:37:   subuserlib.utils.subprocessCheckedCall(["subuser","uninstall",program])
./install-from-registry:32:   subuserlib.utils.subprocessCheckedCall(["subuser","install",program,"--from-cache"])
./install-from-registry:34:   subuserlib.utils.subprocessCheckedCall(["subuser","install",program])
Search completed with 7 matches.

if the functions are called in a prober python way: you can most of the things much easier

peter1000 commented 10 years ago

Had a nice idea: I think .

peter1000 commented 10 years ago

output something like:

workerm@notebook:~$ subuser install vim
vim is already installed.

========= PERMISSION.json for: <vim> =========

{
  "description": "A simple powerful text editor", 
  "maintainer": "Timothy Hobbs <timothyhobbs (at) seznam dot cz>", 
  "last-update-time": "2014-02-12-12:59", 
  "executable": "/usr/bin/vim", 
  "x11": false, 
  "inherit-working-directory": true, 
  "allow-network-access": false
}
workerm@notebook:~$ 

only for explicit installed programs

timthelion commented 10 years ago

I'm closing this for now, after: https://github.com/subuser-security/subuser/commit/920d9aa35991e85ed94b85b8b677dd8b382c26cf