1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-29 21:47:30 +03:00

60 Commits

Author SHA1 Message Date
Volker Lendecke
3493d9f383 r6263: Get rid of generate_wellknown_sids, they are const static and initializable
statically.

Volker
2007-10-10 10:56:33 -05:00
Tim Potter
ede9fd08cf r5909: Remove some unecessary casts. Patch from Jason Mader for bugzill #2468. 2007-10-10 10:56:08 -05:00
Günther Deschner
fdf9bdbbac r5349: After talking with Jerry, reverted the addition of account policies to
passdb in 3_0 (they are still in trunk).

Guenther
2007-10-10 10:55:38 -05:00
Günther Deschner
3d391ef149 r5264: Log with loglevel 0 when account-administration scripts fail.
Guenther
2007-10-10 10:55:35 -05:00
Günther Deschner
75af83dfcd r4925: Migrate Account Policies to passdb (esp. replicating ldapsam).
Does automated migration from account_policy.tdb v1 and v2 and offers a
pdbedit-Migration interface. Jerry, please feel free to revert that if
you have other plans.

Guenther
2007-10-10 10:55:08 -05:00
Günther Deschner
aecacf4d9c r4877: When vampiring account policy AP_LOCK_ACCOUNT_DURATION honour "Lockout
Duration: Forever".

Guenther
2007-10-10 10:55:06 -05:00
Jim McDonough
60c3a638e4 r4538: Fix bugzilla 2198, accounts which have password last set to 0 are getting
no passwords after vampire.  Set password last set field to now.
2007-10-10 10:53:46 -05:00
Günther Deschner
b209f97f24 r4353: Finally get length of munged_dial correct.
Guenther
2007-10-10 10:53:46 -05:00
Günther Deschner
98f3e3353d r4352: Base64-encode munged-dial with correct length in 'net rpc vampire'.
Guenther
2007-10-10 10:53:45 -05:00
Günther Deschner
0930ad6627 r4351: Vampire Logon-Hours. Update Logon-Hours only when they have changed.
Guenther
2007-10-10 10:53:45 -05:00
Jeremy Allison
efc1b688cf r4291: More *alloc fixes inspired by Albert Chin (china@thewrittenword.com).
Jeremy
2007-10-10 10:53:42 -05:00
Günther Deschner
721bf50d74 r4287: Vampire SAM_DELTA_DOMAIN_INFO.
Based on samba4-idl. The decoding of account-lockout-string is somewhat
experimental though.

Guenther
2007-10-10 10:53:41 -05:00
Günther Deschner
a03aa09568 r4130: add bad_password_count and logon_count to vampire (inspired by a patch
from Lars Mueller <lmuelle@suse.de>), just for completeness.

Note that though we have logon_count implemented in all pdb-backends but
never (for good reason!) update the counter.

Guenther
2007-10-10 10:53:35 -05:00
Günther Deschner
eb64eb9d57 r4127: vampire munged_dial.
Guenther
2007-10-10 10:53:35 -05:00
Jeremy Allison
620f2e608f r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
2007-10-10 10:53:32 -05:00
Tim Potter
7f161702fa r2835: Since we always have -I. and -I$(srcdir) in CFLAGS, we can get rid of
'..' from all #include preprocessor commands.   This fixes bugzilla #1880
where OpenVMS gets confused about the '.' characters.
2007-10-10 10:52:55 -05:00
Andrew Bartlett
6b629344c5 Make it possible to 'net rpc samdump' of any domain you are currently joined
to, despite any smb.conf settings.

Work to allow the same for 'net rpc vampire', but instead give a clear
error message on what is incorrect.

Andrew Bartlett
-
Andrew Bartlett
fcdc5efb1e Make more functions static, and remove duplication in the use of functions
in lib/smbpasswd.c that were exact duplicates of functions in passdb/passdb.c

(These should perhaps be pulled back out to smbpasswd.c, but that can occour
later).

Andrew Bartlett
-
Andrew Bartlett
f9e59f8bc0 JHT came up with a nasty (broken) torture case in preparing examples for
his book.

