summaryrefslogtreecommitdiff
path: root/source3/smbd/file_access.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-06-18 15:07:14 -0700
committerJeremy Allison <jra@samba.org>2009-06-18 15:07:14 -0700
commitd2da9dee686881106678d50a96713f0632dcdf10 (patch)
tree9b46c0c510a995414e07d2cda99c40123f88e5f6 /source3/smbd/file_access.c
parent34267482d53cb559cc40c4ec2bee929c21b7886b (diff)
downloadsamba-d2da9dee686881106678d50a96713f0632dcdf10.tar.gz
samba-d2da9dee686881106678d50a96713f0632dcdf10.tar.bz2
samba-d2da9dee686881106678d50a96713f0632dcdf10.zip
Add some const to the stat struct in the dosmode calls.
Fix a couple more unix_convert uses to filename_convert. Fix bug in acl_group_override() where an uninitialized struct could be used. Move unix_convert with wildcard use in SMBsearch reply to boilerplate code. Jeremy.
Diffstat (limited to 'source3/smbd/file_access.c')
-rw-r--r--source3/smbd/file_access.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/source3/smbd/file_access.c b/source3/smbd/file_access.c
index 8b282e25b6..195f722471 100644
--- a/source3/smbd/file_access.c
+++ b/source3/smbd/file_access.c
@@ -155,7 +155,7 @@ bool can_delete_file_in_directory(connection_struct *conn,
Note this doesn't take into account share write permissions.
****************************************************************************/
-bool can_access_file_data(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf, uint32 access_mask)
+bool can_access_file_data(connection_struct *conn, const char *fname, const SMB_STRUCT_STAT *psbuf, uint32 access_mask)
{
if (!(access_mask & (FILE_READ_DATA|FILE_WRITE_DATA))) {
return False;
@@ -172,12 +172,7 @@ bool can_access_file_data(connection_struct *conn, const char *fname, SMB_STRUCT
return True;
}
- if (!VALID_STAT(*psbuf)) {
- /* Get the file permission mask and owners. */
- if(SMB_VFS_STAT(conn, fname, psbuf) != 0) {
- return False;
- }
- }
+ SMB_ASSERT(psbuf && VALID_STAT(*psbuf));
/* Check primary owner access. */
if (conn->server_info->utok.uid == psbuf->st_ex_uid) {
@@ -208,7 +203,7 @@ bool can_access_file_data(connection_struct *conn, const char *fname, SMB_STRUCT
Note this doesn't take into account share write permissions.
****************************************************************************/
-bool can_write_to_file(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf)
+bool can_write_to_file(connection_struct *conn, const char *fname, const SMB_STRUCT_STAT *psbuf)
{
return can_access_file_data(conn, fname, psbuf, FILE_WRITE_DATA);
}