Print this page
Build provider 3rd arg from smb_request_t
hacking...


  42  * STRING DirectoryName[];            Directory name
  43  *
  44  * Servers require clients to have at least create permission for the
  45  * subtree containing the directory in order to create a new directory.
  46  * The creator's access rights to the new directory are be determined by
  47  * local policy on the server.
  48  *
  49  * Server Response                    Description
  50  * ================================== =================================
  51  * UCHAR WordCount;                   Count of parameter words = 0
  52  * USHORT ByteCount;                  Count of data bytes = 0
  53  */
  54 smb_sdrc_t
  55 smb_pre_create_directory(smb_request_t *sr)
  56 {
  57         int rc;
  58 
  59         rc = smbsr_decode_data(sr, "%S", sr,
  60             &sr->arg.dirop.fqi.fq_path.pn_path);
  61 
  62         DTRACE_SMB_2(op__CreateDirectory__start, smb_request_t *, sr,
  63             struct dirop *, &sr->arg.dirop);
  64 
  65         return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
  66 }
  67 
  68 void
  69 smb_post_create_directory(smb_request_t *sr)
  70 {
  71         DTRACE_SMB_1(op__CreateDirectory__done, smb_request_t *, sr);
  72 }
  73 
  74 smb_sdrc_t
  75 smb_com_create_directory(smb_request_t *sr)
  76 {
  77         int rc = 0;
  78         smb_pathname_t *pn = &sr->arg.dirop.fqi.fq_path;
  79 
  80         if (!STYPE_ISDSK(sr->tid_tree->t_res_type)) {
  81                 smbsr_error(sr, NT_STATUS_ACCESS_DENIED,
  82                     ERRDOS, ERROR_ACCESS_DENIED);
  83                 return (SDRC_ERROR);


 189  * USHORT ByteCount;                  Count of data bytes; min = 2
 190  * UCHAR BufferFormat;                0x04
 191  * STRING DirectoryName[];            Directory name
 192  *
 193  * The directory to be deleted cannot be the root of the share specified
 194  * by Tid.
 195  *
 196  * Server Response                    Description
 197  * ================================== =================================
 198  * UCHAR WordCount;                   Count of parameter words = 0
 199  * USHORT ByteCount;                  Count of data bytes = 0
 200  */
 201 smb_sdrc_t
 202 smb_pre_delete_directory(smb_request_t *sr)
 203 {
 204         int rc;
 205 
 206         rc = smbsr_decode_data(sr, "%S", sr,
 207             &sr->arg.dirop.fqi.fq_path.pn_path);
 208 
 209         DTRACE_SMB_2(op__DeleteDirectory__start, smb_request_t *, sr,
 210             struct dirop *, &sr->arg.dirop);
 211 
 212         return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
 213 }
 214 
 215 void
 216 smb_post_delete_directory(smb_request_t *sr)
 217 {
 218         DTRACE_SMB_1(op__DeleteDirectory__done, smb_request_t *, sr);
 219 }
 220 
 221 smb_sdrc_t
 222 smb_com_delete_directory(smb_request_t *sr)
 223 {
 224         int rc;
 225         uint32_t flags = 0;
 226         smb_fqi_t *fqi;
 227         smb_node_t *tnode;
 228 
 229         if (!STYPE_ISDSK(sr->tid_tree->t_res_type)) {
 230                 smbsr_error(sr, NT_STATUS_ACCESS_DENIED,


 344  * UCHAR BufferFormat;                0x04
 345  * STRING DirectoryPath[];            Directory path
 346  *
 347  * Server Response                    Description
 348  * ================================== =================================
 349  *
 350  * UCHAR WordCount;                   Count of parameter words = 0
 351  * USHORT ByteCount;                  Count of data bytes = 0
 352  *
 353  * DOS clients, in particular, depend on ERRbadpath if the directory is
 354  * not found.
 355  */
 356 smb_sdrc_t
 357 smb_pre_check_directory(smb_request_t *sr)
 358 {
 359         int rc;
 360 
 361         rc = smbsr_decode_data(sr, "%S", sr,
 362             &sr->arg.dirop.fqi.fq_path.pn_path);
 363 
 364         DTRACE_SMB_2(op__CheckDirectory__start, smb_request_t *, sr,
 365             struct dirop *, &sr->arg.dirop);
 366 
 367         return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
 368 }
 369 
 370 void
 371 smb_post_check_directory(smb_request_t *sr)
 372 {
 373         DTRACE_SMB_1(op__CheckDirectory__done, smb_request_t *, sr);
 374 }
 375 
 376 smb_sdrc_t
 377 smb_com_check_directory(smb_request_t *sr)
 378 {
 379         int rc;
 380         smb_fqi_t *fqi;
 381         smb_node_t *tnode;
 382         smb_node_t *node;
 383         char *path;
 384         smb_pathname_t *pn;
 385 




  42  * STRING DirectoryName[];            Directory name
  43  *
  44  * Servers require clients to have at least create permission for the
  45  * subtree containing the directory in order to create a new directory.
  46  * The creator's access rights to the new directory are be determined by
  47  * local policy on the server.
  48  *
  49  * Server Response                    Description
  50  * ================================== =================================
  51  * UCHAR WordCount;                   Count of parameter words = 0
  52  * USHORT ByteCount;                  Count of data bytes = 0
  53  */
  54 smb_sdrc_t
  55 smb_pre_create_directory(smb_request_t *sr)
  56 {
  57         int rc;
  58 
  59         rc = smbsr_decode_data(sr, "%S", sr,
  60             &sr->arg.dirop.fqi.fq_path.pn_path);
  61 
  62         DTRACE_SMB_1(op__CreateDirectory__start, smb_request_t *, sr); /* arg.dirop */

  63 
  64         return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
  65 }
  66 
  67 void
  68 smb_post_create_directory(smb_request_t *sr)
  69 {
  70         DTRACE_SMB_1(op__CreateDirectory__done, smb_request_t *, sr);
  71 }
  72 
  73 smb_sdrc_t
  74 smb_com_create_directory(smb_request_t *sr)
  75 {
  76         int rc = 0;
  77         smb_pathname_t *pn = &sr->arg.dirop.fqi.fq_path;
  78 
  79         if (!STYPE_ISDSK(sr->tid_tree->t_res_type)) {
  80                 smbsr_error(sr, NT_STATUS_ACCESS_DENIED,
  81                     ERRDOS, ERROR_ACCESS_DENIED);
  82                 return (SDRC_ERROR);


 188  * USHORT ByteCount;                  Count of data bytes; min = 2
 189  * UCHAR BufferFormat;                0x04
 190  * STRING DirectoryName[];            Directory name
 191  *
 192  * The directory to be deleted cannot be the root of the share specified
 193  * by Tid.
 194  *
 195  * Server Response                    Description
 196  * ================================== =================================
 197  * UCHAR WordCount;                   Count of parameter words = 0
 198  * USHORT ByteCount;                  Count of data bytes = 0
 199  */
 200 smb_sdrc_t
 201 smb_pre_delete_directory(smb_request_t *sr)
 202 {
 203         int rc;
 204 
 205         rc = smbsr_decode_data(sr, "%S", sr,
 206             &sr->arg.dirop.fqi.fq_path.pn_path);
 207 
 208         DTRACE_SMB_1(op__DeleteDirectory__start, smb_request_t *, sr); /* arg.dirop */

 209 
 210         return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
 211 }
 212 
 213 void
 214 smb_post_delete_directory(smb_request_t *sr)
 215 {
 216         DTRACE_SMB_1(op__DeleteDirectory__done, smb_request_t *, sr);
 217 }
 218 
 219 smb_sdrc_t
 220 smb_com_delete_directory(smb_request_t *sr)
 221 {
 222         int rc;
 223         uint32_t flags = 0;
 224         smb_fqi_t *fqi;
 225         smb_node_t *tnode;
 226 
 227         if (!STYPE_ISDSK(sr->tid_tree->t_res_type)) {
 228                 smbsr_error(sr, NT_STATUS_ACCESS_DENIED,


 342  * UCHAR BufferFormat;                0x04
 343  * STRING DirectoryPath[];            Directory path
 344  *
 345  * Server Response                    Description
 346  * ================================== =================================
 347  *
 348  * UCHAR WordCount;                   Count of parameter words = 0
 349  * USHORT ByteCount;                  Count of data bytes = 0
 350  *
 351  * DOS clients, in particular, depend on ERRbadpath if the directory is
 352  * not found.
 353  */
 354 smb_sdrc_t
 355 smb_pre_check_directory(smb_request_t *sr)
 356 {
 357         int rc;
 358 
 359         rc = smbsr_decode_data(sr, "%S", sr,
 360             &sr->arg.dirop.fqi.fq_path.pn_path);
 361 
 362         DTRACE_SMB_1(op__CheckDirectory__start, smb_request_t *, sr); /* arg.dirop */

 363 
 364         return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
 365 }
 366 
 367 void
 368 smb_post_check_directory(smb_request_t *sr)
 369 {
 370         DTRACE_SMB_1(op__CheckDirectory__done, smb_request_t *, sr);
 371 }
 372 
 373 smb_sdrc_t
 374 smb_com_check_directory(smb_request_t *sr)
 375 {
 376         int rc;
 377         smb_fqi_t *fqi;
 378         smb_node_t *tnode;
 379         smb_node_t *node;
 380         char *path;
 381         smb_pathname_t *pn;
 382