This prompted me to look at the code that reads the unix group list.  This
code did a lot of name -> uid -> name -> sid translations, which caused
problems.  Instead, we now do just name->sid

I also cleaned up some interfaces, and client tools.

Andrew Bartlett
-
Tim Potter
f899448348 Break out of samsync loop on error. -
Tim Potter
0c35ba2cd6 Fix error return path memory leaks in vampire code for creating users.
Display an error if we can't create a posix account for the user
(e.g no add user/machine script was specified; bug #323).
-
Tim Potter
d7bd3c1efb Use opt_target_workgroup instead of lp_workgroup() in vampire code so
we can override the value in smb.conf with the -w option.

Migrating accounts from another domain can now be done like:

# bin/net join bdc -w nt4dom -Uadministrator%password
# bin/net rpc vampire -w nt4dom -U administrator%password
-
Jeremy Allison
85907f02ce Turns out I had my packet sequences wrong for oplock break code.
I was storing the mid of the oplock break - I should have been
storing the mid from the open. There are thus 2 types of deferred
packet sequence returns - ones that increment the sequence number
(returns from oplock causing opens) and ones that don't (change notify
returns etc). Running with signing forced on does lead to some
interesting tests :-).
Jeremy.
-
Jeremy Allison
cb326c2dbf Cosmetic fix from waider@waider.ie.
Jeremy.
-
Jeremy Allison
0021c83ff6 Ensure all code paths set add_script.
Jeremy.
-
Tim Potter
f93528ba00 Fixup a bunch of printf-style functions and debugs to use unsigned long when
displaying pid_t, uid_t and gid_t values.  This removes a whole lot of warnings
on some of the 64-bit build farm machines as well as help us out when 64-bit
uid/gid/pid values come along.
-
Gerald Carter
837d7c54d3 fixes for 'net rpc vampire'. I can now take a blank Samba host
and migrate an NT4 domain and still logon from domain members
(tested logon scripts, system policies, profiles, & home directories)
(passdb backend = tdbsam)

