diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2017-05-22 10:52:31 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2017-05-22 10:54:40 +0000 |
commit | a41b12bc1ff7c18ac51f9c38734f0c4cf663ac9a (patch) | |
tree | e75e0287ea87059502df6a2b9a17e18fc2005d15 | |
parent | f4e9419ee826624c3341a84ae65d82a212eb4d57 (diff) | |
download | alpine_aports-a41b12bc1ff7c18ac51f9c38734f0c4cf663ac9a.tar.bz2 alpine_aports-a41b12bc1ff7c18ac51f9c38734f0c4cf663ac9a.tar.xz alpine_aports-a41b12bc1ff7c18ac51f9c38734f0c4cf663ac9a.zip |
main/samba: work around issue with NetApp
https://bugzilla.samba.org/show_bug.cgi?id=12776
-rw-r--r-- | main/samba/APKBUILD | 4 | ||||
-rw-r--r-- | main/samba/netapp.patch | 85 |
2 files changed, 88 insertions, 1 deletions
diff --git a/main/samba/APKBUILD b/main/samba/APKBUILD index 0bad86ec5e..1e7b833b57 100644 --- a/main/samba/APKBUILD +++ b/main/samba/APKBUILD | |||
@@ -1,7 +1,7 @@ | |||
1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | 1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> |
2 | pkgname=samba | 2 | pkgname=samba |
3 | pkgver=4.6.1 | 3 | pkgver=4.6.1 |
4 | pkgrel=1 | 4 | pkgrel=2 |
5 | pkgdesc="Tools to access a server's filespace and printers via SMB" | 5 | pkgdesc="Tools to access a server's filespace and printers via SMB" |
6 | url="http://www.samba.org" | 6 | url="http://www.samba.org" |
7 | arch="all" | 7 | arch="all" |
@@ -48,6 +48,7 @@ source="https://us1.samba.org/samba/ftp/stable/$pkgname-$pkgver.tar.gz | |||
48 | domain.patch | 48 | domain.patch |
49 | getpwent_r.patch | 49 | getpwent_r.patch |
50 | netdb-defines.patch | 50 | netdb-defines.patch |
51 | netapp.patch | ||
51 | 52 | ||
52 | $pkgname.initd | 53 | $pkgname.initd |
53 | $pkgname.confd | 54 | $pkgname.confd |
@@ -522,6 +523,7 @@ b43809d7ecbf3968f5154c2ded6ed47dae36921f1895ea98bcce50557eb2ad39b736345ffb421465 | |||
522 | 62d373dbaee75121a1d73f2c09cdca7239705808ff807b171d1d5a28fd4ffc66bdb52494b62786d7aaba8aeece5c08433b532ca96a28d712452fe9daac8d8d2e domain.patch | 523 | 62d373dbaee75121a1d73f2c09cdca7239705808ff807b171d1d5a28fd4ffc66bdb52494b62786d7aaba8aeece5c08433b532ca96a28d712452fe9daac8d8d2e domain.patch |
523 | 0d4fd9862191554dc9c724cec0b94fd19afbfd0c4ed619e4c620c075e849cb3f3d44db1e5f119d890da23a3dd0068d9873703f3d86c47b91310521f37356208b getpwent_r.patch | 524 | 0d4fd9862191554dc9c724cec0b94fd19afbfd0c4ed619e4c620c075e849cb3f3d44db1e5f119d890da23a3dd0068d9873703f3d86c47b91310521f37356208b getpwent_r.patch |
524 | 1854577d0e4457e27da367a6c7ec0fb5cfd63cefea0a39181c9d6e78cf8d3eb50878cdddeea3daeec955d00263151c2f86ea754ff4276ef98bc52c0276d9ffe8 netdb-defines.patch | 525 | 1854577d0e4457e27da367a6c7ec0fb5cfd63cefea0a39181c9d6e78cf8d3eb50878cdddeea3daeec955d00263151c2f86ea754ff4276ef98bc52c0276d9ffe8 netdb-defines.patch |
526 | 202667cb0383414d9289cd67574f5e1140c9a0ff63bb82a746a59b2397a00db15654bfb30cb5ec1cd68a097899be0f849d9aab4c0d210152386c9e66c640f0c0 netapp.patch | ||
525 | 6bee83aab500f27248b315d8a5f567940d7232269b021d801b3d51c20ed9e4aad513ee0117f356fb388014a63a145beacb55307ef9addbf7997987304b548fcf samba.initd | 527 | 6bee83aab500f27248b315d8a5f567940d7232269b021d801b3d51c20ed9e4aad513ee0117f356fb388014a63a145beacb55307ef9addbf7997987304b548fcf samba.initd |
526 | 4faf581ecef3ec38319e3c4ab6d3995c51fd7ba83180dc5553a2ff4dfb92efadb43030c543292130c4ed0c281dc0972c6973d52d48062c5edb39bb1c4bbb6dd6 samba.confd | 528 | 4faf581ecef3ec38319e3c4ab6d3995c51fd7ba83180dc5553a2ff4dfb92efadb43030c543292130c4ed0c281dc0972c6973d52d48062c5edb39bb1c4bbb6dd6 samba.confd |
527 | f88ebe59ca3a9e9b77dd5993c13ef3e73a838efb8ed858088b464a330132d662f33e25c27819e38835389dee23057a3951de11bae1eef55db8ff5e1ec6760053 samba.logrotate" | 529 | f88ebe59ca3a9e9b77dd5993c13ef3e73a838efb8ed858088b464a330132d662f33e25c27819e38835389dee23057a3951de11bae1eef55db8ff5e1ec6760053 samba.logrotate" |
diff --git a/main/samba/netapp.patch b/main/samba/netapp.patch new file mode 100644 index 0000000000..ba760ef51a --- /dev/null +++ b/main/samba/netapp.patch | |||
@@ -0,0 +1,85 @@ | |||
1 | https://bugzilla.samba.org/show_bug.cgi?id=12776 | ||
2 | |||
3 | diff --git a/source3/include/client.h b/source3/include/client.h | ||
4 | index db8260d..becdf77 100644 | ||
5 | --- a/source3/include/client.h | ||
6 | +++ b/source3/include/client.h | ||
7 | @@ -61,6 +61,9 @@ struct cli_state { | ||
8 | char *server_os; | ||
9 | char *server_domain; | ||
10 | |||
11 | + /* is server_os spinstream2? true/false/not-yet-checked(-1) */ | ||
12 | + int is_spinstream2; | ||
13 | + | ||
14 | char *share; | ||
15 | char *dev; | ||
16 | |||
17 | diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c | ||
18 | index bc5c1b1..6d6b725 100644 | ||
19 | --- a/source3/libsmb/clientgen.c | ||
20 | +++ b/source3/libsmb/clientgen.c | ||
21 | @@ -112,6 +112,7 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx, | ||
22 | if (!cli->server_os) { | ||
23 | goto error; | ||
24 | } | ||
25 | + cli->is_spinstream2 = -1; | ||
26 | cli->server_type = talloc_strdup(cli, ""); | ||
27 | if (!cli->server_type) { | ||
28 | goto error; | ||
29 | @@ -430,6 +431,24 @@ time_t cli_state_server_time(struct cli_state *cli) | ||
30 | return t; | ||
31 | } | ||
32 | |||
33 | +bool cli_state_server_is_spinstream2(struct cli_state *cli) | ||
34 | +{ | ||
35 | + int *ret = &cli->is_spinstream2; | ||
36 | + if (*ret == -1) { | ||
37 | + if (*cli->server_os == '\0') { | ||
38 | + DEBUG(1, ("when checking if server is SpinStream2:" | ||
39 | + " server_os field is empty (should have" | ||
40 | + " been sent in Session Setup protocol" | ||
41 | + " response), so ... presuming not")); | ||
42 | + *ret = 0; | ||
43 | + } | ||
44 | + else { | ||
45 | + *ret = strequal(cli->server_os, "SpinStream2") ? 1 : 0; | ||
46 | + } | ||
47 | + } | ||
48 | + return *ret == 1; | ||
49 | +} | ||
50 | + | ||
51 | struct cli_echo_state { | ||
52 | bool is_smb2; | ||
53 | }; | ||
54 | diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c | ||
55 | index 3987477..6371bc2 100644 | ||
56 | --- a/source3/libsmb/clireadwrite.c | ||
57 | +++ b/source3/libsmb/clireadwrite.c | ||
58 | @@ -89,6 +89,13 @@ static size_t cli_write_max_bufsize(struct cli_state *cli, | ||
59 | useable_space = 0xFFFFFF - data_offset; | ||
60 | } else if (smb1cli_conn_capabilities(cli->conn) & CAP_LARGE_WRITEX) { | ||
61 | useable_space = 0x1FFFF - data_offset; | ||
62 | + if (cli_state_server_is_spinstream2(cli)) | ||
63 | + /* | ||
64 | + * SpinStream2 (NetApp OnTAP, up to 8.3.2, at least; | ||
65 | + * XXX may need to be more discerning than this) | ||
66 | + * can't handle writes > 64k | ||
67 | + */ | ||
68 | + useable_space = MIN(useable_space, 64 * 1024); | ||
69 | } else { | ||
70 | return min_space; | ||
71 | } | ||
72 | diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h | ||
73 | index b453733..e334cc6 100644 | ||
74 | --- a/source3/libsmb/proto.h | ||
75 | +++ b/source3/libsmb/proto.h | ||
76 | @@ -203,6 +203,7 @@ uint16_t cli_state_set_uid(struct cli_state *cli, uint16_t uid); | ||
77 | bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive); | ||
78 | uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs); | ||
79 | time_t cli_state_server_time(struct cli_state *cli); | ||
80 | +bool cli_state_server_is_spinstream2(struct cli_state *cli); | ||
81 | struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, | ||
82 | struct cli_state *cli, uint16_t num_echos, | ||
83 | DATA_BLOB data); | ||
84 | |||
85 | |||