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

107 Commits

Author SHA1 Message Date
Andreas Schneider
691c4b1a41 Windows 2008 (Longhorn) auth2 flag fixes.
Interop fixes for AD specific flags. Original patch from Todd Stetcher.
(This used to be commit 5aadfcdaacd6f136eab9e107a88b8544e6d2105f)
2008-01-23 14:55:22 -08:00
Michael Adam
2051243132 Fix panic: Don't free the logfilename in winbind_child_died().
The child struct is immediately reused, and this results
in a panic when child->logfilename == NULL.

Michael
(This used to be commit da131d089db98017632103aa9bbe38c98f7a3fc1)
2008-01-23 14:33:22 +01:00
Michael Adam
3b83f49158 Initialize _domain_list to NULL.
Just to be sure the "if (!_domain_list)" in domain_list() test always works.

Michael
(This used to be commit 1f49065d44dd7570d5a9928359751bd36f287952)
2008-01-23 13:52:42 +01:00
Günther Deschner
5f962d9b98 Fix get_trust_creds() to return always an upper-cased krb5 principal (this
fixes winbind krb5 session at least with heimdal).

Guenther
(This used to be commit 9cf3a98eacea2dd07f89245f147e002b3f49482e)
2008-01-23 12:05:01 +01:00
Stefan Metzmacher
2b9ed4700a winbindd: remove useless strcpy
metze
(This used to be commit df08708fc1e8fc8e15b36db29faf35ae5ae64b65)
2008-01-21 13:15:10 +01:00
Volker Lendecke
611609ee25 Fix a segfault
Pointed out by Steven Danneman on irc, thanks!

