Skip to contentSkip to conversation

smb/client: update SMB1 maperror, part 2

PATCH New [email protected] 1 participant 8 messages Jan 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover smb/client: update SMB1 maperror, part 2

From: ChenXiaoSong <[email protected]>

This is a preparation to improve the search speed of the SMB1 maperror.

The previous work is here:
part 1: https://lore.kernel.org/linux-cifs/[email protected]/

ChenXiaoSong (7):
smb/client: map NT_STATUS_NOTIFY_ENUM_DIR smb/client: map NT_STATUS_BUFFER_OVERFLOW smb/client: map NT_STATUS_MORE_PROCESSING_REQUIRED smb/client: map NT_STATUS_PRIVILEGE_NOT_HELD smb/client: rename to NT_STATUS_SOME_NOT_MAPPED smb/client: rename to NT_ERROR_INVALID_DATATYPE smb/client: move NT_STATUS_MORE_ENTRIES

 fs/smb/client/nterr.c        |  3 ++-
 fs/smb/client/nterr.h        | 12 ++++++------
 fs/smb/client/smb1maperror.c |  4 ++++
 3 files changed, 12 insertions(+), 7 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/7 smb/client: map NT_STATUS_NOTIFY_ENUM_DIR

From: ChenXiaoSong <[email protected]>

See MS-CIFS 2.2.2.4 STATUS_NOTIFY_ENUM_DIR.

---
 fs/smb/client/nterr.c        | 1 +
 fs/smb/client/nterr.h        | 2 +-
 fs/smb/client/smb1maperror.c | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
