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

573 Commits

Author SHA1 Message Date
Andrew Bartlett
1276959d7c Always initialise this variable - and don't set the 'must change now' if it was
last changed at '0'.

We need to actually change this password sometime...

Andrew Bartlett
(This used to be commit 740bf439d2d1512127c873cf0e57697161d6566b)
2003-01-13 21:49:49 +00:00
Jeremy Allison
f420f75508 Fix open problem with changing attributes on an existing file - based
on work by  <steve@griffin.sio2.nl>.
Jeremy.
(This used to be commit 465d86d95fbdeda423d1f4b06cee46c119a31447)
2003-01-08 02:09:14 +00:00
Andrew Bartlett
ff18825765 We already have one function to move unistr2 -> multibyte-static, so we
don't need a second just for pdb.

Also, remove magic 'is lp_guest_account' test - the magic RID should be
up to the passdb backend to set.

Andrew Bartlett
(This used to be commit f71c8338d35a2e8c73c3d8006ea6858cb522c715)
2003-01-02 13:10:25 +00:00
Andrew Bartlett
6d66fb308a BIG patch...
This patch makes Samba compile cleanly with -Wwrite-strings.
 - That is, all string literals are marked as 'const'.  These strings are
always read only, this just marks them as such for passing to other functions.

What is most supprising is that I didn't need to change more than a few lines of code (all
in 'net', which got a small cleanup of net.h and extern variables).  The rest
is just adding a lot of 'const'.

As far as I can tell, I have not added any new warnings - apart from making all
of tdbutil.c's function const (so they warn for adding that const string to
struct).

Andrew Bartlett
(This used to be commit 92a777d0eaa4fb3a1c7835816f93c6bdd456816d)
2003-01-02 09:07:17 +00:00
Jeremy Allison
7f23546730 Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
(This used to be commit 842e08e52a665ae678eea239759bb2de1a0d7b33)
2002-12-20 20:23:06 +00:00
Gerald Carter
f6c4f25e43 merge of get_dc_name()-like code from APP_HEAD; better support password server = DC1 *
(This used to be commit 6b18ca9511ddcf1718f222af3f61491d1e5f3b60)
2002-12-12 23:35:55 +00:00
Herb Lewis
73bf5369b8 use FILE_MACRO instead of __FILE__
use FUNCTION_MACRO instead of __FUNCTION_
(This used to be commit 243763d6eb107ab2444d81025232c8fe795baaf1)
2002-12-03 21:49:00 +00:00
Andrew Bartlett
57b23e2d0e Move from NT_STATUS_UNSUCCESSFUL to NT_STATUS_NO_SUCH_USER, and other slightly
more useful error codes.
(This used to be commit 5b1185b4e8592e6bc1abe581950571e249c03a78)
2002-11-24 08:46:34 +00:00
Andrew Tridgell
211b99b2cb 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
(This used to be commit d076823c73731a4c83f49a21f13360a38d54406e)
2002-11-20 11:30:19 +00:00
Jelmer Vernooij
9da3d41f3c Use smb_register_passdb() - plus some small fixes
(This used to be commit 2addbaff358993923a58ad3845c63168678c2c21)
2002-11-15 17:01:24 +00:00
Jelmer Vernooij
e1fa4b1d48 Add smb_register_passdb()
(This used to be commit b5b3b2e6bef431c9c30dc8f2899dc22328801c0e)
2002-11-15 16:48:00 +00:00
Jelmer Vernooij
a7e4392687 Remove the #ifdef's for NISPLUS_SAM - there are no function name collisions anymore
(This used to be commit f6ef18df11cc48f25adeee464e79e63ee209b08c)
2002-11-14 18:16:17 +00:00
Jeremy Allison
250c980119 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.
(This used to be commit 82b8f749a36b42e22186297482aad2abb04fab8a)
2002-11-12 23:15:52 +00:00
Jelmer Vernooij
52b0efec1a More improvement of DEBUG output
(This used to be commit 21530f06b2b89d159657646fe15e16a3fcfdb668)
2002-11-11 18:53:23 +00:00
Jelmer Vernooij
624a4fc009 Add extra debug info
(This used to be commit 79207d56929de2acc15a761b23c8b33369c298ee)
2002-11-11 18:41:28 +00:00
Jelmer Vernooij
9d7cd66431 Print the number of returned rows, not the number of fields
(This used to be commit f4110a0f80a4f62d548b6d6cae81692476ef85ba)
2002-11-10 16:29:50 +00:00
Andrew Bartlett
48b32cd865 Make smbpasswd use the group mapping, and fix spelling in ldapsam.
This gets user mangler for doamins working again.

