Changeset 233 for branches/samba-3.2.x/source/smbd
- Timestamp:
- May 27, 2009, 11:39:15 AM (16 years ago)
- Location:
- branches/samba-3.2.x/source/smbd
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/smbd/close.c
r232 r233 168 168 ****************************************************************************/ 169 169 170 staticNTSTATUS delete_all_streams(connection_struct *conn, const char *fname)170 NTSTATUS delete_all_streams(connection_struct *conn, const char *fname) 171 171 { 172 172 struct stream_struct *stream_info; … … 468 468 struct timespec ts[2]; 469 469 NTSTATUS status; 470 int ret = -1; 470 471 471 472 ZERO_STRUCT(sbuf); … … 482 483 /* Ensure we have a valid stat struct for the source. */ 483 484 if (fsp->fh->fd != -1) { 484 if (SMB_VFS_FSTAT(fsp, &sbuf) == -1) { 485 return map_nt_error_from_unix(errno); 486 } 485 ret = SMB_VFS_FSTAT(fsp, &sbuf); 487 486 } else { 488 if (SMB_VFS_STAT(fsp->conn,fsp->fsp_name,&sbuf) == -1) { 489 return map_nt_error_from_unix(errno); 490 } 487 if (fsp->posix_open) { 488 ret = SMB_VFS_LSTAT(fsp->conn,fsp->fsp_name,&sbuf); 489 } else { 490 ret = SMB_VFS_STAT(fsp->conn,fsp->fsp_name,&sbuf); 491 } 492 } 493 494 if (ret == -1) { 495 return map_nt_error_from_unix(errno); 491 496 } 492 497 … … 576 581 577 582 saved_status4 = update_write_time_on_close(fsp); 583 if (NT_STATUS_EQUAL(saved_status4, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { 584 /* Someone renamed the file or a parent directory containing 585 * this file. We can't do anything about this, we don't have 586 * an "update timestamp by fd" call in POSIX. Eat the error. */ 587 588 saved_status4 = NT_STATUS_OK; 589 } 578 590 579 591 if (NT_STATUS_IS_OK(status)) { -
branches/samba-3.2.x/source/smbd/dnsregister.c
r133 r233 110 110 111 111 if (dns_state == NULL) { 112 *dns_state_ptr = dns_state = talloc(NULL, struct dns_reg_state); 112 dns_state = talloc_zero(NULL, struct dns_reg_state); 113 *dns_state_ptr = dns_state; 113 114 if (dns_state == NULL) { 114 115 return; -
branches/samba-3.2.x/source/smbd/dosmode.c
r232 r233 335 335 p = path; 336 336 } 337 338 if (p[0] == '.' && p[1] != '.' && p[1] != 0) { 337 338 /* Only . and .. are not hidden. */ 339 if (p[0] == '.' && !((p[1] == '\0') || 340 (p[1] == '.' && p[2] == '\0'))) { 339 341 result |= aHIDDEN; 340 342 } … … 387 389 p = path; 388 390 } 389 390 if (p[0] == '.' && p[1] != '.' && p[1] != 0) { 391 392 /* Only . and .. are not hidden. */ 393 if (p[0] == '.' && !((p[1] == '\0') || 394 (p[1] == '.' && p[2] == '\0'))) { 391 395 result |= aHIDDEN; 392 396 } -
branches/samba-3.2.x/source/smbd/open.c
r232 r233 1194 1194 bool posix_open = False; 1195 1195 bool new_file_created = False; 1196 bool clear_ads = false; 1196 1197 struct file_id id; 1197 1198 NTSTATUS fsp_open = NT_STATUS_ACCESS_DENIED; … … 1326 1327 * exist create. */ 1327 1328 flags2 |= (O_CREAT | O_TRUNC); 1329 clear_ads = true; 1328 1330 break; 1329 1331 … … 1332 1334 * exist create. */ 1333 1335 flags2 |= (O_CREAT | O_TRUNC); 1336 clear_ads = true; 1334 1337 break; 1335 1338 … … 1356 1359 } 1357 1360 flags2 |= O_TRUNC; 1361 clear_ads = true; 1358 1362 break; 1359 1363 … … 1787 1791 1788 1792 SMB_ASSERT(lck != NULL); 1793 1794 /* Delete streams if create_disposition requires it */ 1795 if (file_existed && clear_ads && !is_ntfs_stream_name(fname)) { 1796 status = delete_all_streams(conn, fname); 1797 if (!NT_STATUS_IS_OK(status)) { 1798 TALLOC_FREE(lck); 1799 fd_close(fsp); 1800 return status; 1801 } 1802 } 1789 1803 1790 1804 /* note that we ignore failure for the following. It is -
branches/samba-3.2.x/source/smbd/posix_acls.c
r232 r233 4064 4064 SMB_ACL_T def_acl = NULL; 4065 4065 4066 if (num_def_acls && !S_ISDIR(psbuf->st_mode)) { 4067 DEBUG(5,("set_unix_posix_default_acl: Can't set default ACL on non-directory file %s\n", fname )); 4068 errno = EISDIR; 4069 return False; 4066 if (!S_ISDIR(psbuf->st_mode)) { 4067 if (num_def_acls) { 4068 DEBUG(5,("set_unix_posix_default_acl: Can't set default ACL on non-directory file %s\n", fname )); 4069 errno = EISDIR; 4070 return False; 4071 } else { 4072 return True; 4073 } 4070 4074 } 4071 4075 -
branches/samba-3.2.x/source/smbd/process.c
r232 r233 1034 1034 /* 0x31 */ { NULL, NULL, 0 }, 1035 1035 /* 0x32 */ { "SMBtrans2",reply_trans2, AS_USER | CAN_IPC }, 1036 /* 0x33 */ { "SMBtranss2",reply_transs2, AS_USER },1036 /* 0x33 */ { "SMBtranss2",reply_transs2, AS_USER | CAN_IPC}, 1037 1037 /* 0x34 */ { "SMBfindclose",reply_findclose,AS_USER}, 1038 1038 /* 0x35 */ { "SMBfindnclose",reply_findnclose,AS_USER}, -
branches/samba-3.2.x/source/smbd/reply.c
r232 r233 79 79 } 80 80 81 if (! stream_started && *s == ':') {81 if (!posix_path && !stream_started && *s == ':') { 82 82 if (*p_last_component_contains_wcard) { 83 83 return NT_STATUS_OBJECT_NAME_INVALID; 84 84 } 85 /* stream names allow more characters than file names */ 85 /* Stream names allow more characters than file names. 86 We're overloading posix_path here to allow a wider 87 range of characters. If stream_started is true this 88 is still a Windows path even if posix_path is true. 89 JRA. 90 */ 86 91 stream_started = true; 87 92 start_of_name_component = false; -
branches/samba-3.2.x/source/smbd/server.c
r232 r233 1402 1402 1403 1403 if (*lp_rootdir()) { 1404 if (sys_chroot(lp_rootdir()) == 0) 1405 DEBUG(2,("Changed root to %s\n", lp_rootdir())); 1404 if (sys_chroot(lp_rootdir()) != 0) { 1405 DEBUG(0,("Failed to change root to %s\n", lp_rootdir())); 1406 exit(1); 1407 } 1408 if (chdir("/") == -1) { 1409 DEBUG(0,("Failed to chdir to / on chroot to %s\n", lp_rootdir())); 1410 exit(1); 1411 } 1412 DEBUG(0,("Changed root to %s\n", lp_rootdir())); 1406 1413 } 1407 1414 -
branches/samba-3.2.x/source/smbd/trans2.c
r232 r233 4972 4972 4973 4973 static NTSTATUS smb_set_file_dosmode(connection_struct *conn, 4974 files_struct *fsp, 4974 4975 const char *fname, 4975 4976 SMB_STRUCT_STAT *psbuf, … … 4980 4981 } 4981 4982 4983 if (fsp) { 4984 if (fsp->base_fsp) { 4985 fname = fsp->base_fsp->fsp_name; 4986 } else { 4987 fname = fsp->fsp_name; 4988 } 4989 } 4990 4982 4991 if (dosmode) { 4983 4992 if (S_ISDIR(psbuf->st_mode)) { … … 5704 5713 dosmode = IVAL(pdata,32); 5705 5714 status = smb_set_file_dosmode(conn, 5706 fname, 5707 psbuf, 5708 dosmode); 5715 fsp, 5716 fname, 5717 psbuf, 5718 dosmode); 5719 5709 5720 if (!NT_STATUS_IS_OK(status)) { 5710 5721 return status;
Note:
See TracChangeset
for help on using the changeset viewer.