Changeset 733 for branches/samba-3.5.x/source3/smbd
- Timestamp:
- Nov 12, 2012, 5:09:31 PM (13 years ago)
- Location:
- branches/samba-3.5.x/source3/smbd
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.5.x/source3/smbd/file_access.c
r620 r733 38 38 if (conn->server_info->utok.uid == 0 || conn->admin_user) { 39 39 /* I'm sorry sir, I didn't know you were root... */ 40 return true; 41 } 42 43 if (access_mask == DELETE_ACCESS && 44 VALID_STAT(smb_fname->st) && 45 S_ISLNK(smb_fname->st.st_ex_mode)) { 46 /* We can always delete a symlink. */ 40 47 return true; 41 48 } … … 116 123 * by owner of directory. */ 117 124 if (smb_fname_parent->st.st_ex_mode & S_ISVTX) { 118 if(SMB_VFS_STAT(conn, smb_fname) != 0) { 119 if (errno == ENOENT) { 120 /* If the file doesn't already exist then 121 * yes we'll be able to delete it. */ 122 ret = true; 123 goto out; 124 } 125 DEBUG(10,("can_delete_file_in_directory: can't " 126 "stat file %s (%s)", 127 smb_fname_str_dbg(smb_fname), 128 strerror(errno) )); 129 ret = false; 125 if (!VALID_STAT(smb_fname->st)) { 126 /* If the file doesn't already exist then 127 * yes we'll be able to delete it. */ 128 ret = true; 130 129 goto out; 131 130 } -
branches/samba-3.5.x/source3/smbd/nttrans.c
r732 r733 1884 1884 } 1885 1885 if (!(security_info_wanted & SECINFO_DACL)) { 1886 psd->type &= ~SEC_DESC_DACL_PRESENT; 1886 1887 psd->dacl = NULL; 1887 1888 } 1888 1889 if (!(security_info_wanted & SECINFO_SACL)) { 1890 psd->type &= ~SEC_DESC_SACL_PRESENT; 1889 1891 psd->sacl = NULL; 1890 1892 } -
branches/samba-3.5.x/source3/smbd/open.c
r732 r733 94 94 smb_fname_str_dbg(smb_fname), 95 95 (unsigned int)*access_granted )); 96 return NT_STATUS_OK; 97 } 98 99 if (access_mask == DELETE_ACCESS && 100 VALID_STAT(smb_fname->st) && 101 S_ISLNK(smb_fname->st.st_ex_mode)) { 102 /* We can always delete a symlink. */ 103 DEBUG(10,("smbd_check_open_rights: not checking ACL " 104 "on DELETE_ACCESS on symlink %s.\n", 105 smb_fname_str_dbg(smb_fname) )); 96 106 return NT_STATUS_OK; 97 107 } … … 1432 1442 } 1433 1443 1434 status = check_name(conn, smb_fname->base_name);1435 if (!NT_STATUS_IS_OK(status)) {1436 return status;1437 }1438 1439 1444 if (!posix_open) { 1440 1445 new_dos_attributes &= SAMBA_ATTRIBUTES_MASK; … … 3309 3314 } 3310 3315 3311 /* All file access must go through check_name() */3312 3313 status = check_name(conn, smb_fname->base_name);3314 if (!NT_STATUS_IS_OK(status)) {3315 goto fail;3316 }3317 3318 3316 status = create_file_unixpath( 3319 3317 conn, req, smb_fname, access_mask, share_access, -
branches/samba-3.5.x/source3/smbd/posix_acls.c
r732 r733 1124 1124 ****************************************************************************/ 1125 1125 1126 #define FILE_SPECIFIC_READ_BITS (FILE_READ_DATA|FILE_READ_EA |FILE_READ_ATTRIBUTES)1127 #define FILE_SPECIFIC_WRITE_BITS (FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_WRITE_EA |FILE_WRITE_ATTRIBUTES)1126 #define FILE_SPECIFIC_READ_BITS (FILE_READ_DATA|FILE_READ_EA) 1127 #define FILE_SPECIFIC_WRITE_BITS (FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_WRITE_EA) 1128 1128 #define FILE_SPECIFIC_EXECUTE_BITS (FILE_EXECUTE) 1129 1129 -
branches/samba-3.5.x/source3/smbd/process.c
r732 r733 1274 1274 /* Make sure this is an SMB packet. smb_size contains NetBIOS header 1275 1275 * so subtract 4 from it. */ 1276 if ( !valid_smb_header(req->inbuf)1277 || (size < (smb_size - 4))) {1276 if ((size < (smb_size - 4)) || 1277 !valid_smb_header(req->inbuf)) { 1278 1278 DEBUG(2,("Non-SMB packet of length %d. Terminating server\n", 1279 1279 smb_len(req->inbuf))); -
branches/samba-3.5.x/source3/smbd/reply.c
r732 r733 4430 4430 SSVAL(req->outbuf,smb_vwv4,nwritten>>16); 4431 4431 4432 if (nwritten < (ssize_t)numtowrite) {4433 SCVAL(req->outbuf,smb_rcls,ERRHRD);4434 SSVAL(req->outbuf,smb_err,ERRdiskfull);4435 }4436 4437 4432 DEBUG(3,("writeX fnum=%d num=%d wrote=%d\n", 4438 4433 fsp->fnum, (int)numtowrite, (int)nwritten)); … … 6291 6286 struct smb_filename *smb_fname_src = NULL; 6292 6287 struct smb_filename *smb_fname_dst = NULL; 6288 uint32_t src_ucf_flags = lp_posix_pathnames() ? UCF_UNIX_NAME_LOOKUP : UCF_COND_ALLOW_WCARD_LCOMP; 6289 uint32_t dst_ucf_flags = UCF_SAVE_LCOMP | (lp_posix_pathnames() ? 0 : UCF_COND_ALLOW_WCARD_LCOMP); 6293 6290 6294 6291 START_PROFILE(SMBmv); … … 6320 6317 req->flags2 & FLAGS2_DFS_PATHNAMES, 6321 6318 name, 6322 UCF_COND_ALLOW_WCARD_LCOMP,6319 src_ucf_flags, 6323 6320 &src_has_wcard, 6324 6321 &smb_fname_src); … … 6338 6335 req->flags2 & FLAGS2_DFS_PATHNAMES, 6339 6336 newname, 6340 UCF_COND_ALLOW_WCARD_LCOMP | UCF_SAVE_LCOMP,6337 dst_ucf_flags, 6341 6338 &dest_has_wcard, 6342 6339 &smb_fname_dst); -
branches/samba-3.5.x/source3/smbd/trans2.c
r732 r733 7736 7736 } else { 7737 7737 char *fname = NULL; 7738 uint32_t ucf_flags = 0; 7738 7739 7739 7740 /* set path info */ … … 7752 7753 } 7753 7754 7755 if (info_level == SMB_SET_FILE_UNIX_BASIC || 7756 info_level == SMB_SET_FILE_UNIX_INFO2 || 7757 info_level == SMB_FILE_RENAME_INFORMATION || 7758 info_level == SMB_POSIX_PATH_UNLINK) { 7759 ucf_flags |= UCF_UNIX_NAME_LOOKUP; 7760 } 7761 7754 7762 status = filename_convert(req, conn, 7755 7763 req->flags2 & FLAGS2_DFS_PATHNAMES, 7756 7764 fname, 7757 0,7765 ucf_flags, 7758 7766 NULL, 7759 7767 &smb_fname);
Note:
See TracChangeset
for help on using the changeset viewer.