Jerry, Günther, please check!
(This used to be commit 9e71c89ac648040739ef2161a2e6c4299be1e35b)
2008-01-20 09:05:42 +01:00
Günther Deschner
a92eb76688 Finally enable pidl generated SAMR & NETLOGON headers and clients.
Guenther
(This used to be commit f7100156a7df7ac3ae84e45a47153b38d9375215)
2008-01-17 16:54:46 +01:00
Alexander Bokovoy
024741500a Convert old sid-string handling in idmap_tdb2 to a new one
(This used to be commit ee851730cef1eb506b47faf57e25789ad3c6aafa)
2008-01-16 16:50:46 +03:00
Alexander Bokovoy
3bd3483fab idmap TDB2 backend, used for clustered Samba setups.
This uses 2 tdb files. One is permanent, and is in shared storage
   on the cluster (using "tdb:idmap2.tdb =" in smb.conf). The other is a
   temporary cache tdb on local storage.


Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit b6df7e7709365fb620867ad8954bc5bf24496775)
2008-01-16 12:27:29 +03:00
Günther Deschner
c920764b19 Apply const to rpccli_lsa_query_info_policy() and rpccli_lsa_query_info_policy2().
Guenther
(This used to be commit 7a3fe68bef7acde9d9f8a7a44ce7e9432f3c5a95)
2008-01-15 16:40:22 +01:00
Jeremy Allison
6fa81523f8 Ensure we don't access an uninitialized variable
(CID 535 - actually false but easy to shut up :-).
Jeremy.
(This used to be commit 4038bb3a9485943db58d9fe30947e11522ce283d)
2008-01-11 22:44:33 -08:00
Günther Deschner
c79ce2ffa3 As long as DsGetDcName is not part of libnetapi, lowercase the fn name.
Guenther
(This used to be commit 19a980f52044a170618629e5b0484c1f6b586e5f)
2008-01-11 15:32:20 +01:00
Michael Adam
f3603d5a5a Convert add_sid_to_array() add_sid_to_array_unique() to return NTSTATUS.
Michael
(This used to be commit 6b2b9a60ef857ec31da5fea631535205fbdede4a)
2008-01-09 01:47:10 +01:00
Michael Adam
de53e47c76 Fix prototype: Add a void to an empty function parameter list.
Michael
(This used to be commit 3f89aea8e4df3a2de8c5e4c6f4e417567adb2d67)
2008-01-09 01:47:10 +01:00
Günther Deschner
cab9aa525d Fix build warning.
Guenther
(This used to be commit 73233a06d6f0f1346c48b465750af4b532cd7306)
2008-01-07 14:53:16 +01:00
Michael Adam
d82702c218 Use the proper boolean constants.
Michael
(This used to be commit 6f673b7f10c145d88e6a6d3072b5f8cd98837304)
2008-01-07 11:27:54 +01:00
Michael Adam
0818d41697 Fix a comment.
Michael
(This used to be commit 62d6d4fff2edcce04e793d2a2f877cb3f4fedbdb)
2008-01-07 11:19:27 +01:00
Michael Adam
696cf4d3c0 Make wcache_invalidate_cache() return bool, not int.
Michael
(This used to be commit dba24ceae78ffc49200b647838b6bf3657275add)
2008-01-07 10:59:14 +01:00
Michael Adam
c4d3f1b0f5 Add some braces to if statement.
Michael
(This used to be commit 66fc1db1d19d11792d9506b06ad914d88b7e0663)
2008-01-07 10:41:09 +01:00
Andreas Schneider
18699d003b Prevent winbindd from segfaulting due to corrupted cache tdb.
If we try to flush the caches and due to a corrupted tdb we and have no tdb
context close the tdb and validate it. Initialize the cache afterwards again.
(This used to be commit d0c0f91fb9f3438a18c6f47ed894f525beb75cbf)
2008-01-07 10:24:34 +01:00
Gerald (Jerry) Carter
84a50e2154 Fix the inherited trust flags when spidering the trust heirarchy.
Also *do not* clear the trust list when rescanning or else it is possible
to suffer from a race condition where no trusted domains can be found.
(This used to be commit e7164a252bf213a74d6eeac5aa04645eed5be241)
2008-01-04 13:35:41 -06:00
Gerald (Jerry) Carter
4093b0632c Add a missing check for dealing with a one-way trust in query_user().
(This used to be commit f89e356bdaa203ef0a3ce6b8bd52170afa68a2c9)
2008-01-04 13:34:10 -06:00
Gerald (Jerry) Carter
bcc2a6a9d7 Ensure that winbindd_getgroups() can deal with a UPN name.
A user logging in via GDM was not getting a complete list of supplementary
groups in his/her token.  This is because getgroup() was not able to
find the winbindd_domain* using the DNS name.  Fallback to matching the DNS
name is the short name match failes.
(This used to be commit 2030a8de19a2c7c735a8aa367dd953e4a5c447b8)
2008-01-04 13:32:58 -06:00
Gerald (Jerry) Carter
9a45dcef4d When connecting to an AD DC, use the DsGetDCName variant.
This allows us to deal with child domains in transitive forest trusts.
It also allows us to fill in the forest name to the target domain to the
struct winbindd_domain *.
(This used to be commit ed30516bb0f55f9ba466debf91b6e33d1c28a484)
2008-01-04 13:31:07 -06:00
Jeremy Allison
f10074e84b Use correct size value for linearize call.
Jeremy.
(This used to be commit a5df44f5b7887d10c1e1a0b7a3dd05bcf31015e1)
2007-12-29 14:43:32 -08:00
Volker Lendecke
a59280792c Remove tiny code duplication
sid_size did the same as ndr_size_dom_sid
(This used to be commit 8aec5d09ba023413bd8ecbdfbc7d23904df94389)
2007-12-29 23:12:51 +01:00
Jeremy Allison
98bc591c4f Add NT error to debug to try and track this down.
Jermey.
(This used to be commit a1482b09150f4d292965c77bc73d47fb14f5eb85)
2007-12-21 16:43:02 -08:00
Günther Deschner
8ded1df767 Kill fstring in getdcname & getanydcname return.
Guenther
(This used to be commit b7383818168863a7ba43c2456f8c44e96e76707a)
2007-12-21 15:12:40 +01:00
Michael Adam
e3bb148b94 Only retrieve password policies in pam_auth when WBFLAG_PAM_GET_PWD_POLICY is set.
This essentially re-establishes r14496 (2155bb0535656f294bd054d6a0a7d16a9a71c31b)
which was undone in r17723 (43bd8c00abb38eb23a1497a255d194fb1bbffffb) for
reasons that are unclear to me. Maybe I am being too naive.