Andrew Bartlett
(This used to be commit 205209f77f154a2a5d5f7a255194d7953860a4db)
2002-11-08 22:15:34 +00:00
Jelmer Vernooij
0cd37de198 Fix small typo
(This used to be commit 3c39bd9db09c59f149d77e371ed078cd7ec2d1b4)
2002-11-07 19:45:55 +00:00
Andrew Tridgell
720ca2c477 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.
(This used to be commit fb79fa5a31c2fa8ebdcddbc49b1d9c1aa3059691)
2002-11-07 04:52:04 +00:00
Jeremy Allison
47955b2f6c 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.
(This used to be commit 10024ed06e9d91f24fdc78d59eef2f76bf395438)
2002-11-07 02:38:42 +00:00
Jelmer Vernooij
6ae9de8f39 Add group management support (patch from metze)
(This used to be commit 090a2015eb9aa4ec68d80e972ae192d19afd536e)
2002-11-06 22:10:16 +00:00
Jelmer Vernooij
809c4715da Adapt to latest pdb API changes - only thing left is group support
(This used to be commit 99a2e7fde1fd4e589035c273f40419ef322e097d)
2002-11-06 12:26:21 +00:00
Jelmer Vernooij
5f119d4597 pdb_get_unknown? -> pdb_get_unknown_?
(This used to be commit c13ed6c866fed43e5f83e083c377a1cd7d505061)
2002-11-06 11:21:47 +00:00
Jelmer Vernooij
82c714569d Move pdb_xml to source/
(This used to be commit b68106a79e4536fa82d75dd330d07dba51bfeaf4)
2002-11-05 17:08:32 +00:00
Jelmer Vernooij
42f569f06c Move pdb_mysql to source/passdb
(This used to be commit 1d742e14ad18070aee654071d159b8b7410d6f86)
2002-11-05 16:48:23 +00:00
Andrew Bartlett
3ae2fcd776 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...).
(This used to be commit 2c97b7e6480c2731739ccc52af97bc62a6228cfe)
2002-11-04 13:15:53 +00:00
Andrew Bartlett
1336b8153e Fix debug
(This used to be commit 5b5b8de70e46a15e9fb9b47c7af6cb0133f41217)
2002-11-04 12:47:07 +00:00
Andrew Bartlett
a7f2feae31 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
(This used to be commit b70f2a8047ac549841bc103932b38951e9814186)
2002-11-03 14:13:43 +00:00
Volker Lendecke
9422775efd Force algorithmic rid base to sane values and talk about it.
Volker
(This used to be commit ce5b2d991b42bbf6865ff75194f8ee4b46694841)
2002-11-03 12:54:12 +00:00
Andrew Bartlett
593e0b5d00 Clean up this a little - add comments describing a bit of what is going on
here.
(This used to be commit 88455313f6551a75eff4df2f0ba91430948c1c78)
2002-11-02 07:54:04 +00:00
Andrew Bartlett
b017064cec 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.
(This used to be commit 18abaeffda300074a507561d8372d5bfddc8fe50)
2002-11-02 07:09:17 +00:00
Andrew Bartlett
531cea2937 Return the result code, not false (0 == success) on error...
(This used to be commit f91c363bc05d1c82ad8a99a5c0d59b46cf820aac)
2002-11-02 03:37:26 +00:00
Andrew Bartlett
a66b852ddc 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
(This used to be commit cfa1e459d727764feddcfdd8c9c0404282e2d0e8)
2002-11-02 03:14:27 +00:00
Andrew Bartlett
991f6ddac6 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
(This used to be commit 3418da16456511490beb0d1045fff24576b48273)
2002-10-26 01:47:38 +00:00
Jelmer Vernooij
bea0b200c8 Fix memory leak (patch by Steve Langasek)
(This used to be commit 06362586cb754bd6bc89b50b966737958286ca2e)
2002-10-25 02:37:11 +00:00
Jelmer Vernooij
5b90fdc6bb Only run free_private_data when it's specified (reported by Steve Langasek aka vorlon)
(This used to be commit 9efa98b4a65a38df922ce3b83f5fde631cb70844)
2002-10-25 00:36:28 +00:00
Volker Lendecke
2d19a6550b pdb_unix.c did not really expect group RIDs dictated by a PDC and looking
like user RIDs.

