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

476 Commits

Author SHA1 Message Date
Tim Prouty
10e9e95ce8 s3 build: Fix "assignment discards qualifiers from pointer target type" warnings 2009-02-02 00:03:09 -08:00
Dan Sledz
d96248a9b4 Add two new parameters to control how we verify kerberos tickets. Removes lp_use_kerberos_keytab parameter.
The first is "kerberos method" and replaces the "use kerberos keytab"
with an enum.  Valid options are:
secrets only - use only the secrets for ticket verification (default)
system keytab - use only the system keytab for ticket verification
dedicated keytab - use a dedicated keytab for ticket verification.
secrets and keytab - use the secrets.tdb first, then the system keytab

For existing installs:
"use kerberos keytab = yes" corresponds to secrets and keytab
"use kerberos keytab = no" corresponds to secrets only

The major difference between "system keytab" and "dedicated keytab" is
that the latter method relies on kerberos to find the correct keytab
entry instead of filtering based on expected principals.

The second parameter is "dedicated keytab file", which is the keytab
to use when in "dedicated keytab" mode.  This keytab is only used in
ads_verify_ticket.
2009-02-01 20:23:31 -08:00
Michael Adam
d75b3913c9 s3:winbind_group: fix "getent group" to allocate new gids.
"getent group" used to fill the idmap cache with negative
cache entries for unmapped group sids.

Don't pass domain name unconditionally to idmap_sid_to_gid().
idmap_sid_to_gid() only creates new mappings (allocating
idmap backends tdb, tdb2, ldap...) when the domain name passed
in is "".

Note that it is _wrong_ to directly call the idmap_sid_to_gid()
functions here, in the main winbindd. The correct fix would be
to send a sid_to_gid request to winbindd itself, but this needs
more work to prepare the async mechanisms, and we nee a quick
fix for getent passwd now.

Michael
2009-02-02 00:53:05 +01:00
Michael Adam
a0d0519200 s3:winbind_user: fix "getent passwd" to allocate new uids.
"getent passwd" used to fill the idmap cache with negative
cache entries for unmapped user sids.

Don't pass domain name unconditionally to idmap_sid_to_[ug]id().
idmap_sid_to_[ug]id() only creates new mappings (allocating
idmap backends tdb, tdb2, ldap...) when the domain name passed
in is "".

Note that it is _wrong_ to directly call the idmap_sid_to_[ug]id()
functions here, in the main winbindd. The correct fix would be
to send a sid_to_[ug]id request to winbindd itself, but this needs
more work to prepare the async mechanisms, and we nee a quick
fix for getent passwd now.

Michael
2009-02-02 00:53:05 +01:00
Michael Adam
8c57f34b99 s3:winbind_user: move initialization of domain up in winbindd_fill_pwent()
and streamline logic some

Michael
2009-02-02 00:53:04 +01:00
Volker Lendecke
0bd92281e4 Make cli_tcon_andx async 2009-01-30 12:47:59 +01:00
Michael Adam
f2224e53b2 s3:idmap: move IDMAP_VERSION to the idmap tdb backend, where it belogns.
Michael
2009-01-30 00:17:57 +01:00
Michael Adam
1021c752ea s3:winbind: remove prototype for non-existent function from winbind_proto.h
Michael
2009-01-28 12:41:04 +01:00
Michael Adam
59859b547c s3: separate tdb validation code out into its own source file
So this gets now linked only into its single user: winbindd
(needed by winbindd_cache.c)

Michael
2009-01-28 09:43:57 +01:00
Tim Prouty
31e46ff4ac s3: Fix shadowed declaration 2009-01-27 10:37:51 -08:00
Stefan Metzmacher
e6612c99fe s3:winbindd: handle SIG_TERM, SIGHUP, SIGCHLD and SIGUSR2 via tevent
metze
2009-01-27 15:28:08 +01:00
Stefan Metzmacher
cf53e48fec s3:winbindd: we don't need to call message_dispatch() anymore it's event triggered now
metze
2009-01-22 12:37:32 +01:00
Stefan Metzmacher
048f8dba14 s3: always call run_events() before and after sys_select()
And always setup the fd events.

