Changing a user's UNIX ID

Discuss the Scalix Server software

Moderators: ScalixSupport, admin

Valerion
Scalix Star
Scalix Star
Posts: 2730
Joined: Thu Feb 26, 2004 7:40 am
Location: Johannesburg, South Africa
Contact:

Changing a user's UNIX ID

Postby Valerion » Wed Nov 23, 2005 4:35 am

I have a problem that I simply can't see the solution to.

I have bound an incorrect user account to my UNIX ID. Two Scalix accounts cannot be linked to the same UNIX ID (understandable). I want to change the ID of the incorrect one to use the dynamic Scalix ID pool.

[ommodu -o "user" -u ] doesn't do the trick - I can't specify either a numeric ID not associated with a UNIX login, or a blank. The SAC also doesn't have an option for this.

How does one go about doing this?

jch
Scalix
Scalix
Posts: 202
Joined: Thu Mar 25, 2004 10:25 am

Postby jch » Wed Nov 23, 2005 7:11 am

That's interesting. There isn't a way to do what you want, at least not directly. I'll put an enhancement request in against ommodu so I can fix it at some stage.

There is an indirect way that I've just tried out. The trick is to use at omadmidp (admin id pool). First, run omadmidp -uxv. This will give you a detailed breakdown of what IDs are in use, eg on my system it said:

Code: Select all

[OM 28612] 7 entries in the range requested are currently in use.

System Id               Scalix Id.
36000                   102
36001                   103
36002                   104
36003                   105
36004                   106
36005                   107
36007                   167

[OM 28609] 1 Scalix Id's are incorrectly registered in the system id pool
and require removal.

System Id               Scalix Id.
36006                   153

Start of block: 36000
Range of block: 5000
Used in block:  8
Since this is one of my development installations and I do appalling things to it the error is not unexpected or surprising. Anyway, from the list I can see that UID 36008 is free. I next did what you should never do; created a unix accont with that UID and set the user (called "exp") to that UID:

Code: Select all

useradd -u 36008 -g users -M exp
ommodu -o exp -u exp
userdel exp
The -M flag to useradd makes sure I don't get a home directory I don't want.

Re-running omadmidp -uxv now shows up a different error, namely:

Code: Select all

[OM 28611] 1 system id's are missing their corresponding Scalix id

System Id               Scalix Id.
36008                   0
I can just fix this with the -f flag and everything is hunky dory:

Code: Select all

# omadmidp -uxvf
[OM 28612] 8 entries in the range requested are currently in use.

System Id               Scalix Id.
36000                   102
36001                   103
36002                   104
36003                   105
36004                   106
36005                   107
36007                   167
36008                   168



Start of block: 36000
Range of block: 5000
Used in block:  8


I'd recommend trying this out on a temporary installation rather than the live one to be sure that it works OK for you and that you're confident you know what you're doing. As I was playing with a development message store I really wasn't too bothered if things went pear shaped!

jch

Valerion
Scalix Star
Scalix Star
Posts: 2730
Joined: Thu Feb 26, 2004 7:40 am
Location: Johannesburg, South Africa
Contact:

Postby Valerion » Wed Nov 23, 2005 10:08 am

Thanks a lot, this works perfectly. I should have thought of the solution myself ...

jch
Scalix
Scalix
Posts: 202
Joined: Thu Mar 25, 2004 10:25 am

Postby jch » Wed Nov 23, 2005 10:31 am

Glad to know it works for you. Many thanks for idea.

It's a lot easier now: for me anyway. I've just checked in a change that allows yo to say

Code: Select all

ommodu -o exp -u -
And I've even updated the man page :-) All being well, you'll be able to get your hands on this particular fix in the next release.

jch


Return to “Scalix Server”



Who is online

Users browsing this forum: No registered users and 27 guests