Commit f3969b26 authored by Natanael Copa's avatar Natanael Copa
Browse files

main/samba: upgrade to 4.16.4

parent d583419b
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=samba
pkgver=4.15.9
pkgver=4.16.4
pkgrel=0
pkgdesc="Tools to access a server's filespace and printers via SMB"
url="https://www.samba.org/"
......@@ -11,7 +11,7 @@ subpackages="
libwbclient
$pkgname-util-libs:_util_libs
$pkgname-common::noarch
$pkgname-common:_common:noarch
$pkgname-common-tools:_common_tools
$pkgname-common-server-libs:_common_server_libs
libsmbclient
......@@ -55,7 +55,7 @@ makedepends="
gnutls-dev
iniparser-dev
jansson-dev
ldb-dev
ldb-dev<2.6
libarchive-dev
libcap-dev
libtirpc-dev
......@@ -65,8 +65,10 @@ makedepends="
ncurses-dev
openldap-dev
perl
perl-json
perl-parse-yapp
popt-dev
py3-ldb<2.6
py3-tdb
py3-tevent
python3-dev
......@@ -86,7 +88,6 @@ source="
getpwent_r.patch
musl_uintptr.patch
netdb-defines.patch
netapp.patch
missing-headers.patch
musl_rm_unistd_incl.patch
add_missing___compar_fn_t.patch
......@@ -223,24 +224,10 @@ package() {
install -Dm644 "$srcdir/$pkgname.confd" "$pkgdir/etc/conf.d/$pkgname"
}
_mv_files() {
local i
for i in "$@"; do
case $i in
*/*) mkdir -p "$subpkgdir"/${i%/*};;
*) mkdir -p "$subpkgdir";;
esac
mv "$pkgdir"/$i "$subpkgdir"/$i
done
}
common() {
_common() {
pkgdesc="Samba common files for both client an servers"
depends=
cd "$pkgdir"
_mv_files \
etc \
var
amove etc var
install -d -m700 "$subpkgdir"/var/lib/$pkgname/private
}
......@@ -248,8 +235,7 @@ common() {
_libs_py3() {
pkgdesc="Libraries that require libpython"
depends=
cd "$pkgdir"
_mv_files \
amove \
usr/lib/$pkgname/libsamba-net*samba4.so \
usr/lib/$pkgname/libsamba-python*samba4.so
return 0
......@@ -259,8 +245,7 @@ _libs_py3() {
_common_tools() {
pkgdesc="Tools for Samba servers and clients"
depends=
cd "$pkgdir"
_mv_files \
amove \
usr/bin/net \
usr/bin/pdbedit \
usr/bin/profiles \
......@@ -275,12 +260,11 @@ _common_tools() {
_common_server_libs() {
pkgdesc="Samba libraries shared by common-tools and servers" # not shared with clients
depends=""
cd "$pkgdir"
_mv_files \
amove \
usr/lib/libdcerpc-server-core.so.* \
usr/lib/libnetapi.so.* \
usr/lib/$pkgname/libRPC-SERVER-LOOP-samba4.so \
usr/lib/$pkgname/libdfs-server-ad-samba4.so \
usr/lib/$pkgname/libnpa-tstream-samba4.so \
usr/lib/$pkgname/libprinting-migrate-samba4.so \
usr/lib/$pkgname/libsmbd-base-samba4.so \
usr/lib/$pkgname/libsmbldaphelper-samba4.so \
......@@ -290,8 +274,7 @@ _common_server_libs() {
libsmbclient() {
pkgdesc="The SMB client library"
depends=
cd "$pkgdir"
_mv_files \
amove \
usr/lib/libsmbclient.so.*
}
......@@ -299,8 +282,7 @@ libsmbclient() {
_client_libs() {
pkgdesc="Samba libraries used by clients"
depends=
cd "$pkgdir"
_mv_files \
amove \
usr/lib/$pkgname/libcli-ldap-samba4.so \
usr/lib/$pkgname/libcmdline-contexts-samba4.so \
usr/lib/$pkgname/libdsdb-garbage-collect-tombstones-samba4.so \
......@@ -318,7 +300,7 @@ client() {
pkgdesc="Samba client programs"
depends="$pkgname-common=$pkgver-r$pkgrel"
cd "$pkgdir"
_mv_files \
amove \
usr/bin/cifsdd \
usr/bin/dumpmscat \
usr/bin/dbwrap_tool \
......@@ -348,8 +330,7 @@ client() {
_server_libs() {
pkgdesc="Samba libraries shared by server and windbind"
depends=
cd "$pkgdir"
_mv_files \
amove \
usr/lib/$pkgname/libdcerpc-samba4.so \
usr/lib/$pkgname/libidmap-samba4.so \
usr/lib/$pkgname/libnss-info-samba4.so
......@@ -361,8 +342,7 @@ winbind() {
depends="$pkgname-common=$pkgver-r$pkgrel"
install="winbind.pre-install winbind.pre-upgrade winbind.post-install
winbind.post-upgrade"
cd "$pkgdir"
_mv_files \
amove \
usr/sbin/winbindd \
usr/lib/$pkgname/idmap \
usr/lib/$pkgname/nss_info
......@@ -374,8 +354,7 @@ winbind() {
_util_libs() {
pkgdesc="Samba utility libraries"
depends=
cd "$pkgdir"
_mv_files \
amove \
usr/lib/libsamba-util.so.* \
usr/lib/$pkgname/libgenrand-samba4.so \
usr/lib/$pkgname/libsocket-blocking-samba4.so \
......@@ -383,25 +362,21 @@ _util_libs() {
usr/lib/$pkgname/libtime-basic-samba4.so \
usr/lib/$pkgname/libsys-rw-samba4.so \
usr/lib/$pkgname/libiov-buf-samba4.so \
usr/lib/$pkgname/libreplace-samba4.so \
usr/lib/$pkgname/libcom_err-samba4.so.*
usr/lib/$pkgname/libcom-err-samba4.so \
usr/lib/$pkgname/libreplace-samba4.so
}
# should only depend on samba-util-libs
libwbclient() {
pkgdesc="Samba winbind client libraries"
depends=
cd "$pkgdir"
_mv_files \
usr/lib/libwbclient.so.* \
usr/lib/$pkgname/libwinbind-client-samba4.so
amove usr/lib/libwbclient.so.*
}
_winbind_clients() {
pkgdesc="Samba winbind client tools"
depends=
cd "$pkgdir"
_mv_files \
amove \
usr/bin/ntlm_auth \
usr/bin/wbinfo
}
......@@ -409,8 +384,7 @@ _winbind_clients() {
_libnss_winbind() {
pkgdesc="Samba winbind NSS plugin"
depends=
cd "$pkgdir"
_mv_files \
amove \
usr/lib/libnss_winbind.so* \
usr/lib/libnss_wins.so*
}
......@@ -418,8 +392,7 @@ _libnss_winbind() {
_winbind_krb5_locator() {
pkgdesc="Samba winbind krb5 locator"
depends=
cd "$pkgdir"
_mv_files \
amove \
usr/lib/samba/krb5
}
......@@ -439,8 +412,7 @@ dc() {
$pkgname-winbind=$pkgver-r$pkgrel
py3-$pkgname=$pkgver-r$pkgrel
$_dc_deps"
cd "$pkgdir"
_mv_files \
amove \
usr/bin/samba-tool \
usr/sbin/samba* \
usr/share/$pkgname \
......@@ -453,8 +425,7 @@ dc() {
_dc_libs() {
pkgdesc="Samba AD Domain Controller libraries"
cd "$pkgdir"
_mv_files \
amove \
usr/lib/libdcerpc-samr.so.* \
usr/lib/libdcerpc-server.so.* \
usr/lib/libsamba-policy.* \
......@@ -467,8 +438,9 @@ _dc_libs() {
usr/lib/$pkgname/libdb-glue-samba4.so \
usr/lib/$pkgname/libdnsserver-common-samba4.so \
usr/lib/$pkgname/libdsdb-module-samba4.so \
usr/lib/$pkgname/libhdb-samba4.so.* \
usr/lib/$pkgname/libkdc-samba4.so.* \
usr/lib/$pkgname/libgss-preauth-samba4.so \
usr/lib/$pkgname/libhdb-samba4.so* \
usr/lib/$pkgname/libkdc-samba4.so* \
usr/lib/$pkgname/libpac-samba4.so \
usr/lib/$pkgname/libposix-eadb-samba4.so \
usr/lib/$pkgname/libprocess-model-samba4.so \
......@@ -482,25 +454,27 @@ _dc_libs() {
server() {
pkgdesc="Samba server"
depends="$pkgname-common=$pkgver-r$pkgrel"
cd "$pkgdir"
_mv_files \
amove \
usr/sbin/nmbd \
usr/sbin/smbd \
usr/sbin/eventlogadm \
usr/bin/smbstatus \
\
usr/lib/$pkgname/auth \
usr/lib/$pkgname/libREG-FULL-samba4.so \
usr/lib/$pkgname/libRPC-WORKER-samba4.so \
usr/lib/$pkgname/libxattr-tdb-samba4.so \
usr/lib/$pkgname/vfs \
usr/lib/$pkgname/samba-bgqd
usr/lib/$pkgname/rpcd_* \
usr/lib/$pkgname/samba-bgqd \
usr/lib/$pkgname/samba-dcerpcd \
usr/lib/$pkgname/vfs
}
pidl() {
pkgdesc="Perl IDL compiler"
depends="perl"
cd "$pkgdir"
_mv_files \
amove \
usr/bin/pidl \
usr/share/perl*
}
......@@ -515,8 +489,7 @@ _py3() {
_test() {
pkgdesc="Samba server and client testing tools"
depends=
cd "$pkgdir"
_mv_files \
amove \
usr/bin/gentest \
usr/bin/locktest \
usr/bin/masktest \
......@@ -530,20 +503,19 @@ _test() {
libs() {
pkgdesc="Samba core libraries shared by common-tools, server and clients"
depends=
cd "$pkgdir"
# heimdal libs
_mv_files \
usr/lib/$pkgname/libasn1-samba4.so.* \
usr/lib/$pkgname/libgssapi-samba4.so.* \
usr/lib/$pkgname/libhcrypto-samba4.so.* \
usr/lib/$pkgname/libheimbase-samba4.so.* \
usr/lib/$pkgname/libheimntlm-samba4.so.* \
usr/lib/$pkgname/libhx509-samba4.so.* \
usr/lib/$pkgname/libkrb5-samba4.so.* \
usr/lib/$pkgname/libroken-samba4.so.* \
usr/lib/$pkgname/libwind-samba4.so.*
_mv_files \
amove \
usr/lib/$pkgname/libasn1-samba4.so* \
usr/lib/$pkgname/libgssapi-samba4.so* \
usr/lib/$pkgname/libhcrypto-samba4.so* \
usr/lib/$pkgname/libheimbase-samba4.so* \
usr/lib/$pkgname/libheimntlm-samba4.so* \
usr/lib/$pkgname/libhx509-samba4.so* \
usr/lib/$pkgname/libkrb5-samba4.so* \
usr/lib/$pkgname/libroken-samba4.so* \
usr/lib/$pkgname/libwind-samba4.so*
amove \
usr/lib/$pkgname/libCHARSET3-samba4.so \
usr/lib/$pkgname/libMESSAGING-SEND-samba4.so \
usr/lib/$pkgname/libMESSAGING-samba4.so \
......@@ -581,6 +553,7 @@ libs() {
usr/lib/$pkgname/libmsrpc3-samba4.so \
usr/lib/$pkgname/libndr-samba-samba4.so \
usr/lib/$pkgname/libndr-samba4.so \
usr/lib/$pkgname/libnpa-tstream-samba4.so \
usr/lib/$pkgname/libsamba-cluster-support-samba4.so \
usr/lib/$pkgname/libsamba-modules-samba4.so \
usr/lib/$pkgname/libsamba-security-samba4.so \
......@@ -614,21 +587,20 @@ libs() {
usr/lib/libtevent-util.so.*
# exit with error if some stuff stayed at main pack
rmdir "$pkgdir"/usr/lib/$pkgname \
"$pkgdir"/usr/share \
"$pkgdir"/usr/sbin \
"$pkgdir"/usr/bin \
"$pkgdir"/usr/lib \
"$pkgdir"/usr
local leftovers="$(find "$pkgdir" -type f)"
if [ -n "$leftovers" ]; then
error "files left in main package:"
echo "$leftovers" >&2
return 1
fi
}
sha512sums="
2ee5d66f5a7c1ff5b27c959be6310335eb6484476c1eadb3b8ca1bc84fb2260487136c1318539e1dc459b81bca66f268fd979f6a816ff5f905bd605a99685004 samba-4.15.9.tar.gz
9754275ace30755b75f747e201f8ad4550a823c8606e550c0ce6b3ccbaf048dd895bf2c21127271298304be7f80de9b6451091c4949ebe267ee1cf3ab497cd85 samba-4.16.4.tar.gz
f997d0bca9de64a567bccc245bec41e4aa00bacb379d8e348678dcafcf7e723e8716608c5d2d266ad816439b8b93bb8ee28371308a01c9d9c50229f1fc8deb67 netgroup.patch
58de5e79fdfd06e828d478e112d581d333a8bee88d2602b92204d780f0d707b27dd84f8e2e6b00fca40da81c8fe99aa5bcec70d8b393d3a0a83199c72a4aa48b getpwent_r.patch
b7906d66fe55a980a54161ee3f311b51bcbce76b8d4c8cc1ba6d0c5bdf98232cb192b9d2c1aa7b3e2742f5b9848c6cf429347940eefe66c3e0eda1d5aac1bf93 musl_uintptr.patch
7bef9a3514f7a875f5955009807b79f9558c984da17fbb8c7cefd3b679a29e4bd08a422185d7cc6af8230b749d6769795039828b2315119bec4e0d0025169e0a netdb-defines.patch
3b4759dfcf6ec54f2131390c9eb7fd7dd23071e304905cdeaf7a9828fa888cb3dcb5c5bb6a07a634c51d0392ac47f6e22b937faf4354e3b07cfc0de7fdfa28e9 netapp.patch
3a9363b10b6eed5d5c6e6fa73980f1012e66194254ebe7501bd66a2b6f358edf3358da8c5a7196a0b9dd6b3ce777a39bff41e7ddf7285c7fd891088cf4dc0085 netdb-defines.patch
c0afe8b1dfddc5290c9aa611163d20adc3a546f54bba0081f739cda4255829f1a72bae422b6cb049aca82e58d4daf63ad5553f4c5c51671019bfbbc2781460f0 missing-headers.patch
9bf4bbc8b03d9ea17d2f8ffeaf3a83541b171936a90bb8d75b08cc5afbdbaaec545c1b3782c90ae2ffc4568ab4e6f15fb21899d80c654a796301e16429c93b65 musl_rm_unistd_incl.patch
bc2df70e327fea5dfbd923600225f1448815d842c37d6937dd74eab7f7699d7f52cd7a8e28a61233974649cf86661a0107dce5019d33b71205e4b41bac73f4e2 add_missing___compar_fn_t.patch
......
https://bugzilla.samba.org/show_bug.cgi?id=12776
diff --git a/source3/include/client.h b/source3/include/client.h
index db8260d..becdf77 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -61,6 +61,9 @@ struct cli_state {
char *server_os;
char *server_domain;
+ /* is server_os spinstream2? true/false/not-yet-checked(-1) */
+ int is_spinstream2;
+
char *share;
char *dev;
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index bc5c1b1..6d6b725 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -111,6 +111,7 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
if (!cli->server_os) {
goto error;
}
+ cli->is_spinstream2 = -1;
cli->server_type = talloc_strdup(cli, "");
if (!cli->server_type) {
goto error;
@@ -467,6 +468,24 @@ time_t cli_state_server_time(struct cli_state *cli)
return t;
}
+bool cli_state_server_is_spinstream2(struct cli_state *cli)
+{
+ int *ret = &cli->is_spinstream2;
+ if (*ret == -1) {
+ if (*cli->server_os == '\0') {
+ DEBUG(1, ("when checking if server is SpinStream2:"
+ " server_os field is empty (should have"
+ " been sent in Session Setup protocol"
+ " response), so ... presuming not"));
+ *ret = 0;
+ }
+ else {
+ *ret = strequal(cli->server_os, "SpinStream2") ? 1 : 0;
+ }
+ }
+ return *ret == 1;
+}
+
struct cli_echo_state {
bool is_smb2;
};
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 3987477..6371bc2 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -89,6 +89,13 @@ static size_t cli_write_max_bufsize(struct cli_state *cli,
useable_space = 0xFFFFFF - data_offset;
} else if (smb1cli_conn_capabilities(cli->conn) & CAP_LARGE_WRITEX) {
useable_space = 0x1FFFF - data_offset;
+ if (cli_state_server_is_spinstream2(cli))
+ /*
+ * SpinStream2 (NetApp OnTAP, up to 8.3.2, at least;
+ * XXX may need to be more discerning than this)
+ * can't handle writes > 64k
+ */
+ useable_space = MIN(useable_space, 64 * 1024);
} else {
return min_space;
}
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index b453733..e334cc6 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -203,6 +203,7 @@ uint16_t cli_state_set_uid(struct cli_state *cli, uint16_t uid);
bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs);
time_t cli_state_server_time(struct cli_state *cli);
+bool cli_state_server_is_spinstream2(struct cli_state *cli);
struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
struct cli_state *cli, uint16_t num_echos,
DATA_BLOB data);
diff --git a/nsswitch/wins.c b/nsswitch/wins.c
index 4f79cc6..348d95b 100644
index e202a45..a310477 100644
--- a/nsswitch/wins.c
+++ b/nsswitch/wins.c
+++ b/nsswitch/wins.c
@@ -40,6 +40,14 @@ static pthread_mutex_t wins_nss_mutex = PTHREAD_MUTEX_INITIALIZER;
#define INADDRSZ 4
#endif
......@@ -14,6 +14,6 @@ index 4f79cc6..348d95b 100644
+#define NETDB_SUCCESS 0
+#endif
+
_PUBLIC_ON_LINUX_
NSS_STATUS _nss_wins_gethostbyname_r(const char *hostname,
struct hostent *he,
char *buffer,
struct hostent *he,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment