This patch modifies 'net rpc vampire' to add new and existing users to both
commitd2a70bfff182352da50cd6c23ddfa80fe1b353c7
authorAndrew Bartlett <abartlet@samba.org>
Sat, 14 Jun 2003 00:49:02 +0000 (14 00:49 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 14 Jun 2003 00:49:02 +0000 (14 00:49 +0000)
tree41dccb2dc00db75ee96caf217fab218cf9b81d2e
parent8bcc3116a22ce11b55a35f3363230f54bc5735fc
This patch modifies 'net rpc vampire' to add new and existing users to both
the idmap and the SAM.

The basic idea is this:  Lookup the user with GetPwnam(), and if they
exist then use that uid.  This is what people expect.  If the user does
not exist, try and run the right script.

This is also what people expect from previous Samba 3.0 behaviour, where
the Get_Pwnam() was at runtime.

If the idmap entry for this SID isn't valid, or isn't the right value,
modify the idmap to account for this mapping.

Also, the same logic is applied to the primary gid - if it has changed,
update the user's primary unix group.

This patch allows users to be added without a mapping - this is fine for
machine accounts, for example.  I've given it a quick test against my
Win2k DC, and I *think* it's sane.

Andrew Bartlett
source/utils/net.c
source/utils/net_rpc_samsync.c