summaryrefslogtreecommitdiff
path: root/source3/smbd/file_access.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-11-04 15:39:55 -0700
committerJeremy Allison <jra@samba.org>2011-11-04 15:39:55 -0700
commit48512193338663df5dc4cd52179bc94337eb7113 (patch)
tree5c5511b80437522599f1ccd44e02ead89fdfcd0a /source3/smbd/file_access.c
parenta30f84a21c9d4e702ae0faace9bdf435b9882af7 (diff)
downloadsamba-48512193338663df5dc4cd52179bc94337eb7113.tar.gz
samba-48512193338663df5dc4cd52179bc94337eb7113.tar.bz2
samba-48512193338663df5dc4cd52179bc94337eb7113.zip
Add const to the smb_filename argument of smbd_check_access_rights().
Diffstat (limited to 'source3/smbd/file_access.c')
-rw-r--r--source3/smbd/file_access.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/source3/smbd/file_access.c b/source3/smbd/file_access.c
index 74855649ea..c2203673f3 100644
--- a/source3/smbd/file_access.c
+++ b/source3/smbd/file_access.c
@@ -80,7 +80,7 @@ bool can_access_file_acl(struct connection_struct *conn,
****************************************************************************/
bool can_delete_file_in_directory(connection_struct *conn,
- struct smb_filename *smb_fname)
+ const struct smb_filename *smb_fname)
{
TALLOC_CTX *ctx = talloc_tos();
char *dname = NULL;
@@ -130,18 +130,10 @@ bool can_delete_file_in_directory(connection_struct *conn,
/* sticky bit means delete only by owner of file or by root or
* by owner of directory. */
if (smb_fname_parent->st.st_ex_mode & S_ISVTX) {
- if(SMB_VFS_STAT(conn, smb_fname) != 0) {
- if (errno == ENOENT) {
- /* If the file doesn't already exist then
- * yes we'll be able to delete it. */
- ret = true;
- goto out;
- }
- DEBUG(10,("can_delete_file_in_directory: can't "
- "stat file %s (%s)",
- smb_fname_str_dbg(smb_fname),
- strerror(errno) ));
- ret = false;
+ if (!VALID_STAT(smb_fname->st)) {
+ /* If the file doesn't already exist then
+ * yes we'll be able to delete it. */
+ ret = true;
goto out;
}