Bug 16179 - owncloud wants to write to files in /usr/share/owncloud
Summary: owncloud wants to write to files in /usr/share/owncloud
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 5
Hardware: i586 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Nicolas Lécureuil
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-22 21:40 CEST by Hoyt Duff
Modified: 2017-06-07 13:52 CEST (History)
3 users (show)

See Also:
Source RPM: owncloud-8.0.3-1.mga5.noarch.rpm
CVE:
Status comment:


Attachments

Description Hoyt Duff 2015-06-22 21:40:21 CEST
Description of problem:

Mageia installs ownCloud in /usr/share/owncloud.

All files in /usr/share/owncloud should be owned by the http server, i.e. apache:apache in my case.

An upgrade from Mageia4 to Mageia5 changed ownerships and ownCloud would not run.

# chown -R apache:apache /usr/share owncloud fixed the problem.


Version-Release number of selected component (if applicable):

owncloud-8.0.3

How reproducible:

I only have the one system running ownCloud, and did a CLI upgrade per the install documentation. I do not have any more systems to attempt to reproduce the problem.

 IIRC, I need to change ownership of the directories and file the first time I installed ownCloud on Mageia4. Perhaps this is not a bug, but a quirk of the installation (as any http server can be used) that must be done manually every time?
http://maximumhoyt.blogspot.com/2014/12/howto-installa-ownclowd-on-mageia4.html

Reproducible: 

Steps to Reproduce:
Comment 1 David Walser 2015-06-23 00:40:35 CEST
All of the files are already world-readable IINM, so the ownership/permissions would only matter if Apache was trying to *write* to them.  Most of the files absolutely should *not* be owned by Apache, only ones it actually needs to write to, and those files should not be in /usr/share/owncloud, but either somewhere in /etc or /var/www.  I have noticed that there are some issues with the owncloud package regarding that that need to be fixed.  If the packaging is done properly, it should solve this issue.

Assignee: bugsquad => mageia

David Walser 2015-06-23 00:41:02 CEST

Summary: Directory permissions after upgrade are incorrect => owncloud wants to write to files in /usr/share/owncloud

Comment 2 Olivier Blin 2015-07-30 20:10:04 CEST
We already install the config file in /etc, and data dir in /var, and make a symlink to them in /usr/share/owncloud.

Since our 7.0.3 package, only /usr/share/owncloud/apps is owned by the apache group in /usr, other files in /usr/share/owncloud are properly owned by root.

I am not sure if this is really necessary to own this apps directory.
Maybe to allow custom apps installation?

Guillaume, do you remember why it has been done this way?

CC: (none) => guillomovitch, luigiwalser, mageia

Comment 3 Olivier Blin 2015-07-30 22:36:25 CEST
Ok, that's because third-party apps installed through owncloud get installed in /usr/share/owncloud/apps by default.

We should mark this dir as not writable in owncloud default config, and provide another writable app path in the default config file.
See https://doc.owncloud.org/server/8.0/admin_manual/enterprise_installation/apps_management_installation.html?highlight=apps#using-custom-app-directories

Maybe have an /usr/share/owncloud/apps_installed pointing to /var/lib/owncloud/apps_installed ?

Though, we do not provide a default config file currently we have to check how to do this. Maybe we can just write some defaults in /etc/owncloud/config.php, but we should check if owncloud correctly runs the first install after this, and keeps our settings.
Comment 4 Hoyt Duff 2015-07-30 23:06:36 CEST
ownCloud provides an example config file at /usr/share/owncloud/config/config.sample.conf

I have an example installation at http://maximumhoyt.blogspot.com/2014/12/howto-installa-ownclowd-on-mageia4.html

Which is based on an earlier example foe Mageia 4 at https://translate.google.com/translate?act=url&depth=1&hl=en&ie=UTF8&prev=_t&rurl=translate.google.com&sl=auto&tl=en&u=http://www.mageialinux-online.org/wiki/installer-votre-cloud-a-domicile-avec-owncloud

Essentially, I just 

$ sudo cp /usr/share/owncloud/config/config.sample.conf  /usr/usr/share/owncloud/config/config.conf 

The initial config file in /etc is only necessary to start the application the first time. Once you go through the web configuration, the original file is deleted and replaced with one that is created during the initial startup of ownCloud.

Getting an ownCloud server running takes some work and tweaking.

As far as file permissions go, IIRC my initial install of 6.x was from an RPM  package from Mageia. I then needed to change file ownership to apache to get it to work.  It was was when I did a distro upgrade from Mageia 4 to 5 that things went awry and I needed to change file ownership back to apache to get things to work. I just updated via their built-in updater and everything still works.

If it would be helpful to you, I can go through an ownCloud install in a Mageia5 VM without changing file ownerships and see how that works.
Comment 5 Hoyt Duff 2017-06-07 13:36:00 CEST
No longer a problem, Bug can be closed.
Comment 6 Nicolas Lécureuil 2017-06-07 13:52:41 CEST
tks. Closing.

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.