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

1265 Commits

Author SHA1 Message Date
Karolin Seeger
cdb88dcf6b Change ldap search filter. This function is also used to search machine accounts which may be located in a different ou. This is an extension to e71a48bb80.
Karolin
(This used to be commit e5cc8b683c)
2008-02-19 12:35:54 +01:00
Günther Deschner
7dfeae6073 Use netr_SamInfo3 in remaining places.
Guenther
(This used to be commit 92fca97951)
2008-02-17 02:12:01 +01:00
Stefan Metzmacher
cedfcaec0c nsswitch: convert winbind_env_set(), winbind_on() and winbind_off() into macros
metze
(This used to be commit 5f623f54a9)
2008-02-13 10:44:52 +01:00
Günther Deschner
e4501b0913 Add get_logon_hours_from_pdb() (inspired by samba4).
Guenther
(This used to be commit e1bcb7d82f)
2008-02-12 14:52:25 +01:00
Karolin Seeger
cd50bc575e Change ldap search filter. This function is also used to search machine accounts which may be organized in a different ou.
Karolin
(This used to be commit e71a48bb80)
2008-02-11 10:03:47 +01:00
Günther Deschner
7ec5bfc49f More paranoid checks for secrets_init() success.
Guenther
(This used to be commit 5e60852bae)
2008-02-09 02:05:39 +01:00
Karolin Seeger
932ec38a87 Fix typo.
Karolin
(This used to be commit 53b83bb53f)
2008-02-08 10:05:47 +01:00
Jeremy Allison
8b3004bcf9 Don't return true on talloc fail.
Jeremy.
(This used to be commit 21594cb34c)
2008-02-05 18:05:59 -08:00
Volker Lendecke
a31d5e49fe Fix valgrind errors
We need to keep the names around on the search. Probably a tdb_move would do it
here as well, but RPC is not the fastest thing on earth anyway...

Thanks to Günther for pointing that out to me!
(This used to be commit c9472ae610)
2008-02-04 19:41:04 +01:00
Volker Lendecke
c246eeb6f1 Remove a static
I very much doubt that this is called enough to justify a global. If this turns
out to be a hot code path, we might reconsider :-)
(This used to be commit 5223d18ea2)
2008-02-04 19:40:08 +01:00
Michael Adam
76e5c1f79a Fix lookup_sids to detect unix_groups and unix_users domain sids.
This fixes panics in wbcLookupRids when 1-2-22 was passed as a
domain sid.

Michael
(This used to be commit c0d9732cf4)
2008-01-25 01:42:22 +01:00
Michael Adam
60daaeeb34 Add a debug message: show the sid lookup_sid() was called for.
Michael
(This used to be commit 6c7c6c3f85)
2008-01-25 01:42:22 +01:00
Michael Adam
d682e04828 Add a debug message to lookup_rids() printing the domain SID.
This is to ease debugging. I sporadically get panics that are
apparently due to NULL domain sid passed to lookup_rids somewhere.

Michael
(This used to be commit 723e877c24)
2008-01-25 01:42:22 +01:00
Jeremy Allison
aa8818bcc3 Fix CID 469. new_acct can't be NULL here.
Jeremy.
(This used to be commit c79e9414c4)
2008-01-12 00:09:35 -08:00
Michael Adam
7c6d77dd88 Fix memleak in ldapsam_rename_sam_account() found by IBM checker.
The check for out of memory was the wrong way round.

Michael
(This used to be commit d7a7b79320)
2008-01-09 22:09:55 +01:00
Michael Adam
f3603d5a5a Convert add_sid_to_array() add_sid_to_array_unique() to return NTSTATUS.
Michael
(This used to be commit 6b2b9a60ef)
2008-01-09 01:47:10 +01:00
Günther Deschner
c0d33508ff Add secrets_shutdown().
Guenther
(This used to be commit dd3fbd93b6)
2008-01-07 12:48:21 +01:00
Jeremy Allison
cfcdeb52bf Fix for bug #5163 from Laurent Pinchart <pinchart@skynet.be>
Failure to change password in ldap is mapped to NT_STATUS_UNSUCCESSFUL unconditionally.
Jeremy.
(This used to be commit 9369d6e907)
2008-01-02 18:20:23 -08:00
Michael Adam
df450fc090 Make pdb_tdb honour a private dir overridden in smb.conf.
One lp_private_dir() has to be used instead of get_dyn_PRIVATE_DIR()
to determine the location of the passdb.tdb.

