The Samba-Bugzilla – Attachment 17546 Details for
Bug 15195
Permission denied calling SMBC_getatr when file not exists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
"Raw" patch for master
l1 (text/plain), 2.33 KB, created by
Jeremy Allison
on 2022-10-09 04:24:51 UTC
(
hide
)
Description:
"Raw" patch for master
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2022-10-09 04:24:51 UTC
Size:
2.33 KB
patch
obsolete
>diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c >index fa301b9fa18..98750754036 100644 >--- a/source3/libsmb/libsmb_file.c >+++ b/source3/libsmb/libsmb_file.c >@@ -464,6 +464,7 @@ SMBC_getatr(SMBCCTX * context, > struct timespec access_time_ts = {0}; > struct timespec write_time_ts = {0}; > struct timespec change_time_ts = {0}; >+ struct timespec w_time_ts = {0}; > time_t write_time = 0; > SMB_INO_T ino = 0; > struct cli_credentials *creds = NULL; >@@ -506,6 +507,7 @@ SMBC_getatr(SMBCCTX * context, > } > > if (!srv->no_pathinfo2) { >+ bool not_supported_error = false; > status = cli_qpathinfo2(targetcli, > targetpath, > &create_time_ts, >@@ -518,11 +520,21 @@ SMBC_getatr(SMBCCTX * context, > if (NT_STATUS_IS_OK(status)) { > goto setup_stat; > } >+ if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_LEVEL) || >+ NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { >+ not_supported_error = true; >+ } >+ if (!not_supported_error) { >+ /* "Normal error". Just return it to caller. */ >+ TALLOC_FREE(frame); >+ return status; >+ } > } > > srv->no_pathinfo2 = True; > > if (!srv->no_pathinfo3) { >+ bool not_supported_error = false; > status = cli_qpathinfo3(targetcli, > targetpath, > &create_time_ts, >@@ -535,6 +547,15 @@ SMBC_getatr(SMBCCTX * context, > if (NT_STATUS_IS_OK(status)) { > goto setup_stat; > } >+ if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_LEVEL) || >+ NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { >+ not_supported_error = true; >+ } >+ if (!not_supported_error) { >+ /* "Normal error". Just return it to caller. */ >+ TALLOC_FREE(frame); >+ return status; >+ } > } > > srv->no_pathinfo3 = True; >@@ -545,14 +566,11 @@ SMBC_getatr(SMBCCTX * context, > } > > status = cli_getatr(targetcli, targetpath, &attr, &size, &write_time); >- if (NT_STATUS_IS_OK(status)) { >- struct timespec w_time_ts = >- convert_time_t_to_timespec(write_time); >- >- access_time_ts = change_time_ts = write_time_ts = w_time_ts; >- >- goto setup_stat; >+ if (!NT_STATUS_IS_OK(status)) { >+ goto all_failed; > } >+ w_time_ts = convert_time_t_to_timespec(write_time); >+ access_time_ts = change_time_ts = write_time_ts = w_time_ts; > > setup_stat: > setup_stat(sb, >@@ -573,7 +591,7 @@ all_failed: > srv->no_pathinfo3 = False; > > TALLOC_FREE(frame); >- return NT_STATUS_ACCESS_DENIED; >+ return status; > } > > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 15195
: 17546 |
17583
|
17585
|
17603
|
17604