summaryrefslogtreecommitdiff
path: root/source3/smbd/posix_acls.c
AgeCommit message (Collapse)AuthorFilesLines
2009-01-22Fix logic error in try_chown - we shouldn't arbitrarily chownJeremy Allison1-6/+9
to ourselves unless that was passed in. Jeremy.
2009-01-22Second part of the attemt to fix #4308 - Excel save operation corrupts file ↵Jeremy Allison1-131/+144
ACLs. If the chown succeeds then the ACL set should also. Ensure this is the case (refactor some of this code to make it simpler to read also). Jeremy.
2009-01-22Another attempt to fix bug #4308 - Excel save operation corrupts file ACLs.Jeremy Allison1-25/+4
Simo is completely correct. We should be doing the chown *first*, and fail the ACL set if this fails. The long standing assumption I made when writing the initial POSIX ACL code was that Windows didn't control who could chown a file in the same was as POSIX. In POSIX only root can do this whereas I wasn't sure who could do this in Windows at the time (I didn't understand the privilege model). So the assumption was that setting the ACL was more important (early tests showed many failed ACL set's due to inability to chown). But now we have privileges in smbd, and we must always fail an ACL set when we can't chown first. The key that Simo noticed is that the CREATOR_OWNER bits in the ACL incoming are relative to the *new* owner, not the old one. This is why the old user owner disappears on ACL set - their access was set via the USER_OBJ in the creator POSIX ACL and when the ownership changes they lose their access. Patch is simple - just ensure we do the chown first before evaluating the incoming ACL re-read the owners. We already have code to do this it just wasn't rigorously being applied. Jeremy.
2008-12-31Rename parent_dirname_talloc() to parent_dirname()Volker Lendecke1-4/+1
2008-12-03s3: Change SMB_VFS_CREATE_FILE to take a create_file_flags argumentTim Prouty1-1/+1
This replaces the is_dos_path bool with a more future-proof argument. The next step is to plumb INTERNAL_OPEN_ONLY through this flag instead of overridding the oplock_request.
2008-12-03s3: Modify direct callers of open_file_ntcreate and open_directory to call ↵Tim Prouty1-11/+18
SMB_VFS_CREATE_FILE
2008-11-30Make nt4_compatible_acls() non-static for use by VFS ACL modules.Steven Danneman1-1/+1
2008-11-24Fix bug #5873 - ACL inheritance cannot be broken. This regresses #4308, but ↵Jeremy Allison1-0/+8
that will have to be fixed another way. Jeremy.
2008-11-06Convert to use VFS layer.Herb Lewis1-1/+1
2008-11-05Add reference to bug #4308 to remind me to add regression test to smbtorture.Jeremy Allison1-1/+1
Jeremy.
2008-10-30Start moving us closer to passing S4 RAW-ACL test using the vfs_acl_xattr ↵Jeremy Allison1-1/+1
module. Inheritance fails at the moment though. Jeremy.
2008-10-14Note url explaining this code.Jeremy Allison1-0/+4
Jeremy.
2008-10-13Pass struct smb_request to file_freeVolker Lendecke1-2/+2
on the way to get rid of chain_fsp
2008-10-13Pass struct smb_request to file_newVolker Lendecke1-1/+1
Goal is to remove the chain_fsp global variable
2008-10-09Remove SEC_ACCESS. It's a uint32_t.Jeremy Allison1-19/+7
Jeremy.
2008-10-08Deal with inheritance from parent directory when setting WindowsJeremy Allison1-1/+1
ACLs. Jeremy.
2008-10-07Update vfs version as I've added a const to the security_descriptor paramter ↵Jeremy Allison1-25/+26
in fset_nt_acl(). Need to watch the build farm to make sure I haven't broken the AIX or Solaris ACL modules. Jeremy.
2008-09-10Fix bug #5052 - not work cancel inheritance on share. We wereJeremy Allison1-3/+10
using the parent security descriptor type and flags instead of using the passed in SD. Jeremy. (This used to be commit 0d824d7188518aaa7b4e890885e6bc42e94397c5)
2008-07-03Patch from SATOH Fumiyasu <fumiyas@osstech.co.jp> for bug #5202. Re-activate ↵Jeremy Allison1-14/+26
"acl group control" parameter and make it only apply to owning group. Also added man page fix. Jeremy. (This used to be commit e98e080bad2c8b9f038a8f2dffcfeba1d5f392ce)
2008-06-19RWX on a file does not imply DELETE accessVolker Lendecke1-1/+1
Without this the changed checks in can_delete_file_in_directory give DELETE access where there is none. So we can end up granting the ntcreate&x preparing the unlink where we should not, which leads to a NT_STATUS_ACCESS_DENIED at close time later, which in turn does *not* give the access denied error message in the Windows GUI. can_delete_file_in_directory will grant access now by looking at the directory permissions. (This used to be commit 51b5364c2afb3a18df4bec2bc1624760ccc01676)
2008-06-19Remove some codeVolker Lendecke1-12/+4
Did not measure it, but I think a single write is better than a read and a conditional branch (This used to be commit abe1bed665ad8d1dbf9177dcbb9344b25df9594c)
2008-05-05Remove connection_struct->mem_ctx, connection_struct is its own parentVolker Lendecke1-14/+13
(This used to be commit 559180f7d30606d1999399d954ceedc798c669a4)
2008-05-02Rename inherit_access_acl() -> inherit_access_posix_acl() to make use clear.Jeremy Allison1-4/+4
Jeremy. (This used to be commit b739c7f1cdb2b19a380b06681b00dcf490d788a9)
2008-05-02Move directory_has_default_acl() to file_access.c, belongsJeremy Allison1-25/+0
there as it no longer uses explicit POSIX ACL calls. Jeremy. (This used to be commit ac1eac9b0d07b7b3d341c06ef1a8fd8f3c05a618)
2008-05-01Start to ensure we use the NT ACL interface, keep the POSIXJeremy Allison1-21/+46
ACL interface inside the VFS modules. Will help when moving to storing NT ACLs. Jeremy. (This used to be commit b08ea48f883d1b000f6364c1ff8f62bc25741244)
2008-03-27posix_acls: clarify loop condition code, removing unneeded counter variable.Michael Adam1-7/+2
Coverity ID 545 falsely classified this as a NULL dereferencing bug. By putting the loop of walking the list of aces more naturely not using additional counters, it becomes much more obvious that it is not entered when dir_ace == NULL. The same modifications are done for the file_ace loop. Michael (This used to be commit 6dab6cf0647d7db01e5e472f8b5cf21395b7dbf0)
2008-01-24Fix the same bug with user -> user_obj.Jeremy Allison1-1/+7
Jeremy. (This used to be commit c5edf7456955471b8590c2cfa67c7f47a387cdf0)
2008-01-24Fix a really subtle old, old bug :-). When canonicalizing theJeremy Allison1-3/+9
NT ACL into a POSIX one, if the group being set is the primary group of the file, map it into a SMB_ACL_GROUP_OBJ, not a SMB_ACL_GROUP. Otherwise we get an extra bogus group entry in the POSIX ACL. Jeremy. (This used to be commit 4d302254fdfce2c267cf6b21f662d5aa2dc9c72c)
2008-01-24Correctly set flags in ACE's inherited from parent. Still one bugJeremy Allison1-3/+35
left to find then I'll back-port to 3.0.28. Jeremy. (This used to be commit 3df2f7ca782e418703d82f7a1f3c035a365f9589)
2008-01-24Make explicit in debug we're ignoring flags from the parent SD.Jeremy Allison1-6/+10
Jeremy (This used to be commit 58cfa4b1bdc1ce30cc3befb342cc98ac0e283585)
2008-01-24Add debug messages to trace this if needed.Jeremy Allison1-0/+14
Jeremy. (This used to be commit b628269b3260661cb4eeeab8c533b3129827ba62)
2008-01-24The checks for OI and CI were just wrong.... Fix them. Thanks toJeremy Allison1-9/+4
Jim for testing this. Jeremy. (This used to be commit e898789e0d819df05b14bcedfa1d230c7a983440)
2008-01-24First part of fix for bug #4929 - worked out by jmcd.Jeremy Allison1-80/+29
Cope with protected ACL set correctly. Jeremy. (This used to be commit f5e50f42e7c79b4f8857602457db5b97886bd19e)
2008-01-16Merge latest fixes to vfs_gpfs and NFS4 ACLs from Samba 3.0 CTDB branch ↵Alexander Bokovoy1-1/+30
(from http://samba.org/~tridge/3_0-ctdb) Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit 1daad835cbfb4615a8fe7a241f4d578f7e69f214)
2008-01-08Remove redundant parameter fd from SMB_VFS_FSETXATTR().Michael Adam1-1/+1
Michael (This used to be commit 0bd2643463a9160c8a1c7e1c2f8cca7b89060e09)
2008-01-08Remove redundant parameter fd from SMB_VFS_FREMOVEXATTR().Michael Adam1-1/+1
Michael (This used to be commit bfc3b5a27f707d3e4b8d5d66192891e22365fbb3)
2008-01-08Remove redundant parameter fd from SMB_VFS_FGETXATTR().Michael Adam1-1/+1
Michael (This used to be commit 2cb739a82dc6bb194d60718cc74b26ee7c1c46a7)
2008-01-08Remove redundant parameter fd from SMB_VFS_SYS_ACL_SET_FD().Michael Adam1-5/+5
Michael (This used to be commit 9296e93588c0e795cae770765050247ac1474a74)
2008-01-08Remove redundant parameter fd from SMB_VFS_FCHMOD_ACL().Michael Adam1-1/+1
Michael (This used to be commit 7b201c177b3668f54751ba17d6a0b53ed913e7f7)
2008-01-07Remove redundant parameter fd from SMB_VFS_SYS_ACL_GET_FD().Michael Adam1-4/+4
Michael (This used to be commit 42663e8736e1a3dfb57e0aafdcbf5fec880da779)
2008-01-07Remove redundant parameter fd from SMB_VFS_FCHOWN().Michael Adam1-1/+1
Michael (This used to be commit fbb193db3e0dc51cb000ae406a68bc547f31d9ab)
2008-01-07Remove redundant parameter fd from SMB_VFS_FSTAT().Michael Adam1-3/+3
Michael (This used to be commit 0b86c420be94d295f6917a220b5d699f65b46711)
2007-12-21Some C++ fixesVolker Lendecke1-3/+3
(This used to be commit 5c392c4c6e277a24d0d477902dc7856b2b46ee53)
2007-12-19Change the prototype of the vfs function get_nt_acl().Michael Adam1-1/+1
Up to now, get_nt_acl() took a files_struct pointer (fsp) and a file name. All the underlying functions should need and now do need (after the previous preparatory work), is a connection_struct and a file name. The connection_struct is already there in the vfs_handle passed to the vfs functions. So the files_struct argument can be eliminated. This eliminates the need of calling open_file_stat in a couple of places to produce the fsp needed. Michael (This used to be commit b5f600fab53c9d159a958c59795db3ba4a8acc63)
2007-12-19Split get_nt_acl() into two functions: fsp- and non-fsp variant.Michael Adam1-63/+148
Replace smbd/posix_acls.c:get_nt_acl() by two funcions: posix_get_nt_acl() and posix_fget_nt_acl(). The first takes a connection struct and a file name instead of a files_struct pointer. This is in preparation of changing the vfs api for SMB_VFS_GET_NT_ACL. Michael (This used to be commit 50c82cc1456736fa634fb656e63555319742f725)
2007-12-19Remove the "is_directory" parameter from canonicalise_acl():Michael Adam1-7/+9
It can be retrieved from the stat buffer. Michael (This used to be commit b0ae830bf57dcaec00b2a2eabfec7221a3b7f791)
2007-12-19Change canonicalise_acl() to not take an fsp.Michael Adam1-8/+15
Convert canonicalise_acl() to take connection_struct, is_directory and file name instead of files_struct pointer. Michael (This used to be commit d579a7f84fd47a3f00215725cecd65b21a5ff2e0)
2007-12-19Change ensure_canon_entry_valid() to not take and fsp.Michael Adam1-10/+11
Convert ensure_canon_entry_valid() to take share_params and an is_directory flag instead of an files_struct pointer. Michael (This used to be commit bdb208124bd703edee03ac4d2a4ec45ecdfc135e)
2007-12-19Change apply_default_perms() to not take an fsp.Michael Adam1-14/+15
This is a first change in a series: Pass what is needed instead of files_struct pointers to some functions. This is in preparation of introducing two variants of get_nt_acl - one for fname (which does not need an fsp), one for file descriptor. This changes apply_default_perms to take share_params (rather thatn snum) and an is_directory flag instead of an fsp. Michael (This used to be commit d7e2e93758f6598a0459db3255300558618f066e)
2007-12-15Replace sid_string_static by sid_string_dbg in DEBUGsVolker Lendecke1-10/+8
(This used to be commit bb35e794ec129805e874ceba882bcc1e84791a09)