summaryrefslogtreecommitdiff
path: root/source3/smbd/posix_acls.c
AgeCommit message (Collapse)AuthorFilesLines
2009-11-18s3: Replace some create_synthetic_smb_fname() callsVolker Lendecke1-18/+10
In very hot codepaths like the statcache copy_smb_filename and the subsequent recursive talloc_free is noticable in the CPU load.
2009-11-12Fix bug 6891 - using windows explorer to change ownership on a folder fails ↵Jeremy Allison1-1/+11
with Bad File Descriptor. Jeremy.
2009-11-11Fix bug 6878 - Cannot change ACL's inherit flag.Jeremy Allison1-44/+108
Based on a patch submitted by Tsukasa Hamano <hamano@osstech.co.jp>, this is a change in the POSIX ACL mapping to deal with the lossy mapping for directory ACE entries: We have a lossy mapping: directory ACE entries CREATOR_OWNER ------\ (map to) +---> SMB_ACL_USER_OBJ owning sid ------/ CREATOR_GROUP ------\ (map to) +---> SMB_ACL_GROUP_OBJ primary group sid --/ on set. And on read of a directory ACL SMB_ACL_USER_OBJ ----> CREATOR_OWNER SMB_ACL_GROUP_OBJ ---> CREATOR_GROUP. Deal with this on set by duplicating owning sid and primary group sid ACE entries into the directory ACL. Jeremy.
2009-11-06Fix bug 6841 - "map acl inherit = yes" not working.Jeremy Allison1-8/+29
The code to read the new V2 SAMBA_PAI entries had two errors. Jeremy.
2009-10-02Remove lots of duplicate code and move it into oneJeremy Allison1-26/+6
function vfs_stat_fsp(). Stops code looking at fsp->posix_open except for exceptional circumstances. Jeremy.
2009-10-02Missed one VFS_STAT -> VFS_LSTATJeremy Allison1-1/+1
Jeremy.
2009-10-02Fix more use of VFS_STAT when posix pathnames selected.Jeremy Allison1-18/+44
Jeremy.
2009-08-07s3:smbd: conn_free_internal() can be static nowStefan Metzmacher1-4/+4
metze
2009-08-06Remove a const warning.Jeremy Allison1-1/+1
Jeremy.
2009-07-22s3: Convert some callers of vfs_stat_smb_fname to SMB_VFS_STAT()Tim Prouty1-6/+18
2009-07-20s3: Change fsp->fsp_name to be an smb_filename struct!Tim Prouty1-134/+113
2009-07-08s3: Plumb smb_filename through dos_mode() and related funtionsTim Prouty1-98/+162
2009-07-08s3: convert unix_mode to take an smb_filenameTim Prouty1-4/+17
2009-06-25s3 file_access: Convert some more functions over to use smb_filneameTim Prouty1-1/+13
2009-06-24s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTATTim Prouty1-5/+8
This patch introduces two new temporary helper functions vfs_stat_smb_fname and vfs_lstat_smb_fname. They basically allowed me to call the new smb_filename version of stat, while avoiding plumbing it through callers that are still too inconvenient. As the conversion moves along, I will be able to remove callers of this, with the goal being to remove all callers. There was also a bug in create_synthetic_smb_fname_split (also a temporary utility function) that caused it to incorrectly handle filenames with ':'s in them when in posix mode. This is now fixed.
2009-06-18acl_group_override() doesn't need to call stat. Pass thisJeremy Allison1-28/+17
down from above (as const). Jeremy.
2009-06-18Add some const to the stat struct in the dosmode calls.Jeremy Allison1-9/+22
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.
2009-06-12s3: Plumb smb_filename through SMB_VFS_CREATE_FILETim Prouty1-4/+11
2009-06-10s3: Remove unused stat structs being passed to SMB_VFS_CREATE_FILETim Prouty1-4/+1
2009-05-26Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke1-29/+29
This patch introduces struct stat_ex { dev_t st_ex_dev; ino_t st_ex_ino; mode_t st_ex_mode; nlink_t st_ex_nlink; uid_t st_ex_uid; gid_t st_ex_gid; dev_t st_ex_rdev; off_t st_ex_size; struct timespec st_ex_atime; struct timespec st_ex_mtime; struct timespec st_ex_ctime; struct timespec st_ex_btime; /* birthtime */ blksize_t st_ex_blksize; blkcnt_t st_ex_blocks; }; typedef struct stat_ex SMB_STRUCT_STAT; It is really large because due to the friendly libc headers playing macro tricks with fields like st_ino, so I renamed them to st_ex_xxx. Why this change? To support birthtime, we already have quite a few #ifdef's at places where it does not really belong. With a stat struct that we control, we can consolidate the nanosecond timestamps and the birthtime deep in the VFS stat calls. At this moment it is triggered by a request to support the birthtime field for GPFS. GPFS does not extend the system level struct stat, but instead has a separate call that gets us the additional information beyond posix. Without being able to do that within the VFS stat calls, that support would have to be scattered around the main smbd code. It will very likely break all the onefs modules, but I think the changes will be reasonably easy to do.
2009-05-08Expand the comment explaining why user_in_group_sid isJeremy Allison1-1/+6
not reliable for winbindd users from foreign domains. Jeremy.
2009-05-08s3:smbd: fix posix acls when setting an ACL without explicit ACE for the ↵Stefan Metzmacher1-3/+18
owner (bug#2346) The problem of bug #2346 remains for users exported by winbindd, because create_token_from_username() just fakes the token when the user is not in the local sam domain. This causes user_in_group_sid() to give totally wrong results. In uid_entry_in_group() we need to check if we already have the full unix token in the current_user struct. If so we should use the current_user unix token, instead of doing a very complex user_in_group_sid() which doesn't give reliable results anyway. metze
2009-04-22Fix profile acls in some corner casesSimo Sorce1-3/+18
Always add back the real original owner of the directory in the ACE List after we steal its ACE for the Administrators group.
2009-04-22Avoid duplicate acesSimo Sorce1-7/+48
When adding arbitrary aces to an nt_ace_list we need to make sure we are not actually adding a duplicate. add_or_replace_ace() takes care of doing the right thing.
2009-02-23More warning fixes for Solaris.Jeremy Allison1-26/+26
Jeremy.
2009-02-05Don't try and delete a default ACL from a file.Günter Kukkukk1-4/+8
2009-01-29Upgrade POSIX inheritance storage to a new format (version 2). StoresJeremy Allison1-200/+360
the Windows ACL type and flags if "map acl inherit" is set. Jeremy.
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)