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

Question: How to handle dotfiles #285

Closed duerrp closed 8 years ago

duerrp commented 8 years ago

Thanks for your efforts, subuser looks very interesting!

How do you propose to handle dotfiles that should go to the subuser's home directory? Copy them there by script after installing the subuser?

timthelion commented 8 years ago

Normally on POSIX programs create dot files on startup. This can be done with subuser using a wrapper script https://github.com/subuser-security/subuser-examples/tree/master/vim-with-dotfile-autocreation . This has a very slight performance penalty due to the need to load bash before whatever you want to run. Is that performance pentalty a problem for you?

duerrp commented 8 years ago

@timthelion Thanks for the quick reply. I understand your method and I don't think the performance hit is a problem for me. For elegance points, it would be nice to have a hook to run scripts after installing a new subuser (or supply default home-dir contents), but I guess it's not crucial.

timthelion commented 8 years ago

The trouble with supplying default home dir contents (and yes, it has been discussed extensively in the Debian project) is that there is no good way of merging the new configs with the old, potentialy user modified ones. That is the reason why it is prefered to re-create configs if they are deleted. It allows the user to choose to upgrade their config files/return to a clean slate simply by deleting them.

On 04/21/16 06:39, duerrp wrote:

@timthelion https://github.com/timthelion Thanks for the quick reply. I understand your method and I don't think the performance hit is a problem for me. For elegance points, it would be nice to have a hook to run scripts after installing a new subuser (or supply default home-dir contents), but I guess it's not crucial.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/subuser-security/subuser/issues/285#issuecomment-212739409