summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-10-11 04:25:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:04:55 -0500
commit3ecf9119d5055b0706c485eeba8df1bd898de4ee (patch)
treecd9f5930f167a6cb83365061eda520e6845cdf4b
parent8ec32e008a2309e04d954bd7c6740740735628db (diff)
downloadsamba-3ecf9119d5055b0706c485eeba8df1bd898de4ee.tar.gz
samba-3ecf9119d5055b0706c485eeba8df1bd898de4ee.tar.bz2
samba-3ecf9119d5055b0706c485eeba8df1bd898de4ee.zip
r10885: Fix bug where read-only share files are always seen as
read-only. Noticed by Andrew Bartlett. Jeremy (This used to be commit a33f4f0d2afe28ca0e3ab6c9ecfcdbaa267a7fbe)
-rw-r--r--source3/smbd/dosmode.c2
-rw-r--r--source3/smbd/posix_acls.c5
2 files changed, 2 insertions, 5 deletions
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index efbd5f04cb..6aee6ba426 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -479,7 +479,7 @@ int file_utime(connection_struct *conn, const char *fname, struct utimbuf *times
*/
/* Check if we have write access. */
- if (can_write_to_file(conn, fname, &sbuf)) {
+ if (CAN_WRITE(conn) && can_write_to_file(conn, fname, &sbuf)) {
/* We are allowed to become root and change the filetime. */
become_root();
ret = SMB_VFS_UTIME(conn,fname, times);
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index f1c9426676..818bf95b3f 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -4149,16 +4149,13 @@ BOOL can_delete_file_in_directory(connection_struct *conn, const char *fname)
/****************************************************************************
Actually emulate the in-kernel access checking for write access. We need
this to successfully check for ability to write for dos filetimes.
+ 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)
{
int ret;
- if (!CAN_WRITE(conn)) {
- return False;
- }
-
if (current_user.uid == 0 || conn->admin_user) {
/* I'm sorry sir, I didn't know you were root... */
return True;