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

210 Commits

Author SHA1 Message Date
Christian Ambach
987de8a971 s3:passdb make pdb_sid_to_id honor backend responsibilities
only ask passdb backend for mapping if it is responsible

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Christian Ambach <ambi@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2013-06-21 10:44:21 +02:00
Christian Ambach
0ad38d777f s3:passdb add pdb_*_is_responsible_for* functions
allows PDB modules to specify for which special domains they
are responsible when it comes to SID->xid conversion

By default, passdb modules will be responsible for local BUILTIN,
local SAM and Unix Users/Groups

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Christian Ambach <ambi@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2013-06-21 10:44:19 +02:00
Alexander Bokovoy
5952755755 PASSDB: add support to set and enumerate UPN suffixes associated with our forest
Samba PDC may manage a forest containing DNS domains in addition to the primary one.
Information about them is advertised via netr_DsRGetForestTrustInformation when
trusted_domain_name is NULL, according to MS-NRPC and MS-LSAD, and
via netr_GetForestTrustInformation.

This changeset only expands PASSDB API; how suffixes are maintained is left
to specific PDB modules. Set function is added so that suffixes could be
managed through 'net' and other Samba utilities, if possible.

One possible implementation is available for ipasam module in FreeIPA:
http://git.fedorahosted.org/cgit/freeipa.git/commit/?id=cc56723151c9ebf58d891e85617319d861af14a4

Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-09 20:29:18 +02:00
Michael Adam
61e8b80c85 s3:passdb: fix building pdb_ldap as shared module
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Dec  3 19:12:29 CET 2012 on sn-devel-104
2012-12-03 19:12:29 +01:00
Michael Adam
d96aeded61 s3:passdb: factor pdb_sid_to_id_unix_users_and_groups() out of pdb_default_sid_to_id()
The special treatment of the "Unix User" and "Unix Group" pseudo domains
can be reused.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03 08:48:30 +01:00
Michael Adam
ef0ed56eb1 s3:passdb: don't bail out in pdb_default_sid_to_id() if sid is not in our sam
This code treats the own sam, builtin, wellknown, and sids from the
"Unix User" and "Unix Group" pseudo-domains.

This reverts part of commit 02e25b2a43.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-03 08:48:30 +01:00
Andrew Bartlett
5aa9a6c936 s3-passdb: Allow reload of the static passdb from python
This is then used in provision when the passdb backend is forced.

Andrew Bartlett
2012-08-28 07:57:30 +10:00
Andrew Bartlett
02e25b2a43 s3-passdb: Allow pdb_sid_to_id to work on any SID
This is needed so that pdb_samba4 can map any SID during a provision.

At runtime, winbindd will be asked first, but this shortcut direct to the
ldb file makes it possible to set the permissions on the sysvol share at
provision time.

Andrew Bartlett
2012-08-21 15:25:49 +10:00
Jeremy Allison
b70f23c2b5 Correctly check for errors in strlower_m() returns. 2012-08-09 12:08:18 -07:00
Rusty Russell
fe72740e82 loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.
They use talloc_tos() internally: hoist that up to the callers, some
of whom don't want to us talloc_tos().

A simple patch, but hits a lot of files.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 15:07:23 +09:30
Michael Adam
1ee95e4cb1 s3: rename sid_check_is_in_our_domain() to sid_check_is_in_our_sam()
This does not check whether the given sid is in our domain, but
but whether it belongs to the local sam, which is a different
thing on a domain member server.

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Jul 12 18:36:02 CEST 2012 on sn-devel-104
2012-07-12 18:36:02 +02:00
Michael Adam
c43505b621 s3: rename sid_check_is_domain() to sid_check_is_our_sam()
This does not check whether the given sid is the domain sid,
but whether it is the sid of the local sam, which is different
for a domain member server.
2012-07-12 16:43:51 +02:00
Michael Adam
ac2644b776 s3:passdb: remove commented out pdb_lookup_names code
This code is lying there unused since more than five years now.
2012-07-12 16:43:51 +02:00
Steve Langasek
31db7d2985 Fix bug 8920, null dereference
Description: Avoid null dereference in initialize_password_db()
 When initialize_password_db() is called with reload=True, it's assumed that
 the free_private_data member of pdb_methods is non-null.  This is not
 necessarily the case, as the tdb backend has no private data and therefore
 no free function.  Check to see if we have private data that needs freed
 before calling.
