Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 222551 - sys-apps/dbus: messagebus user created too late
Summary: sys-apps/dbus: messagebus user created too late
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Freedesktop bugs
URL:
Whiteboard:
Keywords:
: 296367 (view as bug list)
Depends on:
Blocks: 281640 291273 309349
  Show dependency tree
 
Reported: 2008-05-17 20:19 UTC by Tim Yamin
Modified: 2010-03-26 09:41 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Yamin 2008-05-17 20:19:13 UTC
Currently the messagebus group is created in pkg_preinst. Because this is after the compile stage, /usr/libexec/dbus-daemon-helper is merged with a group of root (instead of messagebus) and it does not work when the dbus daemon tries to execute it.

Confirmed fix would be to create the user and group in pkg_setup instead.
Comment 1 Steev Klimaszewski (RETIRED) gentoo-dev 2008-10-06 00:59:23 UTC
steev@hakkar ~ $ ls -l /usr/libexec/dbus-daemon-launch-helper 
-rws--x--- 1 root messagebus 83584 Sep 28 23:23 /usr/libexec/dbus-daemon-launch-helper

What is your setup, because it worked fine here, on a fresh install...
Comment 2 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-11-23 21:15:43 UTC
Not knowing which version you are refering too, I've checked 1.3.0.
After checking that dbus does the chmod suid of this file in src_install, I checked autotools and the chmod indeed occurs in install-local-data target which means that if the user is created in pkg_preinst, the user/group exists at src_install time and the chmod succeeds.
This also works in the binpkg case.

Please attach a full build.log and emerge --info if you can reproduce this problem.
Comment 3 Jonathan Callen (RETIRED) gentoo-dev 2009-11-23 22:20:33 UTC
(In reply to comment #2)
> which means that if the user is created in pkg_preinst, the user/group exists
> at src_install time and the chmod succeeds.

I believe you are mistaken in that regard; pkg_preinst is called after src_install.

The order is pkg_setup [src_unpack [src_prepare src_configure] src_compile src_install] pkg_preinst <merge> pkg_postinst.
Comment 4 Tim Yamin 2009-11-23 23:04:40 UTC
Reopening as per comment #3.
Comment 5 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-11-24 00:02:21 UTC
still no info worth re-opening.
Comment 6 Doug Goldstein (RETIRED) gentoo-dev 2009-11-24 03:19:54 UTC
You should always attempt to create users in pkg_setup and pkg_preinst due to issues like this an to properly support binary packages.

Resolving this issue was the point of GLEP 27 and why I've tried to bring up GLEP 27 again.

If you need more info about this Gilles, please contact me on IRC.
Comment 7 Doug Goldstein (RETIRED) gentoo-dev 2009-11-24 03:20:48 UTC
Which brings up another point. I've corrected this behavior at least twice over the life of D-Bus when I maintained it. When this is fixed again, put a comment in there that it shouldn't ever be removed again.
Comment 8 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-12-01 00:04:42 UTC
Thinking about this bug, I figured out why in the general case it is good to have user created in both phases. In this specific cases though I cannot reproduce the problem. Can anyone tell me the problem can be reproduced ? (as in this is not a GLEP tracker or you may want to convert it to be one)
Comment 9 Doug Goldstein (RETIRED) gentoo-dev 2009-12-01 01:50:18 UTC
(In reply to comment #8)
> Thinking about this bug, I figured out why in the general case it is good to
> have user created in both phases. In this specific cases though I cannot
> reproduce the problem. Can anyone tell me the problem can be reproduced ? (as
> in this is not a GLEP tracker or you may want to convert it to be one)
> 

The GLEP is GLEP 27. The issue is that the current way you've changed it is completely wrong.

I'll just fix it myself. If you want details, read gentoo-dev about user/group creation issues, read old bugs about dbus user/group creation and in general talk to devs that have been around the block (i.e. ask solar about binpkg support).
Comment 10 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-12-01 09:42:11 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > Thinking about this bug, I figured out why in the general case it is good to
> > have user created in both phases. In this specific cases though I cannot
> > reproduce the problem. Can anyone tell me the problem can be reproduced ? (as
> > in this is not a GLEP tracker or you may want to convert it to be one)
> > 
> 
> The GLEP is GLEP 27. The issue is that the current way you've changed it is
> completely wrong.

did I ? This "fix" is absent from ebuilds since at least dbus-1.0.0 afaics which pre-dates my contributions to this ebuild by a long shot.

> I'll just fix it myself.

I didn't say I won't fix it nor am I questioning the logic behind GELP 27 (which looks perfectly fine as I said), I'm merely asking for more details since I obviously fail to reproduce the problem, is that too much to ask, really ?
Comment 11 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-12-10 21:56:50 UTC
*** Bug 296367 has been marked as a duplicate of this bug. ***
Comment 12 Chris Beswick 2010-02-20 21:01:18 UTC
with sys-apps/dbus-1.3.0-r1 the permissions for...

/usr/libexec/dbus-daemon-launch-helper

are missing the set group id permission, which results in at least gnome-panel being unable to determine if the user has permission to shutdown or restart the system via consolekit and policykit resulting in the menu item for "Shutdown" not being displayed.

This can be "fixed" by running chmod u+s /usr/libexec/dbus-daemon-launch-helper however I assume this should be done on emerge.

This is running on a fresh system installed, with ~amd64 and installed from the latest stage3 on the 18th feb 2010.
Comment 13 Boyd Waters 2010-03-02 03:49:25 UTC
FWIW, me, too...

$ ls -l /usr/libexec/dbus-daemon-launch-helper
-rws--x--- 1 root root 50984 Jan 13 21:01 /usr/libexec/dbus-daemon-launch-helper

Resulted in numerous crashes, including Gnome-Disk-Utility not able to start.

I fixed it by setting o+x on dbus-daemon-launch-helper.

Note that it isn't owned by group messagebus.

*  sys-apps/dbus
      Latest version available: 1.3.0-r1
      Latest version installed: 1.3.0-r1

$ eselect profile list
Available profile symlink targets:
  [1]   default/linux/amd64/10.0
  [2]   default/linux/amd64/10.0/desktop *
...
Comment 14 Pacho Ramos gentoo-dev 2010-03-26 09:31:38 UTC
(In reply to comment #10)
> I'm merely asking for more details
> since I obviously fail to reproduce the problem, is that too much to ask,
> really ?
> 

Guilles, from where can people get that details? jlec has attached a dbus build.log file in http://bugs.gentoo.org/attachment.cgi?id=225305&action=view , maybe it can help
Comment 15 Samuli Suominen (RETIRED) gentoo-dev 2010-03-26 09:41:26 UTC
+  26 Mar 2010; Samuli Suominen <ssuominen@gentoo.org> dbus-1.2.24.ebuild,
+  dbus-1.3.0-r1.ebuild:
+  Don't unpack() in src_prepare and create messagebus user in pkg_setup()
+  wrt #222551 by Tim Yamin.