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

The specified daemonUser is not the owner of the installation directory #129

Closed
aparkinson opened this issue Jan 11, 2014 · 10 comments
Closed

Comments

@aparkinson
Copy link
Contributor

Packages built not using root as the daemonUser don't have ownership or permissions to access the installation directory of the Application or Service.

The present workaround has been to provide a postinst file containing chown -R <user>:<group> /usr/share/<appname>

@muuki88
Copy link
Contributor

muuki88 commented Jan 12, 2014

Bash addition

This would be an easy option. Ordering in the postinst will be crucial:

# 1. Create all user (daemonUser, too)
...
# 2. Default chown
chown -R <user>:<group> /usr/share/<appname>
# 3. Custom packageMappings
chown <user>:<group> /usr/share/<appname>/specific/file

Altering packageMappings

The second option would be to alter the packageMappings. However it will be very hard to figure out what should be altered and what not. If we decided to alter every packageMapping (in Debian/Linux) this behavior must be configurable (turn off, do everything manually).

The big advantage is, that all folders that created are managed (e.g ``etc/defaultor/var/log/`)

Summary

I would go for option 2 as it is a more general approach, however this must be well documented as a lot of magic happens behind the scenes.

@aparkinson
Copy link
Contributor Author

I agree with Option 2 as I did a little code investigation before filling the ticket. Option 1 was trivial to implement for the Server Archetype but I thought it could be brittle and there are a few TODO comments in the code for handling file ownership

@jsuereth
Copy link
Member

Yeah, option #2 is what I think as well..

@kardapoltsev
Copy link
Member

I think we should add another settings for user, because daemonUser shouldn't owned installation directory. It may be insecure, IMHO.

@muuki88
Copy link
Contributor

muuki88 commented Jan 24, 2014

@kardapoltsev . Can you go into more detail? The daemonUser will execute the application, so I must be able to execute the start script and read all other files. What would you suggest?

@kardapoltsev
Copy link
Member

I think that daemonUser should be able to read files but not write. Since default permissions is 755, anybody could read files in install location.

@muuki88
Copy link
Contributor

muuki88 commented Jan 24, 2014

But with 755 this is always the. Independent of the daemonUser. Still there's room for improvement, I read a bit in on debian.org

Especially the second link is very useful. I will try to integrate some of this in our postinst-template.

aparkinson added a commit to hindsightsoftware/sbt-native-packager that referenced this issue Jan 25, 2014
@aparkinson
Copy link
Contributor Author

I've started some basic work on this item but I would like a sanity check before I go to far down the rabbit hole.... see #139

@muuki88
Copy link
Contributor

muuki88 commented Jan 26, 2014

@jsuereth , should we create features branches directly in this repository or continue using our forks?

@jsuereth
Copy link
Member

@muuki88 You can throw feature branches in this repo, that way it's a bit easier for us to coordinate together and share code. You can issue PRs against a feature branch easily too.

The only caveat is after a feature branch is merged, then we should ensure we delete it :)

muuki88 added a commit that referenced this issue Jan 30, 2014
…-files

Change the default owner of packaged files. See #129
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

4 participants