removed call to idmap_init_wellknown_sids() from winbindd.c
since the local domain should be handled by the guest passdb backend
(and you don't really always want the Administrator account to be root)
...and we didn't pay attention to this anyways now.
-
Gerald Carter
0463045cc7 moving more code around.
* move rid allocation into IDMAP.  See comments in _api_samr_create_user()
  * add winbind delete user/group functions

I'm checking this in to sync up with everyone.  But I'm going to split
the add a separate winbindd_allocate_rid() function for systems
that have an 'add user script' but need idmap to give them a RID.
Life would be so much simplier without 'enable rid algorithm'.
The current RID allocation is horrible due to this one fact.
Tested idmap_tdb but not idmap_ldap yet.  Will do that tomorrow.

Nothing has changed in the way a samba domain is represented, stored,
or search in the directory so things should be ok with previous installations.

going to bed now.
-
Gerald Carter
1111bc7b0c Large set of changes to add UNIX account/group management
to winbindd.  See README.idmap-and-winbind-changes for details.
-
Andrew Bartlett
6c48309cda Add some debug statments to our vampire code - try to make it easier to track
down failures.

Add a 'auto-add on modify' feature to guestsam

Fix some segfault bugs on no-op idmap modifications, and on new idmappings that
do not have a DN to tack onto.

Make the 'private data' a bit more robust.

Andrew Bartlett
-
Andrew Bartlett
c7118cb31d Fixes to our LDAP/vampire codepaths:
- Try better to add the appropriate mapping between UID and SIDs, based
   on Get_Pwnam()
 - Look for previous users (lookup by SID) and correctly modify the existing
   entry in that case
 - Map the root user to the Admin SID as a 'well known user'
 - Save the LDAPMessage result on the SAM_ACCOUNT for use in the next 'update'
   call on that user.  This means that VL's very nice work on atomic LDAP
   updates now really gets used properly!
 - This also means that we know the right DN to update, without the extra
   round-trips to the server.

Andrew Bartlett
-
Simo Sorce
e341e7c49f Ok, this patch removes the privilege stuff we had in, unused, for some time.
The code was nice, but put in the wrong place (group mapping) and not
supported by most of the code, thus useless.

We will put back most of the code when our infrastructure will be changed
so that privileges actually really make sense to be set.

This is a first patch of a set to enhance all our mapping code cleaness and
stability towards a sane next beta for 3.0 code base

Simo.
-
Tim Potter
6053c30f26 Make net rpc vampire return an error if the sam sync RPC returns an error.
E.g if we are pointing at a win2k native mode domain we are returned
an NT_STATUS_NOT_SUPPORTED error.
-
Andrew Bartlett
d2a70bfff1 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
-
Tim Potter
47d8ee3679 Re-enable secure channel for net rpc vampire.
Jump out of sam entry processing loop if the return value from
cli_netlogon_sam_sync() isn't OK or STATUS_MORE_ENTRIES.
-
Volker Lendecke
5b3cb7725a This puts real netlogon connection caching to winbind. This becomes
important once we start doing schannel, as there would be a lot more
roundtrips for the second PIPE open and bind. With this patch logging
in to a member server is a matter of two (three if you count the
ack...) packets between us and the DC.

Volker
-
Gerald Carter
2557b94519 adding ifdef'd code to add alias membership for vampire -
Andrew Bartlett
876e00fd11 Merge from HEAD - save the type of channel used to contact the DC.
This allows us to join as a BDC, without appearing on the network as one
until we have the database replicated, and the admin changes the configuration.

This also change the SID retreval order from secrets.tdb, so we no longer
require a 'net rpc getsid' - the sid fetch during the domain join is sufficient.
Also minor fixes to 'net'.

Andrew Bartlett
-
Tim Potter
dfa9412da5 Merge: remove unused variables. -
Tim Potter
6a5b88c95b Merge of Jelmer's usage updates for net. -
Volker Lendecke
eaef0d8aef This is the netlogon schannel client code. Try a
rpcclient -S pdc -U% -c "samlogon user password"

and it should work with the schannel. Needs testing against platforms
different from NT4SP6.

Volker
-
Volker Lendecke
702d368a9a Waider's cosmetic change to print out the database type when
downloading stuff.

Volker
-
Volker Lendecke
5a3f89d3c1 This sets the domain for the user in vampire. Otherwise
we end up with an empty domain field, which a workstation
does not really like in sam_logon..

Volker
-
Andrew Bartlett
c7b8405bde Merge of patch by waider to our samsync code.
(Decode all database names, and set only changes, not all info from the samsync
record).

Andrew Bartlett
-
Andrew Bartlett
4bec53c8c8 Thanks to volker, merge passdb changes from HEAD:
- pdb_guest (including change defaults)
 - 'default' passdb actions (instead of 'not implemented' stubs in each module)

 - net_rpc_samsync no longer assumes pdb_unix

Andrew Bartlett
-
Gerald Carter
e959a8eb67 playing janitor for abartlet. :-(
"
Make the vampire code use just pdb calls - allowing better operation on systems
that are not configured with an add user script, and have an _nua backend for
storage.

We really need to get the PDB backends out of the IDMAP game...

Andrew Bartlett
"
-
Jeremy Allison
09a218a9f6 Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
-
Jeremy Allison
76cdfbd510 After the lord mayors parade......
Janitor for tridge :-).
Jeremy.
-
Jeremy Allison
6d98ac2634 Keeping 3.0 in sync....
Jeremy.
-
Andrew Bartlett
2044d60bbe Merge passdb from HEAD -> 3.0
The work here includes:
 - metze' set/changed patch, which avoids making changes to ldap on unmodified
attributes.

 - volker's group mapping in passdb patch

 - volker's samsync stuff
 - volkers SAMR changes.

 - mezte's connection caching patch

 - my recent changes (fix magic root check, ldap ssl)

Andrew Bartlett
-