1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-29 16:23:52 +03:00
Commit Graph

182 Commits

Author SHA1 Message Date
Volker Lendecke
44122f06d0 Fix Coverity ID 555 2008-03-15 22:30:25 +01:00
Günther Deschner
57dc747136 Make resolve_ads() static.
Guenther
2008-01-16 16:06:15 +01:00
Jeremy Allison
2e75f3ecdf Fix CID 470. resolve_order can't be NULL here so simplify code.
Jeremy.
2008-01-12 00:05:07 -08:00
Jeremy Allison
5c7f7629a9 Allow cliconnect to loop through multiple ip addresses
for a server. We should have been doing this for a while,
but it's more critical with IPv6.
Original patch fixed up by James.
Jeremy.
2007-12-12 09:42:58 -08:00
Jeremy Allison
cafde6c372 Ensure we have a non-null flags. Pointed out by Andreas Schneider <anschneider@suse.de>.
Jeremy.
2007-12-10 15:06:31 -08:00
Jeremy Allison
b40efc2fe6 Fix errors from next_token conversion. Spotted by
Andreas Schneider <anschneider@suse.de>.
Jeremy.
2007-12-10 14:21: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
James Peach
4786654992 Specifically ask for IP4 addresses if we don't have IP6 support. 2007-12-09 14:01:57 -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
Volker Lendecke
31d0a846db Remove some globals 2007-12-05 14:39:07 +01:00
Jeremy Allison
71ccd0c42e Remove pstrings from namequery.c.
Jeremy.
2007-11-27 23:10:20 -08:00
Jeremy Allison
a317f70c22 Remove pstring from nmbd.
Jeremy.
2007-11-19 15:15:09 -08:00
Jeremy Allison
814daded90 Change our DNS code to cope with AAAA records. A6 records
look like a nightmare to use, so ignore them for now.
Jeremy.
2007-10-29 13:34:00 -07:00
Jeremy Allison
2e92418a13 Change all occurrences of zero_addr(&ss,AF_INET) to
zero_addr(&ss). All current uses were always of the
AF_INET form, so simplify the call. If in the future
we need to zero an addr to AF_INET6 this can be
done separately.
Jeremy.
2007-10-27 20:29:36 -07:00
Jeremy Allison
a3f7db3d30 Move the horrible hack for link local addresses out of namequery.c
and into util_sock.c. is_ipaddress() now copes with link:local:v6%ifname
addresses, as does interpret_string_addr().
Jeremy
2007-10-26 16:03:20 -07:00
Jeremy Allison
e6609cab73 Fix resolve name to resolve IPv6 addresses of link-local%ifaddr
Jeremy.
2007-10-25 18:28:36 -07:00
Jeremy Allison
98e154c312 This is a large patch (sorry). Migrate from struct in_addr
to struct sockaddr_storage in most places that matter (ie.
not the nmbd and NetBIOS lookups). This passes make test
on an IPv4 box, but I'll have to do more work/testing on
IPv6 enabled boxes. This should now give us a framework
for testing and finishing the IPv6 migration. It's at
the state where someone with a working IPv6 setup should
(theorecically) be able to type :
smbclient //ipv6-address/share
and have it work.
Jeremy.
2007-10-24 14:16:54 -07:00
Gerald (Jerry) Carter
fd28d09a95 Fix a crash in resolve_hosts() caused by an out-of-bounds array reference. 2007-10-19 15:08:40 -05:00
Jeremy Allison
f35a266b3c RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
2007-10-18 17:40:25 -07:00
Jeremy Allison
4a56b697b6 Move to protocol independent code in most of lib/util_sock.c
We don't use gethostbyname any more except in one case where
we're looking for host aliases (I don't know how to do that
with getaddrinfo yet). New function should be getaddrinfo().
Next step will be fixing lib/access.c, and then changing
libsmb/namequery.c to cope with IPv6 address returns.
Jeremy.
2007-10-15 16:11:48 -07:00
Jeremy Allison
3f6bd0e1ec Add start of IPv6 implementation. Currently most of this is avoiding
IPv6 in winbindd, but moves most of the socket functions that were
wrongly in lib/util.c into lib/util_sock.c and provides generic
IPv4/6 independent versions of most things. Still lots of work
to do, but now I can see how I'll fix the access check code.
Nasty part that remains is the name resolution code which is
used to returning arrays of in_addr structs.
Jeremy.
2007-10-10 18:25:16 -07:00
Gerald Carter
00a93ed336 r25407: Revert Longhorn join patch as it is not correct for the 3.2 tree.
The translate_name() used by cli_session_setup_spnego() cann rely
Winbindd since it is needed by the join process (and hence before
Winbind can be run).
2007-10-10 12:31:03 -05:00
Gerald Carter
8304ccba73 r25400: Windows 2008 (Longhorn) Interop fixes for AD specific auth2 flags,
and client fixes.  Patch from Todd Stetcher <todd.stetcher@isilon.com>.
2007-10-10 12:31:02 -05:00
Günther Deschner
cc469157f6 r24739: With resolve_ads() allow to query for PDCs as well.
Also add dns query functions to find GCs and DCs by GUID.