Now we do again only retrieve the password policy when called from
the pam_winbind module. This fixes logons delegated to AD trusted
domain controllers: We need to connect to the sam to retrieve the
password policy. But auhtenticated session setup is not possible
when contacting the trusted domain dc and afterwards, SamrConnect
also fails with whatever credentials and method used.

Michael
(This used to be commit 6d765e0de523211a2d0b43a2c4c4117f5f0c662f)
2007-12-20 02:05:55 +01:00
Volker Lendecke
e518e19bc0 Remove Get_Pwnam and its associated static variable
All callers are replaced by Get_Pwnam_alloc
(This used to be commit 735f59315497113aebadcf9ad387e3dbfffa284a)
2007-12-19 21:09:10 +01:00
Michael Adam
a62cc94443 Fix logic error in cm_connect_sam().
Don't fall back to schannel when trust creds could be obtained.
This is still not complete, but I am getting closer.

Michael
(This used to be commit 7c9fa597d684a25822b4db6615f28336f2d64ef3)
2007-12-18 01:55:48 +01:00
Gerald (Jerry) Carter
d9553e8fd1 Fix a segv in winbindd caused by trying to free an fstring.
Make a copy of the machine_password and machine_account strings
in all conditional paths so that SAFE_FREE() will always be valid.
(This used to be commit 194c4640b158457a6d0d5ea91e28d41d619c77de)
2007-12-17 17:33:48 -06:00
Volker Lendecke
2e07c2ade8 s/sid_to_string/sid_to_fstring/
least surprise for callers
(This used to be commit eb523ba77697346a365589101aac379febecd546)
2007-12-15 22:47:30 +01:00
Volker Lendecke
14ef4cdec1 Replace sid_string_static with sid_to_string
This adds 28 fstrings on the stack, but I think an fstring on the stack is
still far better than a static one.
(This used to be commit c7c885078be8fd3024c186044ac28275d7609679)
2007-12-15 22:09:37 +01:00
Volker Lendecke
d899b8c56a Use sid_to_string directly
It seems a bit pointless to do a fstrcpy(dst, sid_string_static(src))
(This used to be commit c221c246b10e2dbbd54a9af2dc45de2eae237380)
2007-12-15 22:09:36 +01:00
Volker Lendecke
54ae9dfcbc Use sid_string_talloc where we have a tmp talloc ctx
(This used to be commit 0a911d38b8f4be382a9df60f9c6de0c500464b3a)
2007-12-15 22:09:36 +01:00
Volker Lendecke
900288a2b8 Replace sid_string_static by sid_string_dbg in DEBUGs
(This used to be commit bb35e794ec129805e874ceba882bcc1e84791a09)
2007-12-15 22:09:36 +01:00
Volker Lendecke
105635e23c Use sid_string_talloc where we have a tmp talloc ctx
(This used to be commit f00ab810d2540679bec109498ac89e1eafe18f03)
2007-12-15 22:09:35 +01:00
Stefan Metzmacher
873f14ae40 winbindd: move domain child specific stuff into its own file
metze
(This used to be commit 075d315e0f72d506b70040da10940e4af131b4e2)
2007-12-14 08:28:35 +01:00
Michael Adam
9104d2bf79 Make cm_connect_sam() try harder to connect autheticated.
Even if the session setup was anonymous, try and collect
trust creds with get_trust_creds() and use these before
falling back to schannel.

