archrelease: copy trunk to staging-x86_64
[arch-packages.git] / samba / repos / extra-x86_64 / samba-4.17.0-15195.patch
blob5762f69ff65e8e5edbb41f604efc572d95374d10
1 diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c
2 index fa301b9fa18..98750754036 100644
3 --- a/source3/libsmb/libsmb_file.c
4 +++ b/source3/libsmb/libsmb_file.c
5 @@ -464,6 +464,7 @@ SMBC_getatr(SMBCCTX * context,
6 struct timespec access_time_ts = {0};
7 struct timespec write_time_ts = {0};
8 struct timespec change_time_ts = {0};
9 + struct timespec w_time_ts = {0};
10 time_t write_time = 0;
11 SMB_INO_T ino = 0;
12 struct cli_credentials *creds = NULL;
13 @@ -506,6 +507,7 @@ SMBC_getatr(SMBCCTX * context,
16 if (!srv->no_pathinfo2) {
17 + bool not_supported_error = false;
18 status = cli_qpathinfo2(targetcli,
19 targetpath,
20 &create_time_ts,
21 @@ -518,11 +520,21 @@ SMBC_getatr(SMBCCTX * context,
22 if (NT_STATUS_IS_OK(status)) {
23 goto setup_stat;
25 + if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_LEVEL) ||
26 + NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) {
27 + not_supported_error = true;
28 + }
29 + if (!not_supported_error) {
30 + /* "Normal error". Just return it to caller. */
31 + TALLOC_FREE(frame);
32 + return status;
33 + }
36 srv->no_pathinfo2 = True;
38 if (!srv->no_pathinfo3) {
39 + bool not_supported_error = false;
40 status = cli_qpathinfo3(targetcli,
41 targetpath,
42 &create_time_ts,
43 @@ -535,6 +547,15 @@ SMBC_getatr(SMBCCTX * context,
44 if (NT_STATUS_IS_OK(status)) {
45 goto setup_stat;
47 + if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_LEVEL) ||
48 + NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) {
49 + not_supported_error = true;
50 + }
51 + if (!not_supported_error) {
52 + /* "Normal error". Just return it to caller. */
53 + TALLOC_FREE(frame);
54 + return status;
55 + }
58 srv->no_pathinfo3 = True;
59 @@ -545,14 +566,11 @@ SMBC_getatr(SMBCCTX * context,
62 status = cli_getatr(targetcli, targetpath, &attr, &size, &write_time);
63 - if (NT_STATUS_IS_OK(status)) {
64 - struct timespec w_time_ts =
65 - convert_time_t_to_timespec(write_time);
67 - access_time_ts = change_time_ts = write_time_ts = w_time_ts;
69 - goto setup_stat;
70 + if (!NT_STATUS_IS_OK(status)) {
71 + goto all_failed;
73 + w_time_ts = convert_time_t_to_timespec(write_time);
74 + access_time_ts = change_time_ts = write_time_ts = w_time_ts;
76 setup_stat:
77 setup_stat(sb,
78 @@ -573,7 +591,7 @@ all_failed:
79 srv->no_pathinfo3 = False;
81 TALLOC_FREE(frame);
82 - return NT_STATUS_ACCESS_DENIED;
83 + return status;