Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#45737 closed defect (fixed)

dbus +no_root deleted my root account on MacOSX 10.5.8

Reported by: newchief@… Owned by: neverpanic (Clemens Lang)
Priority: High Milestone: MacPorts 2.3.4
Component: base Version: 2.3.2
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: dbus

Description

Although installation of dbus with +no_root use flag ended with error message that +no_root should not be used on my system, still actions were taken! my "System Administrator (root)" user with uid 0 was replaced by "Message Bus (root)" with uid 503. As a result, I couldn't do "sudo" anymore! Apart from shell commands that require root, all other system administrative operations seem to work. I deleted "Message Bus (root)" user from list of users being logged as my usual user (which is Administrator of this system). Now sudo says there's no root user entry in password file (well, root IS listed in /etc/passwd file, but I guess it is not where MacOSX keeps user info). System is doomed, wihout sudo, no macports anymore.

Change History (13)

comment:1 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to mcalhoun@…
Port: dbus added

I have no idea how that could have happened. If you have any idea, let us know, but I don't see any code in the dbus Portfile that could do that.

comment:2 in reply to:  description Changed 9 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Status: newassigned

What is meant by:

[M]y "System Administrator (root)" user with uid 0 was replaced by "Message Bus (root)" with uid 503.

You are saying that the root user was deleted?
Does the command

dscl . -read /Users/root

not return anything?

comment:3 Changed 9 years ago by newchief@…

I have no ideas how it could happend. I posted this ticket as a warning that such things can happen. Now I'm in the middle of system reinstallation as I need it by tomorrow morning.

comment:4 Changed 9 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

A complete reinstallation is a huge pain, and I am sorry to hear that you have to go through it.
I certainly appreciate the warning, but without more information, I do not know how to proceed.
Most of what we needed to know is probably now lost with the reinstallation.

I will post the question to the developer mailing list.

comment:5 Changed 9 years ago by newchief@…

Yeah, reinstall is now completed and most of the ports I need are also built so there's nothing left from previous system. This time I've built dbus without +no_root and I can still do 'sudo'. From what I remember: Immediately after dbus +no_root failed to install (with the message that I shouldn't have started dbus installation with +no_root), I wanted to check something in ports directory. As usual, before going to /opt/local/var/macports (in a new shell started in a new window), I typed 'sudo -s'. I was asked for password (this was before I deleted "Message Bus (root)" user), typed it and... got regular user shell (with '$' prompt, not '#' that I expected). Although whoami said it is 'root', I coudln't do anything that requires 'root' assistance, e.g. I couldn't do 'mkdir /bin/something'. The rest now is a history.

comment:6 Changed 9 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: invalid
Status: assignedclosed

With no insight from the mailing list, I am not sure what more can be done.
I am therefore closing the ticket.
With any luck, this is a highly unusual occurrence.

comment:7 Changed 9 years ago by neverpanic (Clemens Lang)

Priority: NormalHigh
Resolution: invalid
Status: closedreopened

This is caused by both a problem in the dbus port and the way base checks for existing users. I found the code path that breaks this and will commit a fix shortly.

Meanwhile do *not* try to install dbus +no_root in a root installation of MacPorts, because it *will* break your root user.

comment:8 Changed 9 years ago by neverpanic (Clemens Lang)

Cc: mcalhoun@… added
Owner: changed from mcalhoun@… to cal@…
Status: reopenednew

comment:9 Changed 9 years ago by neverpanic (Clemens Lang)

Status: newassigned

comment:10 Changed 9 years ago by neverpanic (Clemens Lang)

I committed an emergency workaround to the dbus port in r135848 and r135849. Proper fix in base to come.

comment:11 Changed 9 years ago by neverpanic (Clemens Lang)

Fixed in r135851. I'll backport this to the latest release branch, too.

comment:12 Changed 9 years ago by neverpanic (Clemens Lang)

Component: portsbase
Milestone: MacPorts Future
Resolution: fixed
Status: assignedclosed

Backported to the 2.3.x branch in r135852. This will be part of the next release, whether that's 2.3.4 or 2.4.0.

comment:13 Changed 9 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 2.3.4
Note: See TracTickets for help on using tickets.