1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

997 Commits

Author SHA1 Message Date
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
e9cc37b0bb Start to merge the new ACL mapping code from Andreas Gruenbacher <agruen@suse.de>.
Jeremy.
(This used to be commit 597c4610090d711fd30c1ffacc97212cf399a264)
2002-10-18 19:46:32 +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
Jeremy Allison
3665777a5b 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 9fe3c0b90d4bff2217e3cb5a34b4683ca314c06e)
2002-10-04 22:53:18 +00:00
Andrew Bartlett
ad8a22e570 Updates from Samba HEAD:
- Fix segfaults in the 'net ads' commands when no password is provided
 - Readd --with-ldapsam for 2.2 compatability.  This conditionally compiles the
   old options, but the actual code is available on all ldap systems.
 - Fix shadow passwords (as per work with vl)
 - Fix sending plaintext passwords to unicode servers (again vl)
 - Add a bit of const to secrets.c functions
 - Fix some spelling and grammer by vance.
 - Document the -r option in smbgroupedit.

There are more changes in HEAD, I'm only merging the changes I've been involved
with.

Andrew Bartlett
(This used to be commit 83973c389355a5cc9ca74af467dfd8b5dabd2c8f)
2002-10-01 13:10:57 +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
Gerald Carter
7d1eb6f7b6 sync with HEAD
(This used to be commit ee9cbf58071adb627a49a94c6340aaba330486b5)
2002-09-26 18:58:34 +00:00
Gerald Carter
ef6f8197a3 remove files not in HEAD
(This used to be commit 9d9f7bbf87bf9a0e003e6da482615fe040d00852)
2002-09-26 18:53:51 +00:00
Gerald Carter
d9729d81a9 syncing up with HEAD again....
(This used to be commit e026b84815ad1a5fa981c24fff197fefa73b4928)
2002-09-26 18:37:55 +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
Simo Sorce
9e70b39ab2 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.
(This used to be commit 102a26e06591928a03b49cd312a65811ed46314f)
2002-09-26 09:50:53 +00:00
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273bb58802bf0c389b77f7fcae0a1f6139)
2002-09-25 15:19:00 +00:00
Andrew Bartlett
1f5a153a6f Make it clear what this if statement applies to, and what it doesn't
(This used to be commit 6b78e554c3dd3c98bff7dbd1d3715a9b7e405b8d)
2002-09-25 14:18:11 +00:00
Andrew Bartlett
31b131b0e9 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
(This used to be commit a198940ea6f7b7f3cba38c5a9f695e0731204583)
2002-09-25 12:02:57 +00:00
Jelmer Vernooij
059838a843 Don't crash when a backend doesn't have a setsampwent function available - bug reported by metze
(This used to be commit 4aea951102a6e82612560e6a59931fde433ee6ea)
2002-09-25 11:42:30 +00:00
Andrew Bartlett
82102d9c99 This patch from "Stefan (metze) Metzmacher" <metze@metzemix.de> cleans up
pdb_ldap and adds a 'ldap passwd sync' option.

The idea with this option is to do allow an ldap backend to do all the fancy
password hashing etc - and to tell smbd no to try and double-up.  Using 'ldap
passwd sync = only' will do this, but is not recommended unless such a backend
is in place...

Running 'ldap passwd sync = yes' just gets you the same as doing 'pam passwd
sync = yes' and having both PAM and pam_ldap correctly configured for 'magic
root' behaviour, but only using ldap connection, and one set of credentials.

This also gets us closer to allowing ldap to say 'password too short' etc,
which might assist in maintaining a consistant password policy.

Andrew Bartlett
(This used to be commit f13e243f1a13d34ae057b40b01f561e8b95d4570)
2002-09-25 11:34:31 +00:00
Andrew Bartlett
bfa04e42b8 If adding a user to ldap, make sure we have the 'account' structural class, or
else we can't add to OpenLDAP 2.1
(This used to be commit d9a91a41441c156223760cb356fa997ea7bdbc1a)
2002-09-25 09:35:45 +00:00
Jeremy Allison
8b4bafc76f We had a race condition when changing a machine acount password as we
were no longer locking the secrets entry. I saw this on a live system.
Jeremy.
(This used to be commit 660dafcbb2d1029831212a32d995891626a0344c)
2002-09-18 00:30:00 +00:00
Jeremy Allison
8b46126a07 Never, *ever* hold a mutex lock in the message database where there may
be traversals being attempted. Yes, this was from bitter experience (and
an out of control server :-). Also allow callers to break out of a tdb_chainlock
with sigalarm if desired.
Jeremy.
(This used to be commit a7781f91d8c1177210bffc199cd2f3b7ff993eaf)
2002-09-17 23:45:21 +00:00
Andrew Tridgell
9faf941652 more const cleanups
(This used to be commit dfa85f9c48aa3c8d93775df6b6ad2dec9a1692d7)
2002-09-17 12:08:55 +00:00
Andrew Bartlett
4b27cda285 Set default ACB attributes on 'unixsam' accounts. This means that machine
accounts added first to /etc/passwd will be honered correctly.  Also, users
'upgraded' to smbpasswd will have the right flags.

Andrew Bartlett
(This used to be commit 474cc910c73e5567313bac438c7324a80e2e90d8)
2002-09-04 08:08:03 +00:00
Jelmer Vernooij
558297b703 small fixes
make lp_sam_backend() a list
(This used to be commit 06eb3138ab14ff450bbc44f5fa539867ce67a7dd)
2002-08-29 09:20:49 +00:00
Jelmer Vernooij
d03116a447 RTLD_GLOBAL is not necessary
(This used to be commit 3146b243e0b143e1038c97d9f919aba494cc46f7)
2002-08-29 07:40:26 +00:00
Jelmer Vernooij
2b2b0f7119 Put in intermediate version of new SAM system. It's not stable yet, code
might be ugly, etc - please don't blame me for anything but instead try to fix
the code :-). Compiling of the new sam system can be enabled with the
configure option --with-sam