I noticed this when running make test as a "normal user" from a
build, where I had done "make install" as root before, and so
the passdb.tdb could not be accessed during the startup phase
"CREATE TEST ENVIRONMENT IN ./st ..." in selftest.sh.

Michael
(This used to be commit 1f96389afa)
2007-12-29 21:38:39 -08:00
Volker Lendecke
40bf6730aa passdb.tdb is located in the private directory
Jerry, as part of d6cdbfd87 the default location of passdb.tdb has changed from
the private directory to the state directory. I think because passdb.tdb holds
the password hashes, it is reasonable to keep this next to the smbpasswd file.

Please review and potentially push.

Thanks,

Volker
(This used to be commit c9c7607c40)
2007-12-29 01:01:47 -08:00
Volker Lendecke
3c99b7773e Convert csamuser to memcache
(This used to be commit 476d3abf9c)
2007-12-28 13:13:29 +01:00
Volker Lendecke
e70c97ef85 Remove the sampwent interface
(This used to be commit 9e80b969fb)
2007-12-26 18:57:15 +01:00
Volker Lendecke
f633d348d7 smbpasswd_search_users
(This used to be commit 84af4fb656)
2007-12-26 18:57:14 +01:00
Volker Lendecke
533c7c81fe Add tdbsam_search_users
(This used to be commit 02f0b0bd39)
2007-12-26 18:57:14 +01:00
Volker Lendecke
a55a08a217 Convert the [gu]id_sid cache to memcache
(This used to be commit 4baf36784f)
2007-12-23 12:43:29 +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 735f593154)
2007-12-19 21:09:10 +01:00
Günther Deschner
d0cd32e2c8 Add and use some keystr functions using talloc_tos() in secrets api.
Guenther
(This used to be commit 6ccbf67a0c)
2007-12-19 11:15:17 +01:00
Michael Adam
a3081ba5b5 Prevent another segfault.
Michael
(This used to be commit 0a9874c1c7)
2007-12-18 01:30:52 +01:00
Michael Adam
9f5a16a22d Remove direct caller of secrets_fetch_trusted_domain_password().
This is a regession introduced by f7efc0eca9.
This calls pdb_get_trusteddom_pw() instead, again.

Michael
(This used to be commit 91be824d2b)
2007-12-17 14:51:37 +01:00
Michael Adam
81327b1613 Fix for bug #4801: Correctly implement lsa lookup levels for lookupnames.
This patch is still incomplete in that winbindd does not walk
the the trusted domains to lookup unqualified names here.
Apart from that this fix should be pretty much complete.

Michael
(This used to be commit f7efc0eca9)
2007-12-17 13:06:13 +01:00
Volker Lendecke
2e07c2ade8 s/sid_to_string/sid_to_fstring/
least surprise for callers
(This used to be commit eb523ba776)
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 c7c885078b)
2007-12-15 22:09:37 +01:00
Volker Lendecke
54ae9dfcbc Use sid_string_talloc where we have a tmp talloc ctx
(This used to be commit 0a911d38b8)
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 bb35e794ec)
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 f00ab810d2)
2007-12-15 22:09:35 +01:00
Stefan Metzmacher
adc31b9235 Revert "Fix for bug #4801: Correctly implement lsa lookup levels for lookupnames."
As it breaks all tests which try to join a new machine account.
So more testing is needed...

metze

