diff options
-rw-r--r-- | src/nu_lanman.c | 27 | ||||
-rw-r--r-- | src/nu_lanman.h | 8 |
2 files changed, 35 insertions, 0 deletions
diff --git a/src/nu_lanman.c b/src/nu_lanman.c new file mode 100644 index 0000000..0ab935e --- /dev/null +++ b/src/nu_lanman.c | |||
@@ -0,0 +1,27 @@ | |||
1 | #include "nu_lanman.h" | ||
2 | |||
3 | BYTE LANMAN_NetShareGetInfo_1_bytes[] = { 20,0,'S','H','A','R','E',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; | ||
4 | |||
5 | SMB_STATUS handle_LANMAN( SMB_HEADER *header, SMB_DATA *data, SMB_TRANSACTION_BYTES *bytes ) { | ||
6 | switch( GETNWORD( bytes->params ) ) { | ||
7 | case 1: /* NetShareGetInfo */ | ||
8 | { | ||
9 | BYTE *type = SKIPSTRING( 2 + bytes->params ); /* Input format string; should be "zWrLh" */ | ||
10 | type = SKIPSTRING( type ); /* Ouput format string; should be "B13", "B13BWz" or "B13BWzWWWzB9B"*/ | ||
11 | type = SKIPSTRING( type ); /* Name of the requested Share */ | ||
12 | |||
13 | switch( GETNWORD(type)) { | ||
14 | case 1: /* Medium set of information */ | ||
15 | memcpy( bytes->params, LANMAN_NetShareGetInfo_1_bytes, sizeof( LANMAN_NetShareGetInfo_1_bytes )); /* possible buffer overflow */ | ||
16 | break; | ||
17 | default: /* Later */ | ||
18 | return 0x00400002; | ||
19 | break; | ||
20 | } | ||
21 | break; | ||
22 | } | ||
23 | default: | ||
24 | return 0x00400002; | ||
25 | } | ||
26 | return 0; | ||
27 | } | ||
diff --git a/src/nu_lanman.h b/src/nu_lanman.h new file mode 100644 index 0000000..f15c37a --- /dev/null +++ b/src/nu_lanman.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef _NU_LANMAN_H_ | ||
2 | #define _NU_LANMAN_H_ | ||
3 | |||
4 | #include "nu_server.h" | ||
5 | |||
6 | SMB_STATUS handle_LANMAN( SMB_HEADER *header, SMB_DATA *data, SMB_TRANSACTION_BYTES *bytes ); | ||
7 | |||
8 | #endif | ||