Removing passdb/passgrp.c as it's unused
fix typo in utils/testparm.c
(This used to be commit 4b7de5ee236c043e6169f137992baf09a95c6f2c)
2002-08-28 04:54:43 +00:00
Andrew Bartlett
00b7fa8951 More hacks for 'guest account' to get it to show up with the right rid...
Andrew Bartlett
(This used to be commit 2795d92268d23063faf5a661279a91f7703d8aac)
2002-08-21 22:13:45 +00:00
Volker Lendecke
37b46432d4 Replaced reference to global_myworkgroup by calls to lp_workgroup().
pdbedit failed to initialize global_myworkgroup, wo we could end up
having a SID for SECRETS/SID/  in secrets.tdb.

Volker
(This used to be commit 8c96ab4bc05e55e119c1b44779fe14d3ab6c5f35)
2002-08-21 20:50:42 +00:00
Jelmer Vernooij
72f1a676d8 Add changes suggested by abartlet:
- don't use lp_passwd_file() to retrieve NIS domain name, but use location
  instead
- some cleanups
(This used to be commit 16f4568f35c753ec0ab0a0dda2b264668f5ac5ab)
2002-08-21 18:58:04 +00:00
Andrew Bartlett
e45720be14 Use the 'init' flag to determine if the UID is set, rather than testing the
uid for -1.

Andrew Bartlett
(This used to be commit 2fc12864ae78ea08d8cb4e3b1c7e341ca4a854e6)
2002-08-21 11:18:25 +00:00
Jelmer Vernooij
2e01bef42d pdb_nisplus converted to the new passdb system API's
(This used to be commit 72e9a5cd340d6a912e274dc0d6f2a22a922d4b03)
2002-08-20 20:56:10 +00:00
Jelmer Vernooij
b2edf254ed sync 3.0 branch with head
(This used to be commit 3928578b52cfc949be5e0ef444fce1558d75f290)
2002-08-17 17:00:51 +00:00
Andrew Bartlett
e2cd994c90 Quick hack to get around the inadequacy of pdb_smbpasswd. This should make the
build farm happy again, and allow the 'guest account' to be added to smbpasswd.

Andrew Bartlett
(This used to be commit 5e5cd2874527dd9a213c4bfcf98a425c39f3f2e2)
2002-08-17 07:21:01 +00:00
Andrew Bartlett
a27ec4a011 Rework the 'guest account get's RID 501' code again...
This moves it right into the passdb subsystem, where we can do this in
just one (or 2) places.  Due to the fact that this code can be in a tight loop,
I've had to make 'guest account' a 'const' paramater, where % macros cannot be
used.  In any case, if the 'guest account' varies, we are in for some nasty
cases in the other code, so it's useful anyway.

Andrew Bartlett
(This used to be commit 8718e5e7b2651edad15f52a4262dc745df7ad70f)
2002-08-17 04:51:27 +00:00
Andrew Bartlett
fbaf4d07ae Make the 'guest account' always have a RID of DOMAIN_USER_RID_GUEST.
Andrew Bartlett
(This used to be commit 4725d7d04936335cbd85bd6ac5096c50fed93671)
2002-08-16 08:46:03 +00:00
Jim McDonough
3e5939ccd5 Update secrets_fetch_domain_guid to generate and store it if it doesn't exist.
Only does it for PDCs.
(This used to be commit 3543f92c39a80c8b6eb7ca3188b87f0f15896f33)
2002-08-12 13:55:31 +00:00
Andrew Bartlett
a51897cf9b Add const to a pile of const to *DOM_SID paramaters.
Andrew Bartlett
(This used to be commit fd0ebf976eb6e5fc25bc75ff471c69c3f3761e32)
2002-08-07 07:22:43 +00:00
Andrew Bartlett
f23d88ab78 Try to bind with LDAPv3 if possible.
Andrew Bartlett
(This used to be commit 0e420878f26bdd19b5defb78a5fe4c31662ec941)
2002-08-06 11:48:17 +00:00
Andrew Bartlett
b0565dac76 I must have missed this when I was adding 'const' to these earlier...
Andrew Bartlett
(This used to be commit ce6c8a647ca56dcbb60ff898d77c2df297c1fe79)
2002-08-05 03:43:26 +00:00
Andrew Bartlett
b745d8b1cd Try to make this easier to debug - display the username that failed.
Andrew Bartlett
(This used to be commit 8405bccd4e7a5315e58890ffa5d481031636f88a)
2002-08-05 03:27:04 +00:00
Andrew Bartlett
6be547fc6b Don't accidenity mess with the wrong domain's sids.
(This used to be commit 0e2207c9c1ce573098f764e85a65c17cc1f1d284)
2002-07-31 10:12:52 +00:00
Andrew Tridgell
76fb289cd8 fixed multi-line strings for portability
(This used to be commit 9f9e0cbd2c9920b730286f8bf560dc3415c29aa6)
2002-07-31 09:34:00 +00:00
Jim McDonough
89d46eeb33 Add LSA RPC 0x2E, lsa_query_info2. Only level implemented is 0x0c, which
is netbios and dns domain info.  Also add code to set/fetch the domain GUID
from secrets.tdb (although set is not yet called by anyone).
(This used to be commit 31d7168530ccce2c5e9e7f96464b47f4d9771a25)
2002-07-30 17:23:07 +00:00