1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
Commit Graph

1266 Commits

Author SHA1 Message Date
Volker Lendecke
ad37b7b0ae Fix some warnings
warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result
2008-02-25 16:09:26 +01:00
Karolin Seeger
e5cc8b683c 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
2008-02-19 12:35:54 +01:00
Günther Deschner
92fca97951 Use netr_SamInfo3 in remaining places.
Guenther
2008-02-17 02:12:01 +01:00
Stefan Metzmacher
5f623f54a9 nsswitch: convert winbind_env_set(), winbind_on() and winbind_off() into macros
metze
2008-02-13 10:44:52 +01:00
Günther Deschner
e1bcb7d82f Add get_logon_hours_from_pdb() (inspired by samba4).
Guenther
2008-02-12 14:52:25 +01:00
Karolin Seeger
e71a48bb80 Change ldap search filter. This function is also used to search machine accounts which may be organized in a different ou.
Karolin
2008-02-11 10:03:47 +01:00
Günther Deschner
5e60852bae More paranoid checks for secrets_init() success.
Guenther
2008-02-09 02:05:39 +01:00
Karolin Seeger
53b83bb53f Fix typo.
Karolin
2008-02-08 10:05:47 +01:00
Jeremy Allison
21594cb34c Don't return true on talloc fail.
Jeremy.
2008-02-05 18:05:59 -08:00
Volker Lendecke
c9472ae610 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!
2008-02-04 19:41:04 +01:00
Volker Lendecke
5223d18ea2 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 :-)
2008-02-04 19:40:08 +01:00
Michael Adam
c0d9732cf4 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
2008-01-25 01:42:22 +01:00
Michael Adam
6c7c6c3f85 Add a debug message: show the sid lookup_sid() was called for.
Michael
2008-01-25 01:42:22 +01:00
Michael Adam
723e877c24 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
2008-01-25 01:42:22 +01:00
Jeremy Allison
c79e9414c4 Fix CID 469. new_acct can't be NULL here.
Jeremy.
2008-01-12 00:09:35 -08:00
Michael Adam
d7a7b79320 Fix memleak in ldapsam_rename_sam_account() found by IBM checker.
The check for out of memory was the wrong way round.

Michael
2008-01-09 22:09:55 +01:00
Michael Adam
6b2b9a60ef Convert add_sid_to_array() add_sid_to_array_unique() to return NTSTATUS.
Michael
2008-01-09 01:47:10 +01:00
Günther Deschner
dd3fbd93b6 Add secrets_shutdown().
Guenther
2008-01-07 12:48:21 +01:00
Jeremy Allison
9369d6e907 Fix for bug #5163 from Laurent Pinchart <pinchart@skynet.be>
Failure to change password in ldap is mapped to NT_STATUS_UNSUCCESSFUL unconditionally.
Jeremy.
2008-01-02 18:20:23 -08:00
Michael Adam
1f96389afa 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
2007-12-29 21:38:39 -08:00
Volker Lendecke
c9c7607c40 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
2007-12-29 01:01:47 -08:00
Volker Lendecke
476d3abf9c Convert csamuser to memcache 2007-12-28 13:13:29 +01:00
Volker Lendecke
9e80b969fb Remove the sampwent interface 2007-12-26 18:57:15 +01:00
Volker Lendecke
84af4fb656 smbpasswd_search_users 2007-12-26 18:57:14 +01:00
Volker Lendecke
02f0b0bd39 Add tdbsam_search_users 2007-12-26 18:57:14 +01:00
Volker Lendecke
4baf36784f Convert the [gu]id_sid cache to memcache 2007-12-23 12:43:29 +01:00
Volker Lendecke
735f593154 Remove Get_Pwnam and its associated static variable
All callers are replaced by Get_Pwnam_alloc
2007-12-19 21:09:10 +01:00
Günther Deschner
6ccbf67a0c Add and use some keystr functions using talloc_tos() in secrets api.
Guenther
2007-12-19 11:15:17 +01:00
Michael Adam
0a9874c1c7 Prevent another segfault.
Michael
2007-12-18 01:30:52 +01:00
Michael Adam
91be824d2b 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
2007-12-17 14:51:37 +01:00
Michael Adam
f7efc0eca9 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
2007-12-17 13:06:13 +01:00
Volker Lendecke
eb523ba776 s/sid_to_string/sid_to_fstring/
least surprise for callers
2007-12-15 22:47:30 +01:00
Volker Lendecke
c7c885078b 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.
2007-12-15 22:09:37 +01:00
Volker Lendecke
0a911d38b8 Use sid_string_talloc where we have a tmp talloc ctx 2007-12-15 22:09:36 +01:00
Volker Lendecke
bb35e794ec Replace sid_string_static by sid_string_dbg in DEBUGs 2007-12-15 22:09:36 +01:00
Volker Lendecke
f00ab810d2 Use sid_string_talloc where we have a tmp talloc ctx 2007-12-15 22:09:35 +01:00
Stefan Metzmacher
cccb80b7b7 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.
2007-12-14 08:28:10 +01:00
Michael Adam
b2e12365b5 Pass NULL instead of unneeded &sid: pdb_get_trusteddom_pw() checks.
Michael
2007-12-13 10:15:19 +01:00
Michael Adam
0cde7ac9cb Rename get_trust_pw() to get_trust_pw_hash().
Michael
2007-12-13 10:15:19 +01:00
Michael Adam
4562342eb8 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
2007-12-13 10:15:18 +01:00
Michael Adam
91da12b751 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
2007-12-13 10:15:18 +01:00
Michael Adam
6ced4a7f88 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
2007-12-13 10:15:17 +01:00
Michael Adam
4788fe3924 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
2007-12-13 10:15:13 +01:00
Michael Adam
dd320c0924 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
2007-12-13 10:15:13 +01:00
Michael Adam
9c24713b40 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
2007-12-12 09:47:41 -08:00
Michael Adam
7590b12a99 Fix secrets_store_trusted_domain_password() after pstring removal.
Jeremy, this small "&" sign has given me a headache... :-)

Michael
2007-12-12 09:47:28 -08:00
Jeremy Allison
52dc5eaef2 Remove the char[1024] strings from dynconfig. Replace
them with malloc'ing accessor functions. Should save a
lot of static space :-).
Jeremy.
2007-12-10 11:30:37 -08:00
Jeremy Allison
ec003f3936 Remove next_token - all uses must now be next_token_talloc.
No more temptations to use static length strings.
Jeremy.
2007-12-07 17:32:32 -08:00
Jeremy Allison
7722a7d2c6 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.
2007-12-03 14:54:06 -08:00
Jeremy Allison
6cae4b5fa1 Remove unused prototype for smbldap_get_single_pstring().
Don't use pstr_sprintf() on an fstring - change to talloc.
Jeremy.
2007-11-27 22:22:35 -08:00