Author: Steve Langasek <steve.langasek@ubuntu.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/829221

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu May 10 11:07:27 CEST 2012 on sn-devel-104
2012-05-10 11:07:27 +02:00
Andrew Bartlett
2b5ee3491a s3-passdb: Add extra debug on ID mapping failures
Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Wed May  2 15:34:13 CEST 2012 on sn-devel-104
2012-05-02 15:34:09 +02:00
Andrew Bartlett
a6e29f23f0 s3-passdb: Change pdb_sid_to_id() to return struct unixid
This will make it easier to consistantly pass a struct unixid all the way up and
down the idmap stack, and allow ID_TYPE_BOTH to be handled correctly.

Andrew Bartlett

Signed-off-by: Michael Adam <obnox@samba.org>
2012-05-02 12:45:29 +02:00
Christof Schmitt
6e583c72cc passdb: Do not panic in initialize_password_db
A call to initialize_password_db leads to smb_panic in case the backend
returns an error. All callers to initialize_password_db check the return
value, so this code path should return the status instead of calling
smb_panic.

Move the call to smb_panic from pdb_get_methods_reload pdb_get_methods
to get it out of the initialize code path.  This allows printing the
proper error message for 'net getlocalsid' which is much nicer than
printing the panic stack trace.
2012-04-30 11:30:29 +02:00
Jelmer Vernooij
43f275008f lib/util: Remove dummy wrapper for getpwuid(). 2012-03-24 15:25:05 +01:00
Günther Deschner
e75c436fe6 s3-passdb: trying to decouple passdb and secrets a little.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Jan 18 14:46:18 CET 2012 on sn-devel-104
2012-01-18 14:46:18 +01:00
Günther Deschner
2330e52cac s3-passdb: use tevent_context in passdb.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Oct 28 13:09:47 CEST 2011 on sn-devel-104
2011-10-28 13:09:47 +02:00
Simo Sorce
605d7d965a pdb-interface: Do not use unid_t here
This interface needs to be publicly available, unid_t here is not really useful
and makes it harder to use it as unid_t is not a public union.

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Tue Oct 18 20:57:16 CEST 2011 on sn-devel-104
2011-10-18 20:57:16 +02:00
Simo Sorce
995d156726 s3-group-mapping: Remove fstrings from GROUP_MAP.
Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Oct 12 19:28:12 CEST 2011 on sn-devel-104
2011-10-12 19:28:12 +02:00
Andreas Schneider
d713f9e9f5 s3-passdb: Only delete 1 entry from memcache.
If we delete or update one user we shouldn't flush the complete
memcache.

Signed-off-by: Simo Sorce <idra@samba.org>

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Sun Aug 21 16:39:10 CEST 2011 on sn-devel-104
2011-08-21 16:39:10 +02:00
Andreas Schneider
99bb3eed1d s3-passdb: Remove always the user from getpwsid cache.
We should do it always, not only in the pdb_default_delete_user()
function.

Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:08:25 -04:00
Andreas Schneider
1152aa8e03 s3-passdb: Keep caches coherent
When deleting a user send a message to all interested parties so they can
purge their caches. Otherwise some processes may positively respond with a
cached getpwnam, when the user have actully been removed.

