Summary: | net-wireless/bluez: Ebuild creates /etc/bluetooth with 0755, but bluetooth.service wants 0555. | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Matthias Nagel <matthias.nagel> |
Component: | Current packages | Assignee: | Pacho Ramos <pacho> |
Status: | UNCONFIRMED --- | ||
Severity: | minor | CC: | dev-portage, pacho, zmedico |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://github.com/bluez/bluez/issues/414 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 141619 | ||
Bug Blocks: |
Description
Matthias Nagel
2024-04-09 17:25:21 UTC
I have tried to set 555 mode via fperms / insopts... but at the end it stays as 755. Is there any restriction applied by portage to apply 555 mode? (it is true that, to me, it looks a bit stupid as root can still play with the files as with 755) Portage never adjusts the permissions on directories once they have already been created. To update the permissions for existing installations, you will need to call chmod from pkg_postinst. Really though, that mode makes no sense and should just be removed from the service file to allow the default of 0755 to be used. (In reply to Mike Gilbert from comment #2) [...] > Really though, that mode makes no sense and should just be removed from the > service file to allow the default of 0755 to be used. I agree with you, but looking to other distributions, it seemed to me that they failed to convince upstream to stop trying to enforce 0555 :S, we will probably need to carry the change downstream forever then :/ So it turns out that the upstream build system actually creates $(DESTDIR)/etc/bluetooth with the 0755 mode.
There's a hack in Makefile.am that is intended to "correct" the permissions to 0555, but that hack fails because it is calling "install -dm555" after the directory already exists.
> bluetoothd-fix-permissions:
> install -dm555 $(DESTDIR)$(confdir)
> install -dm700 $(DESTDIR)$(statedir)
It should call "chmod 555" instead.
To fix this in the ebuild, you could call fperms 0555 /etc/bluetooth at the end of the install phase. That will resolve the issue for fresh installs.
For existing installs, I would suggest you ignore the warning and let users adjust the mode manually if they so desire. The alternative is to call chmod in pkg_postinst, but that could possibly override any permissions set manually by the sysadmin.
Some other notes:
The ebuild is calling keepdir /etc/bluetooth for no apparent reason. You don't need keepdir if you are installing files under the directory.
Also, the build system seems to install files into /etc/bluetooth already, so the manual installation of those same files by the ebuild seems redundant. You should probably look into that.
|