Volker
(This used to be commit 872c7d40454545108ec9e7eee12894af77b4adc3)
2002-10-21 20:31:59 +00:00
Volker Lendecke
5dbf435408 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
(This used to be commit f30095852fea19421ac8e25dfe9c5cd4b2206f84)
2002-10-21 19:28:56 +00:00
Jeremy Allison
e13dd2f302 Start to merge the new ACL mapping code from Andreas Gruenbacher <agruen@suse.de>.
Jeremy.
(This used to be commit f6103f866a5e698ab55fdab1444a14e3d8da16bb)
2002-10-18 19:46:28 +00:00
Volker Lendecke
8cb53d56f2 Revert changes
(This used to be commit 975fd17f8af0f03f43995deb3fdd9bd5995a1c92)
2002-10-17 08:12:20 +00:00
Volker Lendecke
41a427b6ba Revert changes
(This used to be commit 84b62f6d96a77ccbc1b4475ab0780a4e4c9d4875)
2002-10-17 07:08:43 +00:00
Volker Lendecke
9e19e9e9c1 No functional change. I'm trying to understand pdb_ldap.c and
found an unecessary parameter to ldapsam_search_one_user.

Volker
(This used to be commit a085670c7e3a0ca82df749592fd5c6a86def1d53)
2002-10-16 15:49:58 +00:00
Volker Lendecke
4f001512cd Create group mappings on the fly.
Volker
(This used to be commit e2fc1de34aaf875a7003f9d15d5f8ecf159130fb)
2002-10-16 09:41:42 +00:00
Andrew Bartlett
4ac9ccfde4 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
(This used to be commit 7f237bde212eb188df84a5d8adb598a93fba8155)
2002-10-12 03:38:07 +00:00
Andrew Bartlett
4920d21922 We already set LDAPv3 at connect time, no need to set it again.
(This used to be commit c8e32d485bf205b6965579f94063effd86777f3f)
2002-10-12 00:59:21 +00:00
Jeremy Allison
9c94d1a2f7 Add a timeout to tdb_lock_bystring(). Ensure we never have more than
MAX_PRINT_JOBS in a queue.
Jeremy.
(This used to be commit bb58a08af459b4abae9d53ab98c15f40638ce52b)
2002-10-04 22:53:30 +00:00
Andrew Bartlett
0a23b0b4d5 Add const.
(This used to be commit f7dd66e88dba947a167d9a14c96810854dfc5c9d)
2002-09-28 12:11:19 +00:00
Andrew Bartlett
d95e86b8b9 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
(This used to be commit 31bdbeef0ea6f30247cd3b30cfea57b34102abe6)
2002-09-27 04:33:58 +00:00
Andrew Bartlett
9e7a6d6b8b 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
(This used to be commit 36c2a3820faa1d90cd331881720be0e61ab93460)
2002-09-27 01:02:37 +00:00
Andrew Bartlett
ad514000db 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
(This used to be commit ab878b6cc4132594fc33f78aeebf0d8b7266c150)
2002-09-26 10:25:34 +00:00