Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 632122 - net-misc/gerbera: insufficient permissions for writing to /etc/gerbera/config.xml
Summary: net-misc/gerbera: insufficient permissions for writing to /etc/gerbera/config...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ian Whyman (thev00d00) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-27 08:31 UTC by BT
Modified: 2018-09-11 04:11 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,5.87 KB, text/plain)
2017-09-27 08:31 UTC, BT
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BT 2017-09-27 08:31:01 UTC
Created attachment 496622 [details]
emerge --info

When using OpenRC Gerbera fails to start with the following error:

ERROR: could not open file /etc/gerbera/config.xml for writing : Permission denied

This is because the Gerbera ebuild sets the /etc/gerbera/config.xml permissions to 0640 and the ownership to root:gerbera, but the process is runs as gerbera:gerbera. The permissions should be changed to 0660, or the ownership to gerbera:gerbera.
Comment 1 Ian Whyman (thev00d00) (RETIRED) gentoo-dev 2017-09-27 10:11:39 UTC
I think this is a Gerbera bug, it doesn't need to write this file if it exists, so it shouldn't die, just open it read only.
Comment 2 BT 2017-09-27 10:20:39 UTC
The Gerbera ebuild installs a config.xml file with an empty <udn> tag, so Gerbera needs write access on first start to fill in uuid.
Comment 3 Ian Whyman (thev00d00) (RETIRED) gentoo-dev 2017-09-27 11:12:41 UTC
So it does... Writing to your own config file feels pretty wrong to me.

Perhaps we should add a pkg_postinst call to generate a UDN if its not present in the config.
Comment 4 BT 2017-10-03 05:29:36 UTC
We also need to consider that a user can remove or incorrectly edit the <udn> tag. So relying on pkg_postinst might not be the best option.
Comment 5 Rob 2017-12-05 02:16:41 UTC
Although I do agree with the remarks about the behaviour of this package and program, it explicitly does die because its config is not write-accessible with this message in its log:

ERROR: could not open file /etc/gerbera/config.xml for writing : Permission denied

Unless the permissions are adjusted by the ebuild, such as by using chmod 0660, then the necessity for Gerbera to write to its own config file needs to be alleviated at install time.
Comment 6 Ian Whyman (thev00d00) (RETIRED) gentoo-dev 2017-12-06 09:51:59 UTC
Raised upstream as https://github.com/gerbera/gerbera/issues/196
Comment 7 Ian Whyman (thev00d00) (RETIRED) gentoo-dev 2018-05-12 08:51:10 UTC
This is fixed with 1.2.0, as it no longer tries to write that file.
Comment 8 BT 2018-05-20 05:20:56 UTC
(In reply to Ian Whyman (thev00d00) from comment #7)
> This is fixed with 1.2.0, as it no longer tries to write that file.

Gerbera 1.2.0 can't auto fill the empty <udn> tag that exists in the default config.xml file. This results in new Gerbera installs to fail with the following error:

ERROR: Config: option not found: /server/udn

The default config.xml should be updated with the <udn> tag set to a valid UUID.
Comment 9 Yury German Gentoo Infrastructure gentoo-dev 2018-09-11 04:11:16 UTC
BT: 

To get it working is simple... 

run <gerbera --create-config>

You can redirect the output to /etc/gerbera/config.xml
Ten edit the file and remove everything in between <home></home> it puts information there from (https://github.com/gerbera/gerbera/issues/209)

Then it should be working just fine.