This is the first attempt to fix interdomain trusts.
(get password policy and stuff)

Michael
(This used to be commit e180bbd45452435e981192028a0ad90078c04236)
2007-12-13 10:15:20 +01:00
Michael Adam
13e0e4bdf2 Refactor out assembling of trust creds (pw, account name, principal).
Michael
(This used to be commit 481f18b20d6d5ee12c62120a3559bb16cc98e465)
2007-12-13 10:15:20 +01:00
Michael Adam
a493c7baac Streamline and fix logic of cm_prepare_connection().
Do not attempt to do a session setup when in a trusted domain
situation (this gives STATUS_NOLOGON_TRUSTED_DOMAIN_ACCOUNT).

Use get_trust_pw_clear to get machine trust account.
Only call this when the results is really used.
Use the proper domain and account name for session setup.

Michael
(This used to be commit 18c66a364e0ddc4960769871ca190944f7fe5c44)
2007-12-13 10:15:20 +01:00
Michael Adam
31f221ed93 Rename get_trust_pw() to get_trust_pw_hash().
Michael
(This used to be commit 0cde7ac9cb39a0026a38ccf66dbecefc12931074)
2007-12-13 10:15:19 +01:00
Michael Adam
f793c99ca5 Let get_trust_pw() determine the machine_account_name to use.
Up to now each caller used its own logic.

This eliminates code paths where there was a special treatment
of the following situation: the domain given is not our workgroup
(i.e. our own domain) and we are not a DC (i.e. it is not a typical
trusted domain situation). In situation the given domain name was
previously used as the machine account name, resulting in an account
name of DOMAIN\\DOMAIN$, which does not seem very reasonable to me.
get_trust_pw would not have obtained a password in this situation
anyways.

I hope I have not missed an important point here!

Michael
(This used to be commit 6ced4a7f88798dc449a667d63bc29bf6c569291f)
2007-12-13 10:15:17 +01:00
Michael Adam
5d9c977034 Streamline logic in cm_connect_netlogon()
by retrieving trust password only, when it will be used.

Michael
(This used to be commit cdc60d8ae8c0ef804206b20b451e9557f97d4439)
2007-12-13 10:15:16 +01:00
Michael Adam
4884f5d23a In cm_prepare_connection(), only get auth user creds if we need to.
Michael
(This used to be commit 164bfb25d7b5cfeffeb4d81958b7629a11ca5d5e)
2007-12-13 10:15:14 +01:00
Andreas Schneider
d818a93d07 Don't restart winbind if a corrupted tdb is found during initialization.
The tdb is validated before it gets initialized. Since then sighandlers changed
a restart isn't needed anymore.
(This used to be commit aabe9b33fcaed8af98b1ed6b736253e196d87d48)
2007-12-12 13:51:13 +01:00
Stefan Metzmacher
38f8d32d10 winbindd: remove unused WINBINDD_DUMP_MAPS support
Also the design of this function was really bad,
instead do the dump into a file, the client should get
back the list of mappings.

metze
(This used to be commit ce7fe8acf41e90553431c7cda6823700701835c7)
2007-12-12 10:07:05 +01:00
Stefan Metzmacher
3728c8b6d9 winbindd: remove unused WINBINDD_DUAL_NAME2*ID and WINBINDD_DUAL_*ID2NAME calls
WINBINDD_DUAL_UID2NAME
WINBINDD_DUAL_NAME2UID
WINBINDD_DUAL_GID2NAME
WINBINDD_DUAL_NAME2GID

metze
(This used to be commit fd4499ee438e4947990200db529363d51bd2c956)
2007-12-12 09:34:20 +01:00
Stefan Metzmacher
af3cc957f0 winbindd: pass const char *logfile to winbindd_dump_maps_async()
metze
(This used to be commit a52237e3a10aa4ac15cd9e7b859a54c46bfa9cdf)
2007-12-11 16:51:44 +01:00