Restoring from Time Machine backup relocates home directories

Rainer Müller raimue at macports.org
Fri Sep 15 20:40:05 UTC 2017


On 2017-09-15 20:56, db wrote:
> On 15 Sep 2017, at 18:06, Ryan Schmidt <ryandesign at macports.org> wrote:
>> Not always, because many ports use local variables when setting the home directory, so you then have to find the place in the Portfile where that local variable is set. And also, many ports split the add_users invocation over multiple lines, such that the line that sets the home directory might not be on the same line that includes the string "add_users".
> 
> I ran
> 
> dscl . list /Users | grep -v ^_.*
> 
> and noticed the user messagebus, so I filtered it from
> 
> port cat all
> 
> and realised that dbus set it, but MP didn't remove it when uninstalled.
> 
> MP should also take care of that.

That would first require to track which ports actually created and need
that user, which we do not do at the moment.

Anyway, when you uninstall a port, there might still be files on the
filesystem owned by this uid. If the user is deleted, the file remain
owned by that uid. Later the uid will be reused when the next user is
created as it will be assigned the first unallocated uid. The new user
suddenly owns files it was never supposed to own.

This might not only lead to confusion, but if the original port is
installed again later, it could also cause permission problems that are
hard to debug. Leaving the uid allocated indefinitely avoids that.

Rainer


More information about the macports-dev mailing list