1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-30 13:18:05 +03:00
Commit Graph

268 Commits

Author SHA1 Message Date
Stefan Metzmacher
a2d4197590 s3:lib: s/SMBkeepalive/NBSSkeepalive
metze
2011-07-12 09:44:04 +02:00
Stefan Metzmacher
f0e6e5c37d s3:libsmb: remove unused enum smb_read_errors infrastructure
metze
2011-07-08 14:09:08 +02:00
Volker Lendecke
2dfc898d1a s3: Follow the TALLOC_FREE convention in source3
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Jul  6 11:01:05 CEST 2011 on sn-devel-104
2011-07-06 11:01:05 +02:00
Volker Lendecke
6fcb3bbdae s3: Fix Coverity ID 2586 -- NO_EFFECT
tsocket_address_bsd_sockaddr returns ssize_t, and on some systems socklen_t is
unsigned. So (len < 0) could never have turned true.

Volker
2011-07-06 09:50:02 +02:00
Andreas Schneider
c663dfff88 s3-util: Add a get_remote_hostname() function.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:27:55 +10:00
Andrew Bartlett
74eed8f3ed s3-param Remove special case for global_myname(), rename to lp_netbios_name()
There is no reason this can't be a normal constant string in the
loadparm system, now that we have lp_set_cmdline() to handle overrides
correctly.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
8d4a8389bb s3-talloc Change TALLOC_MEMDUP() to talloc_memdup()
Using the standard macro makes it easier to move code into common, as
TALLOC_MEMDUP isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
5e26e94092 s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Rusty Russell
0204ae6229 lib/util/time.c: timeval_current_ofs_usec
Several places want "microseconds from current time", and several were
simply handing "usecs" values which could be over a million.

Using a helper to do this is safer and more readable.

I didn't replace any obviously correct callers (ie. constants).

I also renamed wait_nsec in source3/lib/util_sock.c; it's actually
microseconds not nanoseconds (introduced with this code in Volker's
19b783cc Async wrapper for open_socket_out_send/recv).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01 10:38:47 +02:00
Jeremy Allison
9d9d7a7cfd is_my_ipaddr() should recognise loopback addresses as ours.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue May 17 20:05:42 CEST 2011 on sn-devel-104
2011-05-17 20:05:42 +02:00
Andrew Bartlett
897ef820a4 s3-lib Use common lib/socket code for get_interfaces() et al 2011-05-08 12:57:04 +02:00
Andrew Bartlett
f946668b7a Improve debug messages when creating socket directories
This makes clear what the permissions error and directory name actually is

Andrew Bartlett
2011-05-08 10:56:28 +02:00
Jeremy Allison
e131c94ac1 More const fixes for compiler warnings from the waf build. 2011-05-05 23:56:07 +02:00
Andrew Bartlett
eea783e04c lib/util Move set_socket_options() into common code. 2011-05-03 07:37:07 +02:00
Andrew Bartlett
fbea52f74a lib/util Move more network utility functions from source3 into lib/util
This will help with the merge of the interfaces layer.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Günther Deschner
50883cfeb4 s3-tevent: only include ../lib/util/tevent wrappers where needed.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104
2011-04-29 14:00:30 +02:00
Stefan Metzmacher
a3a38ee90a s3:lib/util_sock: listen on IPv6 addresses with IPV6_ONLY (bug #7383)
This avoids getting IPv4 addresses as mapped IPv6 addresses
(e.g. ::ffff:192.168.0.1).

Before the bahavior was inconsistent between operating system
and distributions. Some system have IPV6_ONLY as default.

Now we consistently get AF_INET for IPv4 addresses and AF_INET6
for IPv6 addresses.

It also makes it possible to listen only on IPv6 now
as "::" doesn't imply "0.0.0.0" anymore. Which also
avoids confusing log messages that we were not able to
bind to "0.0.0.0".

metze
2011-04-25 17:42:03 +02:00
Günther Deschner
8b8014198c s3-util_sock: very brief documentation for open_socket_out().
The most important bit is to document that timeout is in MILLIseconds, not
seconds.

Guenther
2011-04-13 18:13:34 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Jeremy Allison
5176a0b2af Fix is_myname_or_ipaddr() to be robust against strange DNS setups.
If IPv6 DNS names are turned on, but Samba isn't configured to
listen on an IPv6 interface, then is_myname_or_ipaddr() can return
false on a valid DNS name that it should detect is our own. If the
IPv6 addr is returned by preference, then looking at the first addr
only causes is_myname_or_ipaddr() to fail. We need to look at all the
addresses returned by the DNS lookup and check all of them against
our interface list. This is an order N^2 lookup, but there shouldn't
be enough addresses to make this a practical problem.

Jeremy.
2011-03-24 13:07:36 -07:00
Andrew Bartlett
1923b78209 s3-lib Remove the clobber_region() code.
This code wrote to the full buffer in fstrcpy(), pstrcpy() and other
fixed-length string manipulation functions.

The hope of this code was to find out at run time if we were mixing up
pstring and fstring etc, and to record where this came from.  It has a
runtime performance impact (particularly if compiled with
--enable-developer).

It is being removed because of the complexity it adds, and the
distinct lack of bugs that this complexity has been credited in
finding.

The macro-based compile-time checking of string sizes remains.

Andrew Bartlett
2011-03-23 12:49:39 +11:00
Günther Deschner
1f6aecb5cf s3-interfaces: only include interfaces.h where needed.
Guenther
2011-03-16 16:56:46 +01:00
Volker Lendecke
a2970dfaef s3: Eliminate sys_select_intr from read_fd_with_timeout 2011-02-28 16:40:19 +01:00
Volker Lendecke
884984ae0a s3: Add poll_intr_one_fd 2011-02-28 16:40:19 +01:00
Volker Lendecke
deb58b2e94 s3: Add poll_one_fd() 2011-02-28 16:40:19 +01:00
Volker Lendecke
fec0baacb6 s3: Make is_zero_addr take a sockaddr_storage
All callers had to cast this anyway

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Feb 27 11:02:53 CET 2011 on sn-devel-104
2011-02-27 11:02:53 +01:00
Volker Lendecke
5a0ee95b95 s3: Fix some nonempty blank lines and some typos
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Feb  9 00:01:45 CET 2011 on sn-devel-104
2011-02-09 00:01:45 +01:00
Volker Lendecke
03b8b8e199 s3: Remove unused open_any_socket_out
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Dec 22 17:27:29 CET 2010 on sn-devel-104
2010-12-22 17:27:29 +01:00
Volker Lendecke
43e42b4e77 s3: Fix some typos 2010-12-19 23:25:06 +01:00
Ira Cooper
fdad0328e4 s3: Adding TCP_KEEPALIVE_THRESHOLD and TCP_KEEPALIVE_ABORT_THRESHOLD to the list of accepted socket settings.
These are both exclusive to Solaris/OpenSolaris.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Oct  7 00:26:39 UTC 2010 on sn-devel-104
2010-10-07 00:26:39 +00:00
Günther Deschner
b38d0542e1 samba: share select wrappers.
Guenther
2010-10-01 22:30:22 +02:00
Günther Deschner
c7fe04abc7 s3-build: only include async headers where needed.
Guenther
2010-09-20 13:54:42 -07:00
Günther Deschner
aba1bf4b5e s3-build: only include memcache.h where needed.
Guenther
2010-08-26 00:20:28 +02:00
Volker Lendecke
536d4d48bf s3: Fix an uninitialized variable 2010-08-18 11:18:24 +02:00
Volker Lendecke
840b0f523b s3: Move read_smb_length() to smbd/reply.c 2010-08-17 22:44:04 +02:00
Volker Lendecke
e65197e56f s3: Remove smbd_server_fd from receive_smb_raw
This is only called from client code
2010-08-17 22:44:03 +02:00
Volker Lendecke
1f0afe1aed s3: Lift smbd_server_fd() from read_smb_length_return_keepalive 2010-08-17 22:44:03 +02:00
Volker Lendecke
7d164498db s3: Lift smbd_server_fd() from read_data()
All callers have appropriate debug messages themselves
2010-08-17 22:44:03 +02:00
Volker Lendecke
9671547d17 s3: Lift smbd_server_fd() from read_fd_with_timeout() 2010-08-17 22:44:03 +02:00
Günther Deschner
ff17516732 s3-util: remove unused variable.
Guenther
2010-08-17 13:04:32 +02:00
Volker Lendecke
40ae8b74b6 s3: Remove smbd_server_fd() from write_data()
This completely removes the DEBUG(0, ..) error message from write_data(). I've
gone through all callers of write_data() and made sure that they have their own
equivalent error message printing.
2010-08-17 12:46:53 +02:00
Volker Lendecke
96ae457023 s3: Remove get_client_fd() 2010-08-16 13:13:10 +02:00
Karolin Seeger
4b89195f0c s3-util_sock: Rise debug level for getpeername failed messages.
Don't show all getpeername failed messages in debug level 0 and 1.

Karolin

Signed-off-by: Volker Lendecke <vl@samba.org>
2010-03-26 15:24:21 +01: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
43c766a14a Fix bug 6673 - smbpasswd does not work with "unix password sync = yes".
Revert change from 3.3 -> 3.4 with read_socket_with_timeout changed
from sys_read() to sys_recv(). read_socket_with_timeout() is called
with non-fd's (with a pty in chgpasswd.c and with a disk file in
lib/dbwrap_file.c via read_data()). recv works for the disk file,
but not the pty. Change the name of read_socket_with_timeout() to
read_fd_with_timeout() to make this clear (and add comments).
Jeremy.
2009-09-06 21:38:50 -07:00
Simo Sorce
bc081cf0cc Save and report the correct errno value. 2009-09-05 12:49:26 -04:00
Jeremy Allison
2d0cd3e53a (Hopefully) fix the problem Kai reported with
net ads leave and IPv6. Ensure all DC lookups
prefer IPv4.
Jeremy.
2009-07-28 18:02:10 -07:00
Björn Jacke
036bad6131 s3: allow setting the TCP_QUICKACK socket option 2009-07-14 22:29:59 +02:00
Jeremy Allison
c736baf9f8 Make open_udp_socket() IPv6 clean. Trying to fix bug #6437 - Unable to join IPv6-only ads domain.
Avaiting feedback from submitter before backport to 3.4 and earlier.
Jeremy.
2009-06-08 13:26:39 -07:00
Volker Lendecke
3cd03b229b Allow AF_UNIX for open_socket_out 2009-06-06 10:42:54 +02:00