Laurent Pertois’s useless blog

April 13, 2008

Imported account, group and Leopard

Filed under: Mac OS X — lolopb @ 9:10
Tags:

When I installed Mac OS X v10.5, aka Leopard, on my computer, I decided to reinstall it completely and to not update may 10.4.11. So I made a clone of this 10.4 and erased my hard drive. Then, after the installation, I imported my account using the Migration Assistant.

Everything was ok except one thing, in the Finder Info window, I had “unknown” instead of a group name. Here is what I did to have something consistent with the rest of the system…Apple made a lot of changes regarding to the default group in the different versions of Mac OS X.

In 10.0 and 10.1, every users were in the “staff” group. Then, from 10.2 to 10.4, each new account was associated to a specific group named according to the user’s short name. In 10.5, back to the beginning, everyone is in “staff”.

A subtle nuance is to be mentioned here, if your account was created in say 10.4, when you import the informations, you still have the same behaviour in 10.5, your default group is the one with your username :

$ dscl . -read /Users/laurent PrimaryGroupID
PrimaryGroupID: 501

$ dscl . -search /Groups PrimaryGroupID 501
laurent PrimaryGroupID = (
501
)

If I look using the command line to informations about a file I own, here is what I see :

$ ls -l
total 0
-rw-r--r-- 1 laurent laurent 0 Feb 23 18:32 test.txt

But, if I look at the same thing using the Finder Info window, my group name is replaced with “unknown” :

group_unknown.png

Although it seemed to work, I was a little bit upset with this… So, last week, I decided to discover why my group was unknonw in the Finder and finally discovered the reason. My group has no “RealName” attribute in the DSLocal database (which is now used to replace NetInfo) :

$ dscl . -read /Groups/laurent
AppleMetaNodeLocation: /Local/Default
GeneratedUID: 0CC6E3AD-1341-47C9-9185-9A08FA203148
Password: *
PrimaryGroupID: 501
RecordName: laurent
RecordType: dsRecTypeStandard:Groups

So, I just created this attribute and observed what happened. In order to create the Attribute, I just called my so-loved command utility, dscl :

$ sudo dscl . -create /Groups/laurent RealName Laurent

Now, my group has a “RealName” :

$ dscl . -read /Groups/laurent
AppleMetaNodeLocation: /Local/Default
GeneratedUID: 0CC6E3AD-1341-47C9-9185-9A08FA203148
Password: *
PrimaryGroupID: 501
RealName: Laurent
RecordName: laurent
RecordType: dsRecTypeStandard:Groups

And guess what ! the Finder is happy :

group_laurent.png

As a conclusion, the import script to translate NetInfo data into DSLocal is not perfect, it did a very good job but it let few “important” informations on the side of the road.

Advertisements

1 Comment »

  1. You post very interesting posts here. Your website
    deserves much more visitors. It can go viral if you
    give it initial boost, i know useful service that can help you, just search in google: svetsern traffic tips

    Comment by Audrey — January 3, 2015 @ 1:31 | Reply


RSS feed for comments on this post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: