[SCM] Samba Shared Repository - branch v4-3-stable updated

Karolin Seeger kseeger at samba.org
Tue Feb 23 07:56:13 UTC 2016


The branch, v4-3-stable has been updated
       via  8a42885 VERSION: Disable git snapshots for the 4.3.5 release.
       via  b35144d WHATSNEW: Add release notes for Samba 4.3.5.
       via  6c6599c ctdb-scripts: Drop use of "smbcontrol winbindd ip-dropped ..."
       via  f8618dc lib/tsocket: workaround sockets not supporting FIONREAD
       via  6c1a5f0 param: Fix str_list_v3 to accept ; again
       via  11b89bd loadparm: Fix memory leak issue.
       via  4526ba6 s3: smbd: posix_acls: Fix check for setting u:g:o entry on a filesystem with no ACL support.
       via  ebb7d66 s3:smbd:open: Skip redundant call to file_set_dosmode when creating a new file.
       via  f1d0341 docs-xml: fix typo in smbspool_krb5_wrapper manpage.
       via  4c7f237 docs: Add smbspool_krb5_wrapper manpage
       via  9270b1d8 python:tests/core: add tests for arcfour_encrypt() and string_to_byte_array()
       via  6c44fab s4:scripting/devel: make use of the generic arcfour_encrypt() and string_to_byte_array() functions
       via  8acf14e python:samba/netcmd/domain: make use of the generic arcfour_encrypt() and string_to_byte_array() functions
       via  b950d91 python:samba/join.py: make use of the generic arcfour_encrypt() and string_to_byte_array() functions
       via  4e6d6c7 python:samba: add a generic arcfour_encrypt() helper function
       via  ffd18e1 python:samba: add a generic string_to_byte_array() helper function
       via  b422510 ctdb-common: Use documented names for protocol family in socket()
       via  9ca2add ctdb-common: Protocol argument must be in host order for socket() call
       via  3e600d6 s3: smbd: Fix timestamp rounding inside SMB2 create.
       via  830f003 smbd: show correct disk size for different quota and dfree block sizes
       via  67db303 s3:utils/smbget fix recursive download
       via  155d821 waf: Only build smb_krb5_wrapper if we have CUPS
       via  2b218c3 s3-client: Add a KRB5 wrapper for smbspool
       via  756b452 s3-parm: clean up defaults when removing global parameters
       via  54c0fce s4:torture: add SMB2 test for directory creation initial allocation size
       via  57654ee s3:smbd: Ignore initial allocation size for directory creation
       via  6d82bdd smbcacls: fix uninitialized variable
       via  2c72956 Revert "winbind: Retry after SESSION_EXPIRED error in ping-dc"
       via  52b5636 winbindd: Retry on expired session in cm_connect_netlogon
       via  dded902 winbindd: Retry on expired session in cm_connect_sam
       via  423120f winbindd: Retry on expired session in cm_connect_lsa
       via  a0f2f52 winbindd: Remove double retry from some ADS methods
       via  fa875e3 winbindd: Add retry also for ADS method calls
       via  39e6b5b winbindd: Reset connection for expired session before reconnecting
       via  40bc9b0 vfs_shadow_copy2: add a blackbox test suite
       via  0998c40 vfs_shadow_copy2: fix case where snapshots are outside the share
       via  a453c78 vfs_shadow_copy2: add shadow_copy2_do_convert()
       via  db70921 s3:smbd/oplock obey kernel oplock setting when releasing oplocks
       via  43ade9a selftest: more dfree command and smbclient disk usage tests
       via  21d362e smbclient: query disk usage relative to current directory
       via  ae2a575 VERSION: Bump version up to 4.3.5...
      from  0c12970 VERSION: Disable git snapshots for the 4.3.4 release.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-3-stable


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 VERSION                                            |   2 +-
 WHATSNEW.txt                                       |  91 ++++++-
 ctdb/common/system_aix.c                           |   4 +-
 ctdb/common/system_common.c                        |   2 +-
 ctdb/common/system_freebsd.c                       |   4 +-
 ctdb/common/system_gnu.c                           |   4 +-
 ctdb/common/system_kfreebsd.c                      |   4 +-
 ctdb/common/system_linux.c                         |  12 +-
 ctdb/config/events.d/11.natgw                      |   4 -
 ctdb/config/events.d/49.winbind                    |   7 -
 ctdb/tools/ctdb.c                                  |   4 +-
 ctdb/utils/smnotify/smnotify.c                     |   6 +-
 docs-xml/manpages/smbspool_krb5_wrapper.8.xml      |  64 +++++
 docs-xml/wscript_build                             |   1 +
 lib/tsocket/tsocket_bsd.c                          |  62 ++++-
 lib/util/util_strlist.c                            |  18 +-
 python/samba/__init__.py                           |  24 ++
 python/samba/join.py                               |  19 +-
 python/samba/netcmd/domain.py                      |  23 +-
 python/samba/tests/core.py                         |  16 ++
 selftest/target/Samba3.pm                          |  71 +++++
 source3/client/README.smbspool                     |  17 ++
 source3/client/client.c                            |   2 +-
 source3/client/smbspool_krb5_wrapper.c             | 210 +++++++++++++++
 source3/libsmb/cli_smb2_fnum.c                     |   5 +-
 source3/libsmb/cli_smb2_fnum.h                     |   1 +
 source3/libsmb/clifile.c                           |   5 +-
 source3/libsmb/proto.h                             |   3 +-
 source3/modules/vfs_shadow_copy2.c                 | 107 ++++++--
 source3/param/loadparm.c                           |  19 +-
 source3/script/tests/test_dfree_command.sh         |  17 +-
 source3/script/tests/test_shadow_copy.sh           | 290 +++++++++++++++++++++
 source3/selftest/tests.py                          |   1 +
 source3/smbd/dfree.c                               |   9 +-
 source3/smbd/open.c                                |  14 +-
 source3/smbd/oplock.c                              |   3 +-
 source3/smbd/posix_acls.c                          |  39 ++-
 source3/smbd/smb2_create.c                         |   8 +
 source3/torture/nbio.c                             |   2 +-
 source3/utils/smbcacls.c                           |   2 +-
 source3/utils/smbget.c                             |  15 +-
 source3/winbindd/winbindd_ads.c                    |  26 +-
 source3/winbindd/winbindd_cache.c                  |   4 +-
 source3/winbindd/winbindd_cm.c                     | 104 ++++++++
 source3/winbindd/winbindd_dual_srv.c               |   8 -
 source3/winbindd/winbindd_ndr.c                    |   3 +
 source3/winbindd/winbindd_proto.h                  |   4 +
 source3/winbindd/winbindd_reconnect.c              |  38 +--
 ...nbindd_reconnect.c => winbindd_reconnect_ads.c} | 249 ++++++++----------
 source3/wscript_build                              |   9 +
 source4/scripting/devel/createtrust                |  18 +-
 source4/torture/smb2/create.c                      |  64 +++++
 testprogs/blackbox/dfree.sh                        |   8 +-
 53 files changed, 1427 insertions(+), 319 deletions(-)
 create mode 100644 docs-xml/manpages/smbspool_krb5_wrapper.8.xml
 create mode 100644 source3/client/README.smbspool
 create mode 100644 source3/client/smbspool_krb5_wrapper.c
 create mode 100755 source3/script/tests/test_shadow_copy.sh
 copy source3/winbindd/{winbindd_reconnect.c => winbindd_reconnect_ads.c} (50%)


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index ad5d0cb..1bdc118 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=3
-SAMBA_VERSION_RELEASE=4
+SAMBA_VERSION_RELEASE=5
 
 ########################################################
 # If a official release has a serious bug              #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 4d03b61..add8af0 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,4 +1,91 @@
                    =============================
+                   Release Notes for Samba 4.3.5
+                         February 23, 2016
+                   =============================
+
+
+This is the latest stable release of Samba 4.3.
+
+
+Changes since 4.3.4:
+--------------------
+
+o  Jeremy Allison <jra at samba.org>
+   * BUG 10489: s3: smbd: posix_acls: Fix check for setting u:g:o entry on a
+     filesystem with no ACL support.
+   * BUG 11703: s3: smbd: Fix timestamp rounding inside SMB2 create.
+
+o  Christian Ambach <ambi at samba.org>
+   * BUG 6482: s3:utils/smbget: Fix recursive download.
+   * BUG 11400: s3:smbd/oplock: Obey kernel oplock setting when releasing
+     oplocks.
+
+o  Alexander Bokovoy <ab at samba.org>
+   * BUG 11693: s3-parm: Clean up defaults when removing global parameters.
+
+o  Ralph Boehme <slow at samba.org>
+   * BUG 11684: s3:smbd: Ignore initial allocation size for directory creation.
+   * BUG 11714: lib/tsocket: Work around sockets not supporting FIONREAD.
+
+o  Amitay Isaacs <amitay at gmail.com>
+   * BUG 11705: ctdb: Remove error messages after kernel security update
+     (CVE-2015-8543).
+
+o  Volker Lendecke <vl at samba.org>
+   * BUG 11732: param: Fix str_list_v3 to accept ";" again.
+
+o  Stefan Metzmacher <metze at samba.org>
+   * BUG 11699: Use M2Crypto.RC4.RC4 on platforms without Crypto.Cipher.ARC4.
+
+o  Jose A. Rivera <jarrpa at samba.org>
+   * BUG 11727: s3:smbd:open: Skip redundant call to file_set_dosmode when
+     creating a new file.
+
+o  Christof Schmitt <cs at samba.org>
+   * BUG 11670: winbindd: Handle expired sessions correctly.
+
+o  Andreas Schneider <asn at samba.org>
+   * BUG 11690: s3-client: Add a KRB5 wrapper for smbspool.
+
+o  Uri Simchoni <uri at samba.org>
+   * BUG 11580: vfs_shadow_copy2: Fix case where snapshots are outside the
+     share.
+   * BUG 11662: smbclient: Query disk usage relative to current directory.
+   * BUG 11681: smbd: Show correct disk size for different quota and dfree block
+     sizes.
+   * BUG 11682: smbcacls: Fix uninitialized variable.
+
+o  Martin Schwenke <martin at meltin.net>
+   * BUG 11719: ctdb-scripts: Drop use of "smbcontrol winbindd ip-dropped ...".
+
+o  Hemanth Thummala <hemanth.thummala at nutanix.com>
+   * BUG 11708: loadparm: Fix memory leak issue.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored.  All bug reports should
+be filed under the "Samba 4.1 and newer" product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Older release notes to follow:
+------------------------------
+
+                   =============================
                    Release Notes for Samba 4.3.4
                          January 12, 2016
                    =============================
@@ -68,8 +155,8 @@ database (https://bugzilla.samba.org/).
 ======================================================================
 
 
-Older release notes to follow:
-------------------------------
+----------------------------------------------------------------------
+
 
                    =============================
                    Release Notes for Samba 4.3.3
diff --git a/ctdb/common/system_aix.c b/ctdb/common/system_aix.c
index 41f61ae..2637442 100644
--- a/ctdb/common/system_aix.c
+++ b/ctdb/common/system_aix.c
@@ -44,7 +44,7 @@ int ctdb_sys_open_sending_socket(void)
 	int s, ret;
 	uint32_t one = 1;
 
-	s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW));
+	s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
 	if (s == -1) {
 		DEBUG(DEBUG_CRIT,(" failed to open raw socket (%s)\n",
 			 strerror(errno)));
@@ -121,7 +121,7 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
 
 
 
-	s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW));
+	s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
 	if (s == -1) {
 		DEBUG(DEBUG_CRIT,(" failed to open raw socket (%s)\n",
 			 strerror(errno)));
diff --git a/ctdb/common/system_common.c b/ctdb/common/system_common.c
index 899f3b5..3e30a6c 100644
--- a/ctdb/common/system_common.c
+++ b/ctdb/common/system_common.c
@@ -85,7 +85,7 @@ char *ctdb_sys_find_ifname(ctdb_sock_addr *addr)
 	struct ifconf ifc;
 	char *ptr;
 
-	s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW));
+	s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
 	if (s == -1) {
 		DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket (%s)\n",
 			 strerror(errno)));
diff --git a/ctdb/common/system_freebsd.c b/ctdb/common/system_freebsd.c
index 9597a7a..02f7cce 100644
--- a/ctdb/common/system_freebsd.c
+++ b/ctdb/common/system_freebsd.c
@@ -158,7 +158,7 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
 		ip4pkt.tcp.th_sum   = tcp_checksum((uint16_t *)&ip4pkt.tcp, sizeof(ip4pkt.tcp), &ip4pkt.ip);
 
 		/* open a raw socket to send this segment from */
-		s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW));
+		s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
 		if (s == -1) {
 			DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket (%s)\n",
 				 strerror(errno)));
@@ -208,7 +208,7 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
 		ip6pkt.tcp.th_win   = htons(1234);
 		ip6pkt.tcp.th_sum   = tcp_checksum6((uint16_t *)&ip6pkt.tcp, sizeof(ip6pkt.tcp), &ip6pkt.ip6);
 
-		s = socket(PF_INET6, SOCK_RAW, IPPROTO_RAW);
+		s = socket(AF_INET6, SOCK_RAW, IPPROTO_RAW);
 		if (s == -1) {
 			DEBUG(DEBUG_CRIT, (__location__ " Failed to open sending socket\n"));
 			return -1;
diff --git a/ctdb/common/system_gnu.c b/ctdb/common/system_gnu.c
index 2ab1399..1e0ae4c 100644
--- a/ctdb/common/system_gnu.c
+++ b/ctdb/common/system_gnu.c
@@ -156,7 +156,7 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
 		ip4pkt.tcp.check    = tcp_checksum((uint16_t *)&ip4pkt.tcp, sizeof(ip4pkt.tcp), &ip4pkt.ip);
 
 		/* open a raw socket to send this segment from */
-		s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW));
+		s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
 		if (s == -1) {
 			DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket (%s)\n",
 				 strerror(errno)));
@@ -203,7 +203,7 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
 		ip6pkt.tcp.window   = htons(1234);
 		ip6pkt.tcp.check    = tcp_checksum6((uint16_t *)&ip6pkt.tcp, sizeof(ip6pkt.tcp), &ip6pkt.ip6);
 
-		s = socket(PF_INET6, SOCK_RAW, IPPROTO_RAW);
+		s = socket(AF_INET6, SOCK_RAW, IPPROTO_RAW);
 		if (s == -1) {
 			DEBUG(DEBUG_CRIT, (__location__ " Failed to open sending socket\n"));
 			return -1;
diff --git a/ctdb/common/system_kfreebsd.c b/ctdb/common/system_kfreebsd.c
index 41aa4d6..7cb6d92 100644
--- a/ctdb/common/system_kfreebsd.c
+++ b/ctdb/common/system_kfreebsd.c
@@ -156,7 +156,7 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
 		ip4pkt.tcp.check    = tcp_checksum((uint16_t *)&ip4pkt.tcp, sizeof(ip4pkt.tcp), &ip4pkt.ip);
 
 		/* open a raw socket to send this segment from */
-		s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW));
+		s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
 		if (s == -1) {
 			DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket (%s)\n",
 				 strerror(errno)));
@@ -203,7 +203,7 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
 		ip6pkt.tcp.window   = htons(1234);
 		ip6pkt.tcp.check    = tcp_checksum6((uint16_t *)&ip6pkt.tcp, sizeof(ip6pkt.tcp), &ip6pkt.ip6);
 
-		s = socket(PF_INET6, SOCK_RAW, IPPROTO_RAW);
+		s = socket(AF_INET6, SOCK_RAW, IPPROTO_RAW);
 		if (s == -1) {
 			DEBUG(DEBUG_CRIT, (__location__ " Failed to open sending socket\n"));
 			return -1;
diff --git a/ctdb/common/system_linux.c b/ctdb/common/system_linux.c
index fdb8d12..2e58853 100644
--- a/ctdb/common/system_linux.c
+++ b/ctdb/common/system_linux.c
@@ -93,7 +93,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
 
 	switch (addr->ip.sin_family) {
 	case AF_INET:
-		s = socket(PF_PACKET, SOCK_RAW, htons(ETHERTYPE_ARP));
+		s = socket(AF_PACKET, SOCK_RAW, ETHERTYPE_ARP);
 		if (s == -1){
 			DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket\n"));
 			return -1;
@@ -187,7 +187,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
 		close(s);
 		break;
 	case AF_INET6:
-		s = socket(PF_PACKET, SOCK_RAW, htons(ETHERTYPE_ARP));
+		s = socket(AF_PACKET, SOCK_RAW, ETHERTYPE_ARP);
 		if (s == -1){
 			DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket\n"));
 			return -1;
@@ -357,7 +357,7 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
 		ip4pkt.tcp.check    = tcp_checksum((uint16_t *)&ip4pkt.tcp, sizeof(ip4pkt.tcp), &ip4pkt.ip);
 
 		/* open a raw socket to send this segment from */
-		s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW));
+		s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
 		if (s == -1) {
 			DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket (%s)\n",
 				 strerror(errno)));
@@ -406,7 +406,7 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
 		ip6pkt.tcp.window   = htons(1234);
 		ip6pkt.tcp.check    = tcp_checksum6((uint16_t *)&ip6pkt.tcp, sizeof(ip6pkt.tcp), &ip6pkt.ip6);
 
-		s = socket(PF_INET6, SOCK_RAW, IPPROTO_RAW);
+		s = socket(AF_INET6, SOCK_RAW, IPPROTO_RAW);
 		if (s == -1) {
 			DEBUG(DEBUG_CRIT, (__location__ " Failed to open sending socket\n"));
 			return -1;
@@ -447,7 +447,7 @@ int ctdb_sys_open_capture_socket(const char *iface, void **private_data)
 	int s;
 
 	/* Open a socket to capture all traffic */
-	s = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+	s = socket(AF_PACKET, SOCK_RAW, ETH_P_ALL);
 	if (s == -1) {
 		DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket\n"));
 		return -1;
@@ -568,7 +568,7 @@ bool ctdb_sys_check_iface_exists(const char *iface)
 	int s;
 	struct ifreq ifr;
 
-	s = socket(PF_PACKET, SOCK_RAW, 0);
+	s = socket(AF_PACKET, SOCK_RAW, 0);
 	if (s == -1){
 		/* We dont know if the interface exists, so assume yes */
 		DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket\n"));
diff --git a/ctdb/config/events.d/11.natgw b/ctdb/config/events.d/11.natgw
index 54e6cd9..29339f4 100755
--- a/ctdb/config/events.d/11.natgw
+++ b/ctdb/config/events.d/11.natgw
@@ -149,10 +149,6 @@ natgw_set_slave ()
 	_net="${_net_gw%@*}"
 	ip route add "$_net" via "$_natgwip" metric 10
     done
-
-    # Make sure winbindd does not stay bound to this address if we are
-    # no longer NATGW master
-    smbcontrol winbindd ip-dropped $CTDB_NATGW_PUBLIC_IP >/dev/null 2>&1
 }
 
 natgw_ensure_master ()
diff --git a/ctdb/config/events.d/49.winbind b/ctdb/config/events.d/49.winbind
index dee3c90..a1ea787 100755
--- a/ctdb/config/events.d/49.winbind
+++ b/ctdb/config/events.d/49.winbind
@@ -55,13 +55,6 @@ case "$1" in
 	ctdb_check_command wbinfo -p
 	;;
 
-     takeip|releaseip)
-	iface=$2
-	ip=$3
-	maskbits=$4
-
-	smbcontrol winbindd ip-dropped $ip >/dev/null 2>/dev/null
-	;;
     *)
 	ctdb_standard_event_handler "$@"
 	;;
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index c6da621..c5689c2 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -4496,7 +4496,7 @@ static int control_chktcpport(struct ctdb_context *ctdb, int argc, const char **
 
 	port = atoi(argv[0]);
 
-	s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
+	s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
 	if (s == -1) {
 		printf("Failed to open local socket\n");
 		return errno;
@@ -4508,7 +4508,7 @@ static int control_chktcpport(struct ctdb_context *ctdb, int argc, const char **
 	}
 
 	bzero(&sin, sizeof(sin));
-	sin.sin_family = PF_INET;
+	sin.sin_family = AF_INET;
 	sin.sin_port   = htons(port);
 	ret = bind(s, (struct sockaddr *)&sin, sizeof(sin));
 	close(s);
diff --git a/ctdb/utils/smnotify/smnotify.c b/ctdb/utils/smnotify/smnotify.c
index d7fd546..d5c5a4c 100644
--- a/ctdb/utils/smnotify/smnotify.c
+++ b/ctdb/utils/smnotify/smnotify.c
@@ -43,14 +43,14 @@ static int create_socket(const char *addr, int port)
 	int s;
         struct sockaddr_in sock_in;
 
-	s = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
+	s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
 	if (s == -1) {
 		printf("Failed to open local socket\n");
 		exit(10);
 	}
 
 	bzero(&sock_in, sizeof(sock_in));
-	sock_in.sin_family = PF_INET;
+	sock_in.sin_family = AF_INET;
 	sock_in.sin_port   = htons(port);
 	inet_aton(addr, &sock_in.sin_addr);
 	if (bind(s, (struct sockaddr *)&sock_in, sizeof(sock_in)) == -1) {
@@ -124,7 +124,7 @@ int main(int argc, const char *argv[])
 
 	/* Setup a sockaddr_in for the client we want to notify */
 	bzero(&sock_cl, sizeof(sock_cl));
-	sock_cl.sin_family = PF_INET;
+	sock_cl.sin_family = AF_INET;
 	sock_cl.sin_port   = htons(clientport);
 	inet_aton(client, &sock_cl.sin_addr);
 
diff --git a/docs-xml/manpages/smbspool_krb5_wrapper.8.xml b/docs-xml/manpages/smbspool_krb5_wrapper.8.xml
new file mode 100644
index 0000000..f9966e7
--- /dev/null
+++ b/docs-xml/manpages/smbspool_krb5_wrapper.8.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
+<refentry id="smbspool.8">
+
+<refmeta>
+	<refentrytitle>smbspool_krb5_wrapper</refentrytitle>
+	<manvolnum>8</manvolnum>
+	<refmiscinfo class="source">Samba</refmiscinfo>
+	<refmiscinfo class="manual">System Administration tools</refmiscinfo>
+	<refmiscinfo class="version">4.4</refmiscinfo>
+</refmeta>
+
+
+<refnamediv>
+	<refname>smbspool_krb5_wrapper</refname>
+	<refpurpose>This is a CUPS printing backend which calls smbspool</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+	<cmdsynopsis>
+		<command>smbspool_krb5_wrapper</command>
+		<arg choice="req">job</arg>
+		<arg choice="req">user</arg>
+		<arg choice="req">title</arg>
+		<arg choice="req">copies</arg>
+		<arg choice="req">options</arg>
+		<arg choice="opt">filename</arg>
+	</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1>
+	<title>DESCRIPTION</title>
+
+	<para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
+	<manvolnum>7</manvolnum></citerefentry> suite.</para>
+
+	<para>smbspool_krb5_wrapper is a tool that can be used to print using
+		Kerberos credentials. To get this working smbspool_krb5_wrapper
+		needs to be the smb backend of CUPS. It needs to be owned by
+		root and the permissions for the binary need to be 0700. Once
+		smbspool_krb5_wrapper switched to the user trying to print it
+		executes smbspool. It should not be called by a user.</para>
+
+</refsect1>
+
+<refsect1>
+	<title>SEE ALSO</title>
+	<para><citerefentry><refentrytitle>smbspool</refentrytitle>
+		<manvolnum>8</manvolnum></citerefentry>.</para>
+</refsect1>
+
+<refsect1>
+	<title>AUTHOR</title>
+
+	<para>The original Samba software and related utilities
+	were created by Andrew Tridgell. Samba is now developed
+	by the Samba Team as an Open Source project similar
+	to the way the Linux kernel is developed.</para>
+
+	<para>The smbspool_krb5_wrapper manpage was written by Andreas
+		Schneider.</para>
+</refsect1>
+
+</refentry>
diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build
index 5c42a31..8cdd2dd 100644
--- a/docs-xml/wscript_build
+++ b/docs-xml/wscript_build
@@ -38,6 +38,7 @@ manpages='''
          manpages/smbpasswd.5
          manpages/smbpasswd.8
          manpages/smbspool.8
+         manpages/smbspool_krb5_wrapper.8
          manpages/smbstatus.1
          manpages/smbta-util.8
          manpages/smbtar.1
diff --git a/lib/tsocket/tsocket_bsd.c b/lib/tsocket/tsocket_bsd.c
index 8203755..0756fb3 100644
--- a/lib/tsocket/tsocket_bsd.c
+++ b/lib/tsocket/tsocket_bsd.c
@@ -132,6 +132,43 @@ static int tsocket_bsd_common_prepare_fd(int fd, bool high_fd)
 	return -1;
 }
 
+#ifdef HAVE_LINUX_RTNETLINK_H
+/**
+ * Get the amount of pending bytes from a netlink socket
+ *
+ * For some reason netlink sockets don't support querying the amount of pending
+ * data via ioctl with FIONREAD, which is what we use in tsocket_bsd_pending()
+ * below.
+ *
+ * We know we are on Linux as we're using netlink, which means we have a working
+ * MSG_TRUNC flag to recvmsg() as well, so we use that together with MSG_PEEK.
+ **/
+static ssize_t tsocket_bsd_netlink_pending(int fd)
+{
+	struct iovec iov;
+	struct msghdr msg;
+	char buf[1];
+
+	iov = (struct iovec) {
+		.iov_base = buf,
+		.iov_len = sizeof(buf)
+	};
+
+	msg = (struct msghdr) {
+		.msg_iov = &iov,
+		.msg_iovlen = 1
+	};
+
+	return recvmsg(fd, &msg, MSG_PEEK | MSG_TRUNC);
+}
+#else
+static ssize_t tsocket_bsd_netlink_pending(int fd)
+{
+	errno = ENOSYS;
+	return -1;
+}
+#endif
+
 static ssize_t tsocket_bsd_pending(int fd)
 {
 	int ret, error;
@@ -640,6 +677,7 @@ struct tdgram_bsd {
 	void *event_ptr;
 	struct tevent_fd *fde;
 	bool optimize_recvfrom;
+	bool netlink;
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list