Changeset 751 for trunk/server/source3/smbd/file_access.c
- Timestamp:
- Nov 29, 2012, 1:59:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/smbd/file_access.c
r745 r751 42 42 if (get_current_uid(conn) == (uid_t)0) { 43 43 /* I'm sorry sir, I didn't know you were root... */ 44 return true; 45 } 46 47 if (access_mask == DELETE_ACCESS && 48 VALID_STAT(smb_fname->st) && 49 S_ISLNK(smb_fname->st.st_ex_mode)) { 50 /* We can always delete a symlink. */ 44 51 return true; 45 52 } … … 81 88 82 89 bool can_delete_file_in_directory(connection_struct *conn, 83 struct smb_filename *smb_fname)90 const struct smb_filename *smb_fname) 84 91 { 85 92 TALLOC_CTX *ctx = talloc_tos(); … … 131 138 * by owner of directory. */ 132 139 if (smb_fname_parent->st.st_ex_mode & S_ISVTX) { 133 if(SMB_VFS_STAT(conn, smb_fname) != 0) { 134 if (errno == ENOENT) { 135 /* If the file doesn't already exist then 136 * yes we'll be able to delete it. */ 137 ret = true; 138 goto out; 139 } 140 DEBUG(10,("can_delete_file_in_directory: can't " 141 "stat file %s (%s)", 142 smb_fname_str_dbg(smb_fname), 143 strerror(errno) )); 144 ret = false; 140 if (!VALID_STAT(smb_fname->st)) { 141 /* If the file doesn't already exist then 142 * yes we'll be able to delete it. */ 143 ret = true; 145 144 goto out; 146 145 } … … 263 262 SECINFO_DACL, &secdesc); 264 263 265 if (!NT_STATUS_IS_OK(status) || secdesc == NULL) { 264 if (!NT_STATUS_IS_OK(status) || 265 secdesc == NULL || 266 secdesc->dacl == NULL) { 267 TALLOC_FREE(secdesc); 266 268 return false; 267 269 }
Note:
See TracChangeset
for help on using the changeset viewer.