Without this some tests that remove and then immediately create users are
flakey.

Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:08:25 -04:00
Andrew Bartlett
3df9e62c97 s3-passdb Use supplied pdb_methods in default passdb search handlers 2011-08-15 08:26:06 +02:00
Amitay Isaacs
ae9a3274bc passdb: Call with correct backend methods instead of default methods
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-13 12:30:48 +10:00
Amitay Isaacs
6f21f556c1 passdb: Add a function to expose loaded backend list.
This function is used in python wrapper to list available python backends.
2011-08-13 10:25:06 +10:00
Günther Deschner
51481c5912 s3-secrets: add lsa_secret passdb api.
Guenther
2011-07-31 22:37:26 +02:00
Günther Deschner
f9a5df8929 s3-passdb: add dummy calls to control global (replicated) secrets.
Guenther
2011-07-31 22:37:26 +02:00
Sumit Bose
d5661467e1 s3-passdb: Implement new pdb trust calls for the default backend
Signed-off-by: Simo Sorce <idra@samba.org>

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Sun Jun 12 06:45:25 CEST 2011 on sn-devel-104
2011-06-12 06:45:25 +02:00
Andrew Bartlett
5e26e94092 s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
3d15137653 s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Günther Deschner
2f36ef7225 s3-passdb: add passdb.h where needed.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
49fcf653b1 s3-includes: only include system/passwd.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
64421129b6 lib/util/util_pw: share sys_get{pw,gr} group of calls.
Guenther
2011-03-30 01:13:06 +02:00
Stefan Metzmacher
d7fa349052 s3:auth: change num_groups to from size_t to uint32_t
This will help with the change from UNIX_USER_TOKEN to security_unix_token

metze
2011-02-22 16:20:11 +11:00
Sumit Bose
72de982289 s3-ipasam: add ipasam_get_trusted_domain_by_sid()
Signed-off-by: Günther Deschner <gd@samba.org>
2011-02-16 11:44:04 +01:00
Sumit Bose
b4dd65d3f9 s3-passdb: add {get,set,del,enum}_trusted_domain calls
Signed-off-by: Günther Deschner <gd@samba.org>
2011-02-16 11:34:44 +01:00
Andreas Schneider
ad65605643 s3-auth: Fixed account lockout check. 2011-01-17 16:50:50 +01:00
Bjoern Baumbach
6acbcd1b0c Make sure that user exists after running add user script before adding sam account.
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Tue Dec  7 17:37:52 CET 2010 on sn-devel-104
2010-12-07 17:37:52 +01:00
Jeremy Allison
e1cfca1e2e Make getpwnam_alloc() static to lib/username.c, and ensure all username lookups go
through Get_Pwnam_alloc(), which is the correct wrapper function. We were using
it *some* of the time anyway, so this just makes us properly consistent.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Oct 20 16:02:12 UTC 2010 on sn-devel-104
2010-10-20 16:02:12 +00:00
Andrew Bartlett
f768b32e37 libcli/security Provide a common, top level libcli/security/security.h
This will reduce the noise from merges of the rest of the
libcli/security code, without this commit changing what code
is actually used.

This includes (along with other security headers) dom_sid.h and
security_token.h

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-12 05:54:10 +00:00
Volker Lendecke
41b54a8931 s3: Remove talloc_autofree_context from pdb_interface
None of the pdb backends have special destructors that need to be run at
program exit.
2010-10-03 10:45:56 +02:00
Volker Lendecke
d4bfb5c488 s3: Remove talloc_autofree_context() from guest_user_info()
pwd is freed a few lines down
2010-09-26 17:36:40 +02:00
Günther Deschner
4dbd743e46 s3-util_sid: use shared dom_sid_compare_auth and dom_sid_equal_X functions.
Guenther
2010-09-20 14:04:37 -07:00
Andreas Schneider
c5cfad142c s3-passdb: Try to unlock the account if it is locked out.
Signed-off-by: Simo Sorce <idra@samba.org>
2010-08-30 10:43:41 -04:00
Andreas Schneider
2ab0b63bd8 s3-passdb: Added a pdb_try_account_unlock function.
The function checks if the account has been autolocked. If we have a
lockout_duration and a bad password time it checks if we can unlock the
account.

Signed-off-by: Simo Sorce <idra@samba.org>
2010-08-30 10:43:34 -04:00
Günther Deschner
7ff7eb0b52 s3-build: only include nsswitch header where needed.
Guenther
2010-08-26 00:20:28 +02:00
Günther Deschner
aba1bf4b5e s3-build: only include memcache.h where needed.
Guenther
2010-08-26 00:20:28 +02:00