summaryrefslogtreecommitdiff
path: root/source3/utils/net.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-06-14 00:49:02 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-06-14 00:49:02 +0000
commitb85664047c188126e3ba06862198c1acd4f218ac (patch)
treed04ccddd4370fddc7b98dc8d6d7aebd613900049 /source3/utils/net.c
parent292a51eda152f5e1885f38f3a811e956560f33f0 (diff)
downloadsamba-b85664047c188126e3ba06862198c1acd4f218ac.tar.gz
samba-b85664047c188126e3ba06862198c1acd4f218ac.tar.bz2
samba-b85664047c188126e3ba06862198c1acd4f218ac.zip
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 (This used to be commit d2a70bfff182352da50cd6c23ddfa80fe1b353c7)
Diffstat (limited to 'source3/utils/net.c')
-rw-r--r--source3/utils/net.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c
index a18d3e4285..d8f3264840 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -710,6 +710,10 @@ static struct functable net_func[] = {
exit(1);
load_interfaces();
+
+ /* this makes sure that when we do things like call scripts,
+ that it won't assert becouse we are not root */
+ sec_init();
if (opt_machine_pass) {
char *user = NULL;