Guenther
2007-10-10 12:30:16 -05:00
Günther Deschner
8300aac494 r24737: Remove older TODO: Convert internal_resolve_name() and friends to NTSTATUS.
Guenther
2007-10-10 12:30:16 -05:00
Andrew Tridgell
b0132e94fc r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Volker Lendecke
afd7febd98 r23710: Remove some code duplication, we do have a random number generator 2007-10-10 12:23:47 -05:00
James Peach
19c929c633 r22417: Refactor the various daemon run-mode options to make the semantics
of the various flags explicit.
2007-10-10 12:19:33 -05:00
Günther Deschner
6a13e878b5 r20874: We need to distinguish client sitenames per realm. We were overwriting
the stored client sitename with the sitename from each sucessfull CLDAP
connection.

Guenther
2007-10-10 12:17:16 -05:00
Günther Deschner
0944c78610 r20861: We only use sitespecific DNS lookups when looking for DCs or KDCs, not
for a PDC.

Guenther
2007-10-10 12:17:14 -05:00
Jeremy Allison
97e248f89a r20857: Silence gives assent :-). Checking in the fix for
site support in a network where many DC's are down.
I heard via Volker there is still a bug w.r.t the
wrong site being chosen with trusted domains but
we'll have to layer that fix on top of this.
Gd - complain if this doesn't work for you.
Jeremy.
2007-10-10 12:17:14 -05:00
Volker Lendecke
44f9d25a90 r20604: Fix two memleaks, Coverity ID 337, merge to 3_0_24 2007-10-10 12:16:57 -05:00
Volker Lendecke
e4dea0e647 r20603: Slightly simplify logic 2007-10-10 12:16:57 -05:00
Gerald Carter
3eddae2f20 r19754: * When using a krb5 session setup, we don't fill in the server_name
string the clis_state struct.  So call saf_store() after we
  have the short domain name in the lsa_query_inof_policy code.

* Remove unused server string in saf_delete()
2007-10-10 12:15:53 -05:00
Günther Deschner
45d6d30076 r19652: Trying to track down which caller tries to store a 0 length domain name
in the affinity cache (which happens all the time here).

Guenther
2007-10-10 12:15:44 -05:00
Günther Deschner
4b9d79147a r19243: Fix debug statement.
Guenther
2007-10-10 12:15:25 -05:00
Jeremy Allison
7385a076f8 r18199: Allow winbindd to delete a saf_ entry if it knows
it can't talk to it.
Jeremy.
2007-10-10 11:51:15 -05:00
Jeremy Allison
f16b41c3c9 r18007: Ensure we don't namecache KDC entries with port 88
as a generic DC (that should be the LDAP port).
Jeremy.
2007-10-10 11:39:47 -05:00
Jeremy Allison
77fe2a3d74 r18006: Actually a smaller change than it looks. Leverage
the get_dc_list code to get the _kerberos. names
for site support. This way we don't depend on one
KDC to do ticket refresh. Even though we know it's
up when we add it, it may go down when we're trying
to refresh.
Jeremy.
2007-10-10 11:39:47 -05:00
Jeremy Allison
ab3f0c5b1e r17928: Implement the basic store for CLDAP sitename
support when looking up DC's. On every CLDAP
call store the returned client sitename (if
present, delete store if not) in gencache with
infinate timeout. On AD DNS DC lookup, try looking
for sitename DC's first, only try generic if
sitename DNS lookup failed.
I still haven't figured out yet how to ensure
we fetch the sitename with a CLDAP query before
doing the generic DC list lookup. This code is
difficult to understand. I'll do some experiments
and backtraces tomorrow to try and work out where
to force a CLDAP site query first.
Jeremy.
2007-10-10 11:38:59 -05:00
Jeremy Allison
4b7387a054 r17900: Fix from Michael Adam <ma@sernet.de> - make internal_resolve_name
do what it's supposed to.
Jeremy.
2007-10-10 11:38:57 -05:00
Volker Lendecke
60a166f034 r17881: Another microstep towards better error reporting: Make get_sorted_dc_list
return NTSTATUS.

If we want to differentiate different name resolution problems we might want
to introduce yet another error class for Samba-internal errors. Things like no
route to host to the WINS server, a DNS server explicitly said host not found
etc might be worth passing up.

Because we can not stash everything into the existing NT_STATUS codes, what
about a Samba-specific error class like NT_STATUS_DOS and NT_STATUS_LDAP?

Volker
2007-10-10 11:38:57 -05:00
Gerald Carter
899179d2b9 r17795: Finally track down the "ads_connect: Interrupted system call"
error.  Fix our DNS SRV lookup code to deal with multi-homed hosts.
We were noly remembering one IP address per host from the Additional
records section in the SRV response which could have been an unreachable
address.
2007-10-10 11:38:47 -05:00
Gerald Carter
03a767539d r17760: The DNS SRV lookup already sorts by priority and weight so don't
use the generic IP list sort in get_sorted_dc_list().
2007-10-10 11:38:47 -05:00
Andrew Tridgell
d7ec9f3cc0 r17124: fixed a bug which caused resolve_ads() to spin forever if one of the
DCs isn't resolvable in DNS. The fix is to leave that DC out of the
returned list of DCs. I think the original code intended that anyway,
just didn't quite get it right ('i' wasn't incremented in that code
path, so the loop didn't terminate)
2007-10-10 11:38:13 -05:00
James Peach
71fd0d3de4 r15611: Remove used but uninitialised variable "count". 2007-10-10 11:17:03 -05:00
Gerald Carter
4c4ea7b20f r15543: New implementation of 'net ads join' to be more like Windows XP.
The motivating factor is to not require more privileges for
the user account than Windows does when joining a domain.

The points of interest are

* net_ads_join() uses same rpc mechanisms as net_rpc_join()
* Enable CLDAP queries for filling in the majority of the
  ADS_STRUCT->config information
* Remove ldap_initialized() from sam/idmap_ad.c and
  libads/ldap.c
* Remove some unnecessary fields from ADS_STRUCT
* Manually set the dNSHostName and servicePrincipalName attribute
  using the machine account after the join

Thanks to Guenther and Simo for the review.

Still to do:

* Fix the userAccountControl for DES only systems
* Set the userPrincipalName in order to support things like
  'kinit -k' (although we might be able to just use the sAMAccountName
  instead)
* Re-add support for pre-creating the machine account in
  a specific OU
2007-10-10 11:16:57 -05:00
Gerald Carter
cf71f88a3c r15462: replace the use of OpenLDAP's ldap_domain2hostlist() for
locating AD DC's with out own DNS SRV queries.
Testing on Linux and Solaris.
2007-10-10 11:16:49 -05:00
Volker Lendecke
86f62484dd r13987: Fix Coverity bug # 74. This tool is good...
Thanks,

Volker
2007-10-10 11:11:03 -05:00