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

215 Commits

Author SHA1 Message Date
Volker Lendecke
cbd5e4e16b s3: Add sock_packet_read
Read packets from both a socket and from /tmp/.nmbd/unexpected simultaneously
2011-01-07 13:28:04 +01:00
Volker Lendecke
d05fb4b7b7 s3: Fix two uninitialized variables
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Dec 30 12:52:47 CET 2010 on sn-devel-104
2010-12-30 12:52:47 +01:00
Volker Lendecke
4622812a41 s3: Make name_query return NTSTATUS
Also use talloc for the result

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Dec 28 18:21:05 CET 2010 on sn-devel-104
2010-12-28 18:21:05 +01:00
Volker Lendecke
5717114318 s3: Make node_status_query return NTSTATUS
Also make the result talloc'ed

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Dec 28 13:46:59 CET 2010 on sn-devel-104
2010-12-28 13:46:59 +01:00
Volker Lendecke
e1ab3c3470 s3: Remove an ancient typedef 2010-12-28 12:59:11 +01:00
Volker Lendecke
b0ff97d8d3 s3: Fix some typos 2010-12-28 12:59:11 +01:00
Stefan Metzmacher
2c657d8705 s3:libsmb/namequery.c: don't leak 'pserver'
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Dec 22 09:54:31 CET 2010 on sn-devel-104
2010-12-22 09:54:30 +01:00
Jeremy Allison
52f2520648 Fix the unexpected.tdb database problem. Change nmbd to store the
transaction id of packets it was requested to send via a client, and
only store replies that match these ids. On the client side change
clients to always attempt to ask nmbd first for name_query and
node_status calls, and then fall back to doing socket calls if
we can't talk to nmbd (either nmbd is not running, or we're not
root and cannot open the messaging tdb's). Fix readers of unexpected.tdb
to delete packets they've successfully read.

This should fix a long standing problem of unexpected.tdb
growing out of control in noisy NetBIOS envioronments with
lots of bradcasts, yet still allow unprivileged client apps
to work mostly as well as they already did (nmblookup for
example) in an environment when nmbd isn't running.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sun Nov 14 05:22:45 UTC 2010 on sn-devel-104
2010-11-14 05:22:45 +00:00
Björn Jacke
10eefd85c9 s3: fix order of arguments in nsec_time_diff call 2010-09-17 13:49:11 +02:00
Björn Jacke
aada719694 s3: use nsec_time_diff instead of TspecDiff 2010-09-16 21:38:20 +02:00
Björn Jacke
0ca6a73d01 s3: use monotonic clock for time deltas in namequery functions 2010-08-31 10:26:13 +02:00
Günther Deschner
56538be6af s3-libads: move ads_dns out of main includes.
Guenther
2010-07-01 23:20:40 +02:00
Günther Deschner
fbb7814f91 s3: only use netlogon/nbt header when needed.
Guenther
2010-05-31 11:32:37 +02:00
Simo Sorce
61b7a24f16 s3 move the sitename cache in its own file 2010-02-23 12:46:26 -05:00
Andrew Tridgell
7347ca359d s3-libsmb: use TYPESAFE_QSORT() in namequery code
This one was a bit trickier. I'd appreciate it if someone else can
look over this.
2010-02-14 18:44:20 +11:00
Stefan Metzmacher
30a1bc3650 s3:nmbd: also listen explicit on the subnet broadcast addresses
And send replies always via the unicast address of the subnet.

This behavior is off by default (as before)
and can be enabled with "nmbd:bind explicit broadcast = yes".

metze
2010-02-08 18:35:10 +01:00
Andrew Bartlett
b5ce97511a libcli/nbt Move more of lmhosts lookup into common code
This aims to eventually share this with Samba4.

Andrew Bartlett
2009-11-04 14:58:25 +11:00
Andrew Bartlett
668470c992 libcli:nbt make the lmhosts parsing code and dependicies common
This starts the process to have Samba4 use lmhosts.

Andrew Bartlett
2009-09-15 07:42:54 -07:00
Jeremy Allison
5d05d22999 Added prefer_ipv4 bool parameter to resolve_name().
W2K3 DC's can have IPv6 addresses but won't serve
krb5/ldap or cldap on those addresses. Make sure when
we're asking for DC's we prefer IPv4.
If you have an IPv6-only network this prioritizing code
will be a no-op. And if you have a mixed network then you
need to prioritize IPv4 due to W2K3 DC's.
Jeremy.
2009-07-28 11:51:58 -07:00
Volker Lendecke
3edcd55bf1 Remove gencache_init/shutdown
gencache_get/set/del/iterate call gencache_init() internally anyway. And we've
been very lazy calling gencache_shutdown, so this seems not really required.
2009-07-15 10:55:20 +02:00
Derrell Lipman
641e12561a [FIX Bug 6235] domain enumeration breaks if master browser has space in name
Jeremy: please review to ensure this doesn't appear to break anything

The function name_status_find() is documented as used for finding a server's
name given its IP address. It was, however, looking for the first matching
name which could be a group name at times. This fix ensures that group names
are skipped when scanning for a matching name.

Derrell
2009-04-27 09:34:25 -04:00
Volker Lendecke
c5cc27c493 Interesting C compiler you have there... :-) 2009-02-19 00:52:34 +01:00
Jeremy Allison
c9295c93d1 Fix coverity CID-602. Possible use of uninitialized var.
Jeremy.
2009-02-18 15:45:49 -08:00
Ted Percival
189a85dd68 Probably fixes a crash during name resolution when log level >= 10
and libc segfaults if printf is passed NULL for a "%s" arg
(eg. Solaris).
2009-02-03 14:25:31 -08:00
Stefan Metzmacher
895c40d03a s3:libsmb/namequery.c: add saf_join_store() function
saf_join_store() should be called after a successful
domain join, the affinity to the dc used at join time
has a larger ttl, to avoid problems with delayed replication.

metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
(cherry picked from commit 80e74a27c5)
2008-12-13 11:42:35 +01:00
Stefan Metzmacher
0c43f96330 s3: libsmb/namequery: fallback to returning all dcs, when none is available in the requested site
It could happen that all dcs in a site are unavailable
(some sites have only one dc) and then we need to fallback
to get all dcs.

metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
(cherry picked from commit c127367b1d)
2008-12-13 11:42:35 +01:00
Tim Prouty
1eb743ab8e s3: Change sockaddr util function names for consistency
Also eliminates name conflicts with OneFS system libraries
2008-12-03 10:40:20 -08:00
Jelmer Vernooij
d6a5476ee7 Use sockaddr_storage only where we rely on the size, use sockaddr
otherwise (to clarify we can also pass in structs smaller than
sockaddr_storage, such as sockaddr_in).
2008-10-23 19:53:15 +02:00
Volker Lendecke
d3def9a18c Revert "Pass NULL to gencache_get when we are not interested in the timeout value"
This reverts commit 16062dfc3d.
(This used to be commit 114ca85775)
2008-07-11 17:53:25 +02:00
Volker Lendecke
962beb2872 Pass NULL to gencache_get when we are not interested in the timeout value
(This used to be commit 16062dfc3d)
2008-07-03 15:17:58 +02:00
Jeremy Allison
48a2a3780b More correct fix (hopefully :-) for any memory leaks.
Jerry promised to check :-). Vl also please review.
Jeremy.
(This used to be commit 8abc6e7421)
2008-06-05 14:27:26 -07:00
Günther Deschner
aba7809188 build: fix the build.
Guenther
(This used to be commit 09a0001063)
2008-04-22 00:06:57 +02:00
Volker Lendecke
394150d269 Make use of ZERO_STRUCT instead of memset in namequery.c
(This used to be commit 4f1d49615e)
2008-04-14 13:13:46 +02:00
Volker Lendecke
e2ab1a0f98 Fix Coverity ID 555
(This used to be commit 44122f06d0)
2008-03-15 22:30:25 +01:00
Günther Deschner
d06559c1e6 Make resolve_ads() static.
Guenther
(This used to be commit 57dc747136)
2008-01-16 16:06:15 +01:00
Jeremy Allison
76d904e6d8 Fix CID 470. resolve_order can't be NULL here so simplify code.
Jeremy.
(This used to be commit 2e75f3ecdf)
2008-01-12 00:05:07 -08:00
Jeremy Allison
e3e16928c0 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.
(This used to be commit 5c7f7629a9)
2007-12-12 09:42:58 -08:00
Jeremy Allison
8596a1b609 Ensure we have a non-null flags. Pointed out by Andreas Schneider <anschneider@suse.de>.
Jeremy.
(This used to be commit cafde6c372)
2007-12-10 15:06:31 -08:00
Jeremy Allison
921bbc1331 Fix errors from next_token conversion. Spotted by
Andreas Schneider <anschneider@suse.de>.
Jeremy.
(This used to be commit b40efc2fe6)
2007-12-10 14:21: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
James Peach
39f0e6d22c Specifically ask for IP4 addresses if we don't have IP6 support.
(This used to be commit 4786654992)
2007-12-09 14:01:57 -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
Volker Lendecke
78c6ee0090 Remove some globals
(This used to be commit 31d0a846db)
2007-12-05 14:39:07 +01:00
Jeremy Allison
762fde90a0 Remove pstrings from namequery.c.
Jeremy.
(This used to be commit 71ccd0c42e)
2007-11-27 23:10:20 -08:00
Jeremy Allison
9a41314ce8 Remove pstring from nmbd.
Jeremy.
(This used to be commit a317f70c22)
2007-11-19 15:15:09 -08:00
Jeremy Allison
e2d0526c97 Change our DNS code to cope with AAAA records. A6 records
look like a nightmare to use, so ignore them for now.
Jeremy.
(This used to be commit 814daded90)
2007-10-29 13:34:00 -07:00
Jeremy Allison
d4307679b9 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.
(This used to be commit 2e92418a13)
2007-10-27 20:29:36 -07:00
Jeremy Allison
fc91aa6988 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
(This used to be commit a3f7db3d30)
2007-10-26 16:03:20 -07:00
Jeremy Allison
6128d116b3 Fix resolve name to resolve IPv6 addresses of link-local%ifaddr
Jeremy.
(This used to be commit e6609cab73)
2007-10-25 18:28:36 -07:00
Jeremy Allison
f88b7a076b 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.
(This used to be commit 98e154c312)
2007-10-24 14:16:54 -07:00