Re: Change User ID
Re: Change User ID
- Subject: Re: Change User ID
- From: "Alastair J.Houghton" <email@hidden>
- Date: Sat, 7 Jun 2003 22:35:54 +0100
On Saturday, June 7, 2003, at 07:24 pm, Lorenzo wrote:
Hi list,
I have the user "x" on the machine "A" with the userID 501
and the same user "x" on the machine "B" with the userID 502.
When I copy a "x" user's file from the machine "A" to the machine "B"
using
a routine I downloaded from the Apple Developer Web Site
"FSCopyObject.c"
the destination file still has the userID 501, but it belongs to an
unknown
user because there is no user with the userID 501 on the machine "B".
This could also be viewed as a question about UNIX system
administration; if possible, you should use a distributed directory
system like Netinfo, NIS(+) or LDAP to hold your user database, because
then the UIDs will be the same across all of your machines, and you
won't have the problem (this is the standard solution to the problem,
and it works very well... we use NIS at work for exactly this reason).
Failing that, it's best to ensure that the users and groups remain
synchronised because that will prevent problems.
Any solution you code-up using chown() is likely to have security holes
(unless you're very careful), and there are quite a few problems to
solve... e.g. you can't assume that just because two users have the
same name they must be the same user, which brings you back to using
identifiers of some sort (or using tables to map user names, which is
effectively the same thing). Much better to do what everyone else does
and keep the numbers in step.
Kind regards,
Alastair.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.