The Samba-Bugzilla – Attachment 4278 Details for
Bug 6297
owner of sticky directory cannot delete files created by others
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for v3-4-test and v3-3-test
look (text/plain), 1.47 KB, created by
Jeremy Allison
on 2009-06-11 15:06:39 UTC
(
hide
)
Description:
Patch for v3-4-test and v3-3-test
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2009-06-11 15:06:39 UTC
Size:
1.47 KB
patch
obsolete
>diff --git a/source3/smbd/file_access.c b/source3/smbd/file_access.c >index abffcd2..1c0124e 100644 >--- a/source3/smbd/file_access.c >+++ b/source3/smbd/file_access.c >@@ -89,7 +89,8 @@ bool can_delete_file_in_directory(connection_struct *conn, const char *fname) > } > > #ifdef S_ISVTX >- /* sticky bit means delete only by owner or root. */ >+ /* sticky bit means delete only by owner of file or by root or >+ * by owner of directory. */ > if (sbuf.st_mode & S_ISVTX) { > SMB_STRUCT_STAT sbuf_file; > if(SMB_VFS_STAT(conn, fname, &sbuf_file) != 0) { >@@ -98,14 +99,24 @@ bool can_delete_file_in_directory(connection_struct *conn, const char *fname) > * yes we'll be able to delete it. */ > return True; > } >+ DEBUG(10,("can_delete_file_in_directory: can't " >+ "stat file %s (%s)", >+ fname, strerror(errno) )); > return False; > } > /* > * Patch from SATOH Fumiyasu <fumiyas@miraclelinux.com> > * for bug #3348. Don't assume owning sticky bit > * directory means write access allowed. >+ * Fail to delete if we're not the owner of the file, >+ * or the owner of the directory as we have no possible >+ * chance of deleting. Otherwise, go on and check the ACL. > */ >- if (conn->server_info->utok.uid != sbuf_file.st_uid) { >+ if ((conn->server_info->utok.uid != sbuf.st_uid) && >+ (conn->server_info->utok.uid != sbuf_file.st_uid)) { >+ DEBUG(10,("can_delete_file_in_directory: not " >+ "owner of file %s or directory %s", >+ fname, dname)); > return False; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
jra
:
review+
Actions:
View
Attachments on
bug 6297
:
4090
|
4107
|
4108
|
4124
|
4125
|
4172
|
4265
|
4271
|
4272
|
4273
|
4274
|
4275
| 4278