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

Relax tmp/* permission to 0770 (solves #7354). #7355

Closed

Conversation

derSascha
Copy link

I am running piwik embedded into different virtual host, running as different users which are all members of a piwik group. This results in permission problems writing to tmp/* files.

Commit 6c6e5e9 / #5034 overwrites the umask settings and restricts the group write permission.

Might no big problem to allow group members to write on directories which they can already read.

@mattab
Copy link
Member

mattab commented Mar 20, 2015

Hi @derSascha

thanks for suggestion.

I'm curious to learn more because it's the first report about this issue.

This results in permission problems writing to tmp/* files.

Could you post the error messages?

@mattab mattab added this to the Short term milestone Mar 20, 2015
@mattab mattab added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Mar 20, 2015
@derSascha
Copy link
Author

HI @mattab

error message: Piwik couldn't write to some directories...

ls -l piwik-current/tmp
drwxr-x---  2 www-piwik     www-piwik 4096 Mar 26 21:23 assets
drwxr-x---  3 www-piwik     www-piwik 4096 Mar 26 21:21 cache
drwxr-x---  2 www-piwik-adm www-piwik 4096 Mar 26 21:23 logs
drwxr-x---  2 www-piwik-adm www-piwik 4096 Mar 26 21:23 tcpdf
drwxr-x--- 38 www-piwik-adm www-piwik 4096 Mar 26 21:23 templates_c

My setup runs the tracking code as piwik user (more threads, less memory per thread) and the admin ui as piwik-adm user (threads ondemand with more memory). This ends up with permission trouble and i have to run chmod -R g+w tmp/* to fix the permission (both users are in the same piwik group).

@derSascha derSascha force-pushed the 7354-tmp-group-write-permission branch from c42f5f2 to ce6f7b5 Compare April 2, 2015 14:33
@tsteur
Copy link
Member

tsteur commented Apr 7, 2015

Shouldn't it fallback anyway in case 750 is not enough? See https://github.com/piwik/piwik/blob/2.13.0-b1/core/Filesystem.php#L90-L96

Maybe this doesn't work correctly? I reckon it would be better here to be a bit paranoid and try 750 by default and if it doesn't work 770. Maybe we should try there 770 as well?

@mattab mattab added Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels Apr 22, 2015
@danmichaelo
Copy link

👍
My Nginx uses the www-data user, so when I try to run the console utility as myself I get

  [InvalidArgumentException]
  The directory "/var/www/sites/piwiki-2.14.3/tmp/cache/tracker/" is not writable.

I really don't want to do sudo -H -u www-data bash -c './console', so I applied the patch from @derSascha , but I would love to see this merged.

@mattab
Copy link
Member

mattab commented Jul 25, 2016

Thank you for this proposed pull request.

Because it was last updated more than one month ago, it is our policy to close pull requests opened for a long time without updates. If you would like to continue work on the pull request, please simply ping us to have it re-opened (after you have pushed a new commit).

We hope you understand this and we look forward to seeing an update from you on this pull request or another one!

Thanks.

@mattab mattab closed this Jul 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants