1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

569 Commits

Author SHA1 Message Date
Jeremy Allison
842e08e52a Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
6b18ca9511 merge of get_dc_name()-like code from APP_HEAD; better support password server = DC1 * 0001-01-01 00:00:00 +00:00
Herb Lewis
243763d6eb use FILE_MACRO instead of __FILE__
use FUNCTION_MACRO instead of __FUNCTION_
0001-01-01 00:00:00 +00:00
Andrew Bartlett
5b1185b4e8 Move from NT_STATUS_UNSUCCESSFUL to NT_STATUS_NO_SUCH_USER, and other slightly
more useful error codes.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d076823c73 fixed a number of places where we can try to free a wild pointer or
look for the record count after an invalid search. This fixes a segv
in ldapsam
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
2addbaff35 Use smb_register_passdb() - plus some small fixes 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
b5b3b2e6be Add smb_register_passdb() 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
f6ef18df11 Remove the #ifdef's for NISPLUS_SAM - there are no function name collisions anymore 0001-01-01 00:00:00 +00:00
Jeremy Allison
82b8f749a3 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
21530f06b2 More improvement of DEBUG output 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
79207d5692 Add extra debug info 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
f4110a0f80 Print the number of returned rows, not the number of fields 0001-01-01 00:00:00 +00:00
Andrew Bartlett
205209f77f Make smbpasswd use the group mapping, and fix spelling in ldapsam.
This gets user mangler for doamins working again.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
3c39bd9db0 Fix small typo 0001-01-01 00:00:00 +00:00
Andrew Tridgell
fb79fa5a31 when doing a 'net rpc vampire' a pdb_init_sam_pw() is used to create a
sam account object, then pdb_update_sam_account() can be used to
update an account. This code path could lead to the methods element of
the account being used when uninitialised (leading to a segv)

Easiest fix is to always make that that when creating a sam_account
object we initialise the methods to null, so that the passdb code
knows that it needs to be filled in.
0001-01-01 00:00:00 +00:00
Jeremy Allison
10024ed06e Merge of scalable printing code fix... Needs testing.
Also tidied up some of Richard's code (I don't think he uses the compiler
flags -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual like
I do :-) :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
090a2015eb Add group management support (patch from metze) 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
99a2e7fde1 Adapt to latest pdb API changes - only thing left is group support 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
c13ed6c866 pdb_get_unknown? -> pdb_get_unknown_? 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
b68106a79e Move pdb_xml to source/ 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
1d742e14ad Move pdb_mysql to source/passdb 0001-01-01 00:00:00 +00:00
Andrew Bartlett
2c97b7e648 Allow 'normal' accounts in the non-unix-account range for smbpasswd - I hope
this will fix some of the problems on the build farm @ Compaq (where they have
a *lot* of accounts...).
0001-01-01 00:00:00 +00:00
Andrew Bartlett
5b5b8de70e Fix debug 0001-01-01 00:00:00 +00:00
Andrew Bartlett
b70f2a8047 Extra little fix to vl's patch. Make sure the passdb and testparm messages
say exactly the same thing - in particular that we can algorithmic rid base ==
1000, and use the BASE_RID macro to avoid the use of magic numbers.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Volker Lendecke
ce5b2d991b Force algorithmic rid base to sane values and talk about it.
Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
88455313f6 Clean up this a little - add comments describing a bit of what is going on
here.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
18abaeffda Add a 'ldap trust ids' option that lets pdb_ldap check for posixAccount
attributes rather than calling getpwnam() on the user.

This should help fix some of metze's performance issues - particularly on
enumerations.

There is a consequential change to the operation of 'non unix account's in LDAP
- they are no longer restricted to being 'within' the NUA range, but will
always be added to that range.

Finally, there is the doco for this and the previous LDAP SSL changes.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
f91c363bc0 Return the result code, not false (0 == success) on error... 0001-01-01 00:00:00 +00:00
Andrew Bartlett
cfa1e459d7 Fixes for pdb_ldap:
- Default is now for start-tls, on the ldap (not ldaps) port
 - We check for 'I am currently root' in the right place now, and don't
   accidentily use a cached connection.
 - We don't loop on failure to be root, or some other errors.

 - A bit cleaner error reporting for add/modify.

 - Both the OpenLDAP and manual URI parsing tested.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
3418da1645 One more step towards to better PDC.
This patch, from "Stefan (metze) Metzmacher" <metze@metzemix.de> implements an
LDAP connection cache.  This removes the quite silly situation where every
single passdb operation involved a new LDAP connection.

The hope is that this will give us a decent performance boost in some usrmgr
related activities, and in the sid->name/sid->uid code.

The remaining things I think are 'todo' for pdb_ldap (in the near term) are:
 - intergrate volker's next_rid patch for NUA accounts,
 - add a 'trust ldap ids' option (remove Get_Pwnam() hit on enumerations).
 - put the group mapping actually into ldap
 - Schema fixes and do utf8 conversion
 - server failover (try a second server for the rebind on fail)
 - ensure we block between an 'add' and the ldap master replicating to our
   local slave (mezte found this issue, kills domain joins)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
06362586cb Fix memory leak (patch by Steve Langasek) 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
9efa98b4a6 Only run free_private_data when it's specified (reported by Steve Langasek aka vorlon) 0001-01-01 00:00:00 +00:00
Volker Lendecke
872c7d4045 pdb_unix.c did not really expect group RIDs dictated by a PDC and looking
like user RIDs.

Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
f30095852f This moves the group mapping API into the passdb backend.
Currently this calls back to mapping.c, but we have the framework
to get the information into LDAP and the passdb.tdb (should we? I
think so..).

This has received moderate testing with net rpc vampire and
usrmgr. I found the add_groupmem segfault in add_aliasmem as
well, but that will be another checkin.

Volker
0001-01-01 00:00:00 +00:00
Jeremy Allison
f6103f866a Start to merge the new ACL mapping code from Andreas Gruenbacher <agruen@suse.de>.
Jeremy.
0001-01-01 00:00:00 +00:00
Volker Lendecke
975fd17f8a Revert changes 0001-01-01 00:00:00 +00:00
Volker Lendecke
84b62f6d96 Revert changes 0001-01-01 00:00:00 +00:00
Volker Lendecke
a085670c7e No functional change. I'm trying to understand pdb_ldap.c and
found an unecessary parameter to ldapsam_search_one_user.

Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
e2fc1de34a Create group mappings on the fly.
Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
7f237bde21 Nice *big* patch from metze.
The actual design change is relitivly small however:

It all goes back to jerry's 'BOOL store', added to many of the elements in a
SAM_ACCOUNT.  This ensured that smb.conf defaults did not get 'fixed' into
ldap.  This was a great win for admins, and this patch follows in the same way.

This patch extends the concept - we don't store values back into LDAP unless
they have been changed.  So if we read a value, but don't update it, or we
read a value, find it's not there and use a default, we will not update
ldap with that value.  This reduced clutter in our LDAP DB, and makes it
easier to change defaults later on.

Metze's particular problem was that when we 'write back' an unchanged value,
we would clear any muliple values in that feild.  Now he can still have his
mulitivalued 'uid' feild, without Samba changing it for *every* other
operation.

This also applies to many other attributes, and helps to eliminate a nasty
race condition.  (Time between get and set)

This patch is big, and needs more testing, but metze has tested usrmgr, and
I've fixed some pdbedit bugs, and tested domain joins, so it isn't compleatly
flawed ;-).

The same system will be introduced into the SAM code shortly, but this fixes
bugs that people were coming across in production uses of Samba 3.0/HEAD, hence
it's inclusion here.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
c8e32d485b We already set LDAPv3 at connect time, no need to set it again. 0001-01-01 00:00:00 +00:00
Jeremy Allison
bb58a08af4 Add a timeout to tdb_lock_bystring(). Ensure we never have more than
MAX_PRINT_JOBS in a queue.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
f7dd66e88d Add const. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
31bdbeef0e Minor updates:
Add const to some more functions, and reintroduce 'net rpc join oldstyle' as
*only* trying an old-style join.

This means that we can rely on it not prompting for a password on the build
farm.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
36c2a3820f Readd the 2.2 --with-ldapsam paramaters so as to allow a smooth upgrade path to
a 3.0 based PDC.

Change defaults to use SSL, so that this also matches.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
ab878b6cc4 Patch from "Stefan (metze) Metzmacher" <metze@metzemix.de> to do a *much*
better job of working with usrmgr.   Previously we were blanking out entires,
and all sort of mischif.

The new patch (which I've now had a chance to test/modify) also takes care not
to expand % values (ie we go \\%L\%U -> \\server\user, we don't want to store
\\server\user back) and to correctly notice 'not set' compared to 'null string'
etc.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Simo Sorce
102a26e065 move all the passdb internal interface to NTSTATUS
only the interface has been fully moved to NTSTATUS
not all the plugins make full use of it, but have been all converted.

My testings passed completely, however a bit of more testing is welcome

Simo.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
6b78e554c3 Make it clear what this if statement applies to, and what it doesn't 0001-01-01 00:00:00 +00:00
Andrew Bartlett
a198940ea6 Whenever we deal with adding machine/trusted domain accounts, always reset the
flag to what we expect.  This handles the 'upgrade' from unixsam beter (where
all $ terminated accounts are machines).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
4aea951102 Don't crash when a backend doesn't have a setsampwent function available - bug reported by metze 0001-01-01 00:00:00 +00:00