This reverts commit dd320c0924.
(This used to be commit cccb80b7b7)
2007-12-14 08:28:10 +01:00
Michael Adam
ce76bcff29 Pass NULL instead of unneeded &sid: pdb_get_trusteddom_pw() checks.
Michael
(This used to be commit b2e12365b5)
2007-12-13 10:15:19 +01:00
Michael Adam
31f221ed93 Rename get_trust_pw() to get_trust_pw_hash().
Michael
(This used to be commit 0cde7ac9cb)
2007-12-13 10:15:19 +01:00
Michael Adam
1084151442 Export logic of get_trust_pw() to new function get_trust_pw_clear().
get_trust_pw() just now computes the md4 hash of the result of
get_trust_pw_clear() if that was successful. As a last resort,
in the non-trusted-domain-situation, get_trust_pw() now tries to
directly obtain the hashed version of the password out of secrets.tdb.

Michael
(This used to be commit 4562342eb8)
2007-12-13 10:15:18 +01:00
Michael Adam
fe969f9a7f Refactor the lagacy part of secrets_fetch_trust_account_password() out
into a new function secrets_fetch_trust_account_password_legacy() that
does only try to obtain the hashed version of the machine password directly
from secrets.tdb.

Michael
(This used to be commit 91da12b751)
2007-12-13 10:15:18 +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 6ced4a7f88)
2007-12-13 10:15:17 +01:00
Michael Adam
b99a6b0e8c Remove two unneeded functions.
secrets_store_trust_account_password() and trust_password_delete()
are the write access functions to the SECRETS/$MACHINE.ACC/domain keys
in secrets.tdb, the md4 hashed machine passwords. These are not used
any more: Current code always writes the clear text password.

Michael
(This used to be commit 4788fe3924)
2007-12-13 10:15:13 +01:00
Michael Adam
951466000c Fix for bug #4801: Correctly implement lsa lookup levels for lookupnames.
This is a first patch aimed at fixing bug #4801.
It is still incomplete in that winbindd does not walk
the the trusted domains to lookup unqualified names here.
Apart from that this fix should be pretty much complete.

Michael
(This used to be commit dd320c0924)
2007-12-13 10:15:13 +01:00
Michael Adam
2ade25279c Fix logic and prevent segfaults in secrets trustdom tdb pack code.
New size calculation logic in tdb_trusted_dom_pass_pack()
and tdb_sid_pack() used accumulated sizes as successive offsets
to buffer pointer.

Michael
(This used to be commit 9c24713b40)
2007-12-12 09:47:41 -08:00
Michael Adam
b0469d0b69 Fix secrets_store_trusted_domain_password() after pstring removal.
Jeremy, this small "&" sign has given me a headache... :-)

Michael
(This used to be commit 7590b12a99)
2007-12-12 09:47:28 -08:00
Jeremy Allison
7faee02d0d Remove the char[1024] strings from dynconfig. Replace
them with malloc'ing accessor functions. Should save a
lot of static space :-).
Jeremy.
(This used to be commit 52dc5eaef2)
2007-12-10 11:30:37 -08:00
Jeremy Allison
42cfffae80 Remove next_token - all uses must now be next_token_talloc.
No more temptations to use static length strings.
Jeremy.
(This used to be commit ec003f3936)
2007-12-07 17:32:32 -08:00
Jeremy Allison
bcf033b38e Change tdb_unpack "P" to return a malloc'ed string rather
than expect a pstring space to put data into.
Fix the (few) callers.
Jeremy.
(This used to be commit 7722a7d2c6)
2007-12-03 14:54:06 -08:00
Jeremy Allison
1cd1c9db3f Remove unused prototype for smbldap_get_single_pstring().
Don't use pstr_sprintf() on an fstring - change to talloc.
Jeremy.
(This used to be commit 6cae4b5fa1)
2007-11-27 22:22:35 -08:00
Michael Adam
96ea32b886 Use the proper boolean constants - the type has been
changed from BOOL to bool.

Michael
(This used to be commit 03673f2cd6)
2007-11-27 16:36:06 +01:00