fs/smb/client/nterr.c +1 -0
index ab5a2119efd0..806ad6d7c22a 100644
@@ -14,6 +14,7 @@
 const struct nt_err_code_struct nt_errs[] = {
 	{"NT_STATUS_OK", NT_STATUS_OK},
 	{"NT_STATUS_PENDING", NT_STATUS_PENDING},
+	{"NT_STATUS_NOTIFY_ENUM_DIR", NT_STATUS_NOTIFY_ENUM_DIR},
 	{"NT_STATUS_MEDIA_CHANGED", NT_STATUS_MEDIA_CHANGED},
 	{"NT_STATUS_END_OF_MEDIA", NT_STATUS_END_OF_MEDIA},
 	{"NT_STATUS_MEDIA_CHECK", NT_STATUS_MEDIA_CHECK},
fs/smb/client/nterr.h +1 -1
index b04cd0d786b1..e8306704f5e3 100644
@@ -27,7 +27,6 @@ extern const struct nt_err_code_struct nt_errs[];
 #define NT_ERROR_INVALID_PARAMETER     0x0057
 #define NT_ERROR_INSUFFICIENT_BUFFER   0x007a
 #define NT_STATUS_1804                 0x070c
-#define NT_STATUS_NOTIFY_ENUM_DIR      0x010c
 
 /*
  * Win32 Error codes extracted using a loop in smbclient then printing a netmon
@@ -37,6 +36,7 @@ extern const struct nt_err_code_struct nt_errs[];
 #define NT_STATUS_OK                   0x0000
 #define NT_STATUS_PENDING              0x0103
 #define NT_STATUS_SOME_UNMAPPED        0x0107
+#define NT_STATUS_NOTIFY_ENUM_DIR      0x010c
 #define NT_STATUS_BUFFER_OVERFLOW  0x80000005
 #define NT_STATUS_NO_MORE_ENTRIES  0x8000001a
 #define NT_STATUS_MEDIA_CHANGED    0x8000001c
fs/smb/client/smb1maperror.c +1 -0
index e8aa7d44cbc6..10ab889a442c 100644
@@ -113,6 +113,7 @@ static const struct {
 	__u32 ntstatus;
 } ntstatus_to_dos_map[] = {
 	{
+	ERRSRV, ERR_NOTIFY_ENUM_DIR, NT_STATUS_NOTIFY_ENUM_DIR}, {
 	ERRDOS, ERRgeneral, NT_STATUS_UNSUCCESSFUL}, {
 	ERRDOS, ERRbadfunc, NT_STATUS_NOT_IMPLEMENTED}, {
 	ERRDOS, ERRbadpipe, NT_STATUS_INVALID_INFO_CLASS}, {
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/7 smb/client: map NT_STATUS_BUFFER_OVERFLOW

In reply to [email protected]

From: ChenXiaoSong <[email protected]>

See MS-CIFS 2.2.2.4 STATUS_BUFFER_OVERFLOW.

---
 fs/smb/client/smb1maperror.c | 1 +
 1 file changed, 1 insertion(+)
fs/smb/client/smb1maperror.c +1 -0
index 10ab889a442c..c1330d32ef09 100644
@@ -114,6 +114,7 @@ static const struct {
 } ntstatus_to_dos_map[] = {
 	{
 	ERRSRV, ERR_NOTIFY_ENUM_DIR, NT_STATUS_NOTIFY_ENUM_DIR}, {
+	ERRDOS, ERRmoredata, NT_STATUS_BUFFER_OVERFLOW}, {
 	ERRDOS, ERRgeneral, NT_STATUS_UNSUCCESSFUL}, {
 	ERRDOS, ERRbadfunc, NT_STATUS_NOT_IMPLEMENTED}, {
 	ERRDOS, ERRbadpipe, NT_STATUS_INVALID_INFO_CLASS}, {
Signature · 1 line
2.43.0
#3 lore raw

PATCH 3/7 smb/client: map NT_STATUS_MORE_PROCESSING_REQUIRED

In reply to [email protected]

From: ChenXiaoSong <[email protected]>

See MS-CIFS 2.2.2.4 STATUS_MORE_PROCESSING_REQUIRED.

---
 fs/smb/client/smb1maperror.c | 1 +
 1 file changed, 1 insertion(+)
fs/smb/client/smb1maperror.c +1 -0
index c1330d32ef09..421a7ab7bdfb 100644
@@ -115,6 +115,7 @@ static const struct {
 	{
 	ERRSRV, ERR_NOTIFY_ENUM_DIR, NT_STATUS_NOTIFY_ENUM_DIR}, {
 	ERRDOS, ERRmoredata, NT_STATUS_BUFFER_OVERFLOW}, {
+	ERRDOS, ERRmoredata, NT_STATUS_MORE_PROCESSING_REQUIRED}, {
 	ERRDOS, ERRgeneral, NT_STATUS_UNSUCCESSFUL}, {
 	ERRDOS, ERRbadfunc, NT_STATUS_NOT_IMPLEMENTED}, {
 	ERRDOS, ERRbadpipe, NT_STATUS_INVALID_INFO_CLASS}, {
Signature · 1 line
2.43.0
#4 lore raw

PATCH 4/7 smb/client: map NT_STATUS_PRIVILEGE_NOT_HELD

In reply to [email protected]

From: ChenXiaoSong <[email protected]>

See MS-CIFS 2.2.2.4 STATUS_PRIVILEGE_NOT_HELD.

---
 fs/smb/client/smb1maperror.c | 1 +
 1 file changed, 1 insertion(+)
fs/smb/client/smb1maperror.c +1 -0
index 421a7ab7bdfb..ceba8754f03b 100644
@@ -116,6 +116,7 @@ static const struct {
 	ERRSRV, ERR_NOTIFY_ENUM_DIR, NT_STATUS_NOTIFY_ENUM_DIR}, {
 	ERRDOS, ERRmoredata, NT_STATUS_BUFFER_OVERFLOW}, {
 	ERRDOS, ERRmoredata, NT_STATUS_MORE_PROCESSING_REQUIRED}, {
+	ERRDOS, ERRnoaccess, NT_STATUS_PRIVILEGE_NOT_HELD}, {
 	ERRDOS, ERRgeneral, NT_STATUS_UNSUCCESSFUL}, {
 	ERRDOS, ERRbadfunc, NT_STATUS_NOT_IMPLEMENTED}, {
 	ERRDOS, ERRbadpipe, NT_STATUS_INVALID_INFO_CLASS}, {
Signature · 1 line
2.43.0
#5 lore raw

PATCH 5/7 smb/client: rename to NT_STATUS_SOME_NOT_MAPPED

In reply to [email protected]

From: ChenXiaoSong <[email protected]>

See MS-ERREF 2.3.1 STATUS_SOME_NOT_MAPPED.

---
 fs/smb/client/nterr.c | 2 +-
 fs/smb/client/nterr.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/smb/client/nterr.c +1 -1
index 806ad6d7c22a..279566cac435 100644
@@ -695,7 +695,7 @@ const struct nt_err_code_struct nt_errs[] = {
 	{"NT_STATUS_NETWORK_SESSION_EXPIRED", NT_STATUS_NETWORK_SESSION_EXPIRED},
 	{"NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES},
 	{"NT_STATUS_MORE_ENTRIES", NT_STATUS_MORE_ENTRIES},
-	{"NT_STATUS_SOME_UNMAPPED", NT_STATUS_SOME_UNMAPPED},
+	{"NT_STATUS_SOME_NOT_MAPPED", NT_STATUS_SOME_NOT_MAPPED},
 	{"NT_STATUS_NO_SUCH_JOB", NT_STATUS_NO_SUCH_JOB},
 	{"NT_STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP",
 	 NT_STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP},
fs/smb/client/nterr.h +1 -1
index e8306704f5e3..cab16d53e11c 100644
@@ -35,7 +35,7 @@ extern const struct nt_err_code_struct nt_errs[];
 
 #define NT_STATUS_OK                   0x0000
 #define NT_STATUS_PENDING              0x0103
-#define NT_STATUS_SOME_UNMAPPED        0x0107
+#define NT_STATUS_SOME_NOT_MAPPED      0x0107
 #define NT_STATUS_NOTIFY_ENUM_DIR      0x010c
 #define NT_STATUS_BUFFER_OVERFLOW  0x80000005
 #define NT_STATUS_NO_MORE_ENTRIES  0x8000001a
Signature · 1 line
2.43.0
#6 lore raw

PATCH 6/7 smb/client: rename to NT_ERROR_INVALID_DATATYPE

In reply to [email protected]

From: ChenXiaoSong <[email protected]>

See MS-ERREF 2.2 ERROR_INVALID_DATATYPE.

---
 fs/smb/client/nterr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/nterr.h +1 -1
index cab16d53e11c..03d120e2ce09 100644
@@ -26,7 +26,7 @@ extern const struct nt_err_code_struct nt_errs[];
 #define NT_STATUS_MORE_ENTRIES         0x0105
 #define NT_ERROR_INVALID_PARAMETER     0x0057
 #define NT_ERROR_INSUFFICIENT_BUFFER   0x007a
-#define NT_STATUS_1804                 0x070c
+#define NT_ERROR_INVALID_DATATYPE      0x070c
 
 /*
  * Win32 Error codes extracted using a loop in smbclient then printing a netmon
Signature · 1 line
2.43.0
#7 lore raw

PATCH 7/7 smb/client: move NT_STATUS_MORE_ENTRIES

In reply to [email protected]

From: ChenXiaoSong <[email protected]>

It is an NTSTATUS value, not a Win32 error code.

---
 fs/smb/client/nterr.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
fs/smb/client/nterr.h +3 -3
index 03d120e2ce09..9a4a450c6571 100644
@@ -22,19 +22,19 @@ struct nt_err_code_struct {
 
 extern const struct nt_err_code_struct nt_errs[];
 
-/* Win32 Status codes. */
-#define NT_STATUS_MORE_ENTRIES         0x0105
+/* Win32 Error Codes. */
 #define NT_ERROR_INVALID_PARAMETER     0x0057
 #define NT_ERROR_INSUFFICIENT_BUFFER   0x007a
 #define NT_ERROR_INVALID_DATATYPE      0x070c
 
 /*
- * Win32 Error codes extracted using a loop in smbclient then printing a netmon
+ * NTSTATUS Values extracted using a loop in smbclient then printing a netmon
  * sniff to a file.
  */
 
 #define NT_STATUS_OK                   0x0000
 #define NT_STATUS_PENDING              0x0103
+#define NT_STATUS_MORE_ENTRIES         0x0105
 #define NT_STATUS_SOME_NOT_MAPPED      0x0107
 #define NT_STATUS_NOTIFY_ENUM_DIR      0x010c
 #define NT_STATUS_BUFFER_OVERFLOW  0x80000005
Signature · 1 line
2.43.0