summaryrefslogtreecommitdiff
path: root/src/nu_lanman.c
blob: 0ab935ead89a095ce1cf7b7b257cd490eb540e3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "nu_lanman.h"

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 };

SMB_STATUS handle_LANMAN( SMB_HEADER *header, SMB_DATA *data, SMB_TRANSACTION_BYTES *bytes ) {
  switch( GETNWORD( bytes->params ) ) {
    case 1: /* NetShareGetInfo */
    {
      BYTE *type = SKIPSTRING( 2 + bytes->params ); /* Input format string; should be "zWrLh" */
            type = SKIPSTRING( type );              /* Ouput format string; should be "B13", "B13BWz" or "B13BWzWWWzB9B"*/
            type = SKIPSTRING( type );              /* Name of the requested Share */

      switch( GETNWORD(type)) {
        case 1: /* Medium set of information */
          memcpy( bytes->params, LANMAN_NetShareGetInfo_1_bytes, sizeof( LANMAN_NetShareGetInfo_1_bytes )); /* possible buffer overflow */
          break;
        default: /* Later */
          return 0x00400002;
          break;
      }
      break;
    }
    default:
      return 0x00400002;
  }
  return 0;
}