Changeset 587 for vendor/current/source3/smbd
- Timestamp:
- Jun 29, 2011, 7:36:41 AM (14 years ago)
- Location:
- vendor/current/source3/smbd
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/smbd/fileio.c
r414 r587 313 313 314 314 if (SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st) == 0) { 315 int dosmode;316 315 trigger_write_time_update(fsp); 317 dosmode = dos_mode(fsp->conn, fsp->fsp_name); 318 if ((lp_store_dos_attributes(SNUM(fsp->conn)) || 319 MAP_ARCHIVE(fsp->conn)) && 320 !IS_DOS_ARCHIVE(dosmode)) { 321 file_set_dosmode(fsp->conn, fsp->fsp_name, 316 if (!fsp->posix_open && 317 (lp_store_dos_attributes(SNUM(fsp->conn)) || 318 MAP_ARCHIVE(fsp->conn))) { 319 int dosmode = dos_mode(fsp->conn, fsp->fsp_name); 320 if (!IS_DOS_ARCHIVE(dosmode)) { 321 file_set_dosmode(fsp->conn, fsp->fsp_name, 322 322 dosmode | aARCH, NULL, false); 323 } 323 324 } 324 325 -
vendor/current/source3/smbd/notify.c
r414 r587 77 77 struct notify_change *c; 78 78 size_t namelen; 79 int rem = 0; 79 80 uint32 u32_tmp; /* Temp arg to prs_uint32 to avoid 80 81 * signed/unsigned issues */ … … 102 103 103 104 u32_tmp = (i == num_changes-1) ? 0 : namelen + 12; 105 106 /* Align on 4-byte boundary according to MS-CIFS 2.2.7.4.2 */ 107 if ((rem = u32_tmp % 4 ) != 0) 108 u32_tmp += 4 - rem; 109 104 110 if (!prs_uint32("offset", ps, 1, &u32_tmp)) goto fail; 105 111 … … 116 122 */ 117 123 prs_set_offset(ps, prs_offset(ps)-2); 124 125 if (rem != 0) { 126 if (!prs_align_custom(ps, 4)) goto fail; 127 } 118 128 119 129 TALLOC_FREE(uni_name.buffer); -
vendor/current/source3/smbd/open.c
r414 r587 50 50 ****************************************************************************/ 51 51 52 NTSTATUS smb1_file_se_access_check(const struct security_descriptor *sd, 52 NTSTATUS smb1_file_se_access_check(connection_struct *conn, 53 const struct security_descriptor *sd, 53 54 const NT_USER_TOKEN *token, 54 55 uint32_t access_desired, 55 56 uint32_t *access_granted) 56 57 { 58 *access_granted = 0; 59 60 if (conn->server_info->utok.uid == 0 || conn->admin_user) { 61 /* I'm sorry sir, I didn't know you were root... */ 62 *access_granted = access_desired; 63 if (access_desired & SEC_FLAG_MAXIMUM_ALLOWED) { 64 *access_granted |= FILE_GENERIC_ALL; 65 } 66 return NT_STATUS_OK; 67 } 68 57 69 return se_access_check(sd, 58 70 token, … … 74 86 struct security_descriptor *sd = NULL; 75 87 76 *access_granted = 0;77 78 if (conn->server_info->utok.uid == 0 || conn->admin_user) {79 /* I'm sorry sir, I didn't know you were root... */80 *access_granted = access_mask;81 if (access_mask & SEC_FLAG_MAXIMUM_ALLOWED) {82 *access_granted |= FILE_GENERIC_ALL;83 }84 return NT_STATUS_OK;85 }86 87 88 status = SMB_VFS_GET_NT_ACL(conn, smb_fname->base_name, 88 89 (OWNER_SECURITY_INFORMATION | … … 98 99 } 99 100 100 status = smb1_file_se_access_check(sd, 101 status = smb1_file_se_access_check(conn, 102 sd, 101 103 conn->server_info->ptok, 102 104 access_mask, … … 1413 1415 } 1414 1416 1415 status = smb1_file_se_access_check(sd, 1417 status = smb1_file_se_access_check(conn, 1418 sd, 1416 1419 conn->server_info->ptok, 1417 1420 access_mask, -
vendor/current/source3/smbd/oplock.c
r414 r587 119 119 120 120 flush_write_cache(fsp, OPLOCK_RELEASE_FLUSH); 121 delete_write_cache(fsp); 121 122 122 123 TALLOC_FREE(fsp->oplock_timeout); -
vendor/current/source3/smbd/process.c
r427 r587 1489 1489 * NetBIOS session request, keepalive, etc. 1490 1490 */ 1491 reply_special((char *)inbuf );1491 reply_special((char *)inbuf, nread); 1492 1492 goto done; 1493 1493 } -
vendor/current/source3/smbd/reply.c
r427 r587 496 496 ****************************************************************************/ 497 497 498 void reply_special(char *inbuf )498 void reply_special(char *inbuf, size_t inbuf_size) 499 499 { 500 500 int msg_type = CVAL(inbuf,0); 501 501 int msg_flags = CVAL(inbuf,1); 502 fstring name1,name2;503 char name_type1, name_type2;504 502 struct smbd_server_connection *sconn = smbd_server_conn; 505 506 503 /* 507 504 * We only really use 4 bytes of the outbuf, but for the smb_setlen … … 511 508 char outbuf[smb_size]; 512 509 513 *name1 = *name2 = 0;514 515 510 memset(outbuf, '\0', sizeof(outbuf)); 516 511 … … 519 514 switch (msg_type) { 520 515 case 0x81: /* session request */ 516 { 517 /* inbuf_size is guarenteed to be at least 4. */ 518 fstring name1,name2; 519 int name_type1, name_type2; 520 int name_len1, name_len2; 521 522 *name1 = *name2 = 0; 521 523 522 524 if (sconn->nbt.got_session) { … … 526 528 SCVAL(outbuf,0,0x82); 527 529 SCVAL(outbuf,3,0); 528 if (name_len(inbuf+4) > 50 || 529 name_len(inbuf+4 + name_len(inbuf + 4)) > 50) { 530 531 /* inbuf_size is guaranteed to be at least 4. */ 532 name_len1 = name_len((unsigned char *)(inbuf+4),inbuf_size - 4); 533 if (name_len1 <= 0 || name_len1 > inbuf_size - 4) { 530 534 DEBUG(0,("Invalid name length in session request\n")); 531 535 return; 532 536 } 533 name_type1 = name_extract(inbuf,4,name1); 534 name_type2 = name_extract(inbuf,4 + name_len(inbuf + 4),name2); 537 name_len2 = name_len((unsigned char *)(inbuf+4+name_len1),inbuf_size - 4 - name_len1); 538 if (name_len2 <= 0 || name_len2 > inbuf_size - 4 - name_len1) { 539 DEBUG(0,("Invalid name length in session request\n")); 540 return; 541 } 542 543 name_type1 = name_extract((unsigned char *)inbuf, 544 inbuf_size,(unsigned int)4,name1); 545 name_type2 = name_extract((unsigned char *)inbuf, 546 inbuf_size,(unsigned int)(4 + name_len1),name2); 547 548 if (name_type1 == -1 || name_type2 == -1) { 549 DEBUG(0,("Invalid name type in session request\n")); 550 return; 551 } 552 535 553 DEBUG(2,("netbios connect: name1=%s0x%x name2=%s0x%x\n", 536 554 name1, name_type1, name2, name_type2)); … … 566 584 sconn->nbt.got_session = true; 567 585 break; 586 } 568 587 569 588 case 0x89: /* session keepalive request … … 5847 5866 smb_fname_str_dbg(smb_fname_dst))); 5848 5867 5849 if (lp_map_archive(SNUM(conn)) || 5850 lp_store_dos_attributes(SNUM(conn))) { 5868 if (!lp_posix_pathnames() && 5869 (lp_map_archive(SNUM(conn)) || 5870 lp_store_dos_attributes(SNUM(conn)))) { 5851 5871 /* We must set the archive bit on the newly 5852 5872 renamed file. */ -
vendor/current/source3/smbd/sesssetup.c
r427 r587 726 726 727 727 /* parse out the OIDs and the first sec blob */ 728 if (!parse_negTokenTarg(blob_in, OIDs, pblob_out)) { 728 if (!parse_negTokenTarg(blob_in, OIDs, pblob_out) || 729 OIDs[0] == NULL) { 729 730 return NT_STATUS_LOGON_FAILURE; 730 731 } -
vendor/current/source3/smbd/trans2.c
r478 r587 6595 6595 bool modify_mtime = true; 6596 6596 struct file_id id; 6597 struct smb_filename *smb_fname_tmp = NULL; 6597 6598 SMB_STRUCT_STAT sbuf; 6598 6599 … … 6647 6648 6648 6649 if (!VALID_STAT(sbuf)) { 6649 struct smb_filename *smb_fname_tmp = NULL;6650 6650 /* 6651 6651 * The only valid use of this is to create character and block … … 6676 6676 6677 6677 sbuf = smb_fname_tmp->st; 6678 TALLOC_FREE(smb_fname_tmp);6678 smb_fname = smb_fname_tmp; 6679 6679 6680 6680 /* Ensure we don't try and change anything else. */
Note:
See TracChangeset
for help on using the changeset viewer.