metze
2009-01-22 12:37:29 +01:00
todd stecher
989ad44d32 Memory leaks and other fixes found by Coverity 2009-01-21 17:13:03 -08:00
Stefan Metzmacher
4feafd7c7b s3:idmap_tdb: convert to the dbwrap api
metze
2009-01-19 17:06:41 +01:00
Volker Lendecke
e58a8c169c Fix the same bug as 8b618d0 fixes, this time in winbindd_passdb.c 2009-01-19 11:49:18 +01:00
Michael Adam
edbc7efa35 s3:winbindd: put winbindd_cache.tdb into cache_dir, not lock_dir.
Michael
2009-01-16 01:02:23 +01:00
Michael Adam
39ec8791f8 s3: make better use of ccache by not including version.h in every C-file.
version.h changes rather frequently. Since it is included via includes.h,
this means each C file will be a cache miss. This applies to the following
situations:

* When building a new package with a new Samba version

* building in a git branch after calling mkversion.sh
  after a new commit (i.e. virtually always)

This patch improves the situation in the following way:

* remove inlude "version.h" from includes.h

* Use samba_version_string() instead of SAMBA_VERSION_STRING
  in files that use no other macro from version.h instead of
  SAMBA_VERSION_STRING.

* explicitly include "version.h" in those files that use more
  macros from "version.h" than just SAMBA_VERSION_STRING.

Michael
2009-01-15 22:56:01 +01:00
Bo Yang
e3ef19b9b9 Fix bug in get_dc_name_via_netlogon(), null pointer refrence. 2009-01-14 11:47:45 -08:00
Jeremy Allison
9aa385a090 Clean up comments a little.
Jeremy.
2009-01-14 11:12:52 -08:00
Bo Yang
54325f7ed5 Don't send message to any other child in child process.
Signed-off-by: Bo Yang <boyang@novell.com>
2009-01-14 10:42:02 -08:00
Jeremy Allison
58b680446f From boyang - ensure we never "return" from a forked child, always _exit().
Jeremy.
2009-01-13 15:42:56 -08:00
Bo Yang
0c2f8ab3ec Don't set child->requests to NULL in parent after fork 2009-01-10 14:12:08 -08:00
boyang
45c67ff244 refresh sequence number as soon as possible when domain->sequence_number == -1 or domain->last_status is not ok. 2009-01-07 11:02:04 -08:00
Volker Lendecke
00a401aa3e Remove unused struct CLI_POLICY_HND 2009-01-07 17:17:03 +01:00
Jeremy Allison
d1f7a37174 Make winbindd_cm.c use winbindd_reinit_after_fork().
Jeremy.
2009-01-06 17:34:06 -08:00
Jeremy Allison
7b77ac5365 Add winbindd_reinit_after_fork(), cleaning out all possible events
in a forked child.
Jeremy.
2009-01-06 15:14:52 -08:00
Jeremy Allison
e95101da58 Factor out lots of common code into a function.
Jeremy.
2009-01-06 13:16:46 -08:00
Günther Deschner
d2d8d7a087 s3-samr: avoid all init_samr_Domain* functions.
Guenther
2009-01-06 16:02:11 +01:00
Bo Yang
958bfaff79 set entry->refresh_time to make ccache_regain_all_now() work correctly. 2009-01-05 21:09:44 -08:00
Stefan Metzmacher
59612beea6 s3:winbindd: also handle fd events from the winbind_event_context()
metze
2009-01-05 15:07:36 +01:00
Stefan Metzmacher
c34d5f445a s3:events: change event_add_timed() prototype to match samba4
metze
2009-01-05 15:07:35 +01:00
Stefan Metzmacher
492d0e3517 s3:winbindd: regain tickets for all ccache entries, when we go online
set_event_dispatch_time() is stupid by design and only handles
the first event with a given name.

metze
2009-01-05 15:07:33 +01:00
Stefan Metzmacher
94c4376b49 s3:winbindd: cancel all ccache entry events and not just one
cancel_named_event() is stupid by design and also only cancels
one single event.

metze
2009-01-05 15:07:33 +01:00
Stefan Metzmacher
f81f21c09b s3:winbindd: recreate the per domain check_online_event without relying on global state
set_event_dispatch_time() is stupid by design and just picks the first
event with the given name.

metze
2009-01-05 15:07:32 +01:00
Stefan Metzmacher
a1c9e61643 s3:winbindd: rename fd_event => winbindd_fd_event
It's really confusing to have two versions of 'fd_event'

metze
2009-01-05 15:07:32 +01:00
Stefan Metzmacher
2428ec46d8 s3:winbindd: move WINBINDD_CCACHE_ENTRY and WINBINDD_MEMORY_CREDS to winbindd.h
metze
2009-01-05 15:07:32 +01:00
Bo Yang
f389b97c69 Fix broken krb5 refresh chain
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-01-05 15:07:31 +01:00
Bo Yang
022e2f8199 clean event context after child is forked.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-01-05 15:07:31 +01:00
Volker Lendecke
8c1691d213 Remove wb_trans_send/recv 2009-01-04 16:42:40 +01:00
Volker Lendecke
d933362cb7 Move winbindd/winbindd_reqtrans.c to lib/wb_reqtrans.c 2009-01-04 16:42:40 +01:00
Volker Lendecke
27abf6731e struct async_req doesn't really need to carry an event_context 2009-01-03 19:07:57 +01:00
Volker Lendecke
76d53e7648 Alternative fix for 45db33e73 and 0d443ae7931
Simo is right, we need to ask passdb first. At least this fixes a nasty to find
NT_STATUS_ACCESS_DENIED problem in the build farm for the test run I just did
on host "opi".

Michael, can you re-check if this also fixes the error you found, leading to
the two fixes?

Thanks,

Volker
2009-01-02 15:00:05 +01:00
Volker Lendecke
13248e8917 Revert "s:Fix uid_to_sid mapping when the idmap cache is empty."
This reverts commit 9a9b64dbdf.
2009-01-02 15:00:05 +01:00
Volker Lendecke
c033ea5626 Revert "s3:idmap: Remove passd check from idmap_backends_unixid_to_sid()."
This reverts commit 45db33e732.
2009-01-02 15:00:05 +01:00
Jeremy Allison
bb23f5725f Fix more asprintf and "ignoring return code" warnings from gcc 4.3.
Jeremy.
2008-12-31 16:30:11 -08:00
Stefan Metzmacher
429276556a s3:winbindd: we don't need to call messaging_reinit() twice
reinit_after_fork() already calls messaging_reinit()

metze
2008-12-31 11:01:46 +01:00
Michael Adam
45db33e732 s3:idmap: Remove passd check from idmap_backends_unixid_to_sid().
As noted by Metzy, it makes no sense here to check id->sid.
What is worse, this might even be passed in uninitialized.

This still fixes the bug for me (of course), but we might need
to check, if another special handling of passdb is needed
(possibly changing from constant return code NT_STATUS_OK...)

Michael

Signed-off-by: Michael Adam <obnox@samba.org>
2008-12-25 12:14:03 +01:00
Michael Adam
9a9b64dbdf s:Fix uid_to_sid mapping when the idmap cache is empty.
This failed for backends other than passed, since
idmap_backends_unixid_to_sid() always asked passdb first,
which returned Success no matter whether a mapping was
found or not.

One effect wast that getpwuid failed after "net cache flush".
Only after filling the cache with a getpwnam call it succeeded.

This fix makes the behaviour of idmap_backends_unixid_to_sid()
exactly the same as that of idmap_backends_sid_to_unixid()

Michael

Signed-off-by: Michael Adam <obnox@samba.org>
2008-12-25 12:14:02 +01:00
Gerald (Jerry) Carter
5aadfe29f0 Fix "allow trusted domain" so it disables trusted domains. 2008-12-22 11:07:29 -08:00