summaryrefslogtreecommitdiff
path: root/source3/smbd/posix_acls.c
AgeCommit message (Collapse)AuthorFilesLines
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)
2007-11-13Make [f]get_nt_acl return NTSTATUSVolker Lendecke1-10/+10
(This used to be commit dcbe1bf942d017a3cd5084c6ef605a13912f795b)
2007-11-06Move some access check functions that are not posix-acl specificMichael Adam1-212/+0
to a new source file of their own. Michael (This used to be commit 9dd18bb534bca6b5de6cad9580b48681b36c0832)
2007-11-06Don't repeat fast-pathing...Michael Adam1-1/+1
Michael (This used to be commit c61b4222d30288add216fac4da3cfaa537f5cd01)
2007-11-06This is a proposed patch for Bug #5023.Michael Adam1-300/+70
The three can_* access check functions in smbd/posix_acls.c that are used in smbd/open.c and smbd/nttrans.c explicitly called check_posix_acl_group_access() This lead to errors with nfsv4 acls (ZFS and GPFS). This changes the can_* functions to get the nt_acl via VFS layer and call se_access_check on that. It also removes check_posix_acl_group_access() which has no more callers. NOTE: The can_* functions should really not be in smbd/posix_acls.c but in a separate file (I propose smbd/access.c). Michael (This used to be commit 6f961a23de745aba5dcd4585b731e651b8cbeef4)
2007-11-06Add a const.Michael Adam1-1/+1
Michael (This used to be commit 7b582af2107bed3b864bb408b5c9bcce4b8e4c72)
2007-11-05Add two const's.Michael Adam1-2/+2
Michael (This used to be commit bf23c4ddff617dd3cd1e2d5cedb1b5c023356dc3)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-51/+51
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-10r25534: Apply some constVolker Lendecke1-1/+1
Why? It moves these structs from the data into the text segment, so they will never been copy-on-write copied. Not much, but as in German you say "Kleinvieh macht auch Mist...." (This used to be commit 0141e64ad4972232de867137064d0dae62da22ee)
2007-10-10r25117: The mega-patch Jerry was waiting for. Remove all pstrings fromJeremy Allison1-29/+35
the main server code paths. We should now be able to cope with paths up to PATH_MAX length now. Final job will be to add the TALLOC_CTX * parameter to unix_convert to make it explicit (for Volker). Jeremy. (This used to be commit 7f0db75fb0f24873577dcb758a2ecee74fdc4297)
2007-10-10r24809: Consolidate the use of temporary talloc contexts.Volker Lendecke1-2/+2
This adds the two functions talloc_stackframe() and talloc_tos(). * When a new talloc stackframe is allocated with talloc_stackframe(), then * the TALLOC_CTX returned with talloc_tos() is reset to that new * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse * happens: The previous talloc_tos() is restored. * * This API is designed to be robust in the sense that if someone forgets to * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and * resets the talloc_tos(). The original motivation for this patch was to get rid of the sid_string_static & friends buffers. Explicitly passing talloc context everywhere clutters code too much for my taste, so an implicit talloc_tos() is introduced here. Many of these static buffers are replaced by a single static pointer. The intended use would thus be that low-level functions can rather freely push stuff to talloc_tos, the upper layers clean up by freeing the stackframe. The more of these stackframes are used and correctly freed the more exact the memory cleanup happens. This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and lp_talloc_ctx (did I forget any?) So, never do a tmp_ctx = talloc_init("foo"); anymore, instead, use tmp_ctx = talloc_stackframe() :-) Volker (This used to be commit 6585ea2cb7f417e14540495b9c7380fe9c8c717b)
2007-10-10r23914: try to fix the build on Tru64Stefan Metzmacher1-3/+3
/usr/include/sys/acl.h:#define acl_type acl_common.entry_type was the problem... metze (This used to be commit 8557b8b570ac8f8d3d14aaeb894c8b3532558736)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r23724: Reduce access to the global inbuf a tiny bit. Add a struct smb_requestVolker Lendecke1-1/+2
that contains some of the fields from the SMB header, removing the need to access inbuf directly. This right now is used only in the open file code & friends, and creating that header is only done when needed. This needs more work, but it is a start. Jeremy, I'm only checking this into 3_0, please review before I merge it to _26. Volker (This used to be commit ca988f4e79e977160d82e86486972afd15d4acf5)
2007-10-10r23664: Fix incorrect index - should be j not i. How did we everJeremy Allison1-1/+1
live without valgrind :-). Jeremy. (This used to be commit 9b231149c78c8bbfb70c5675cffb652705ba2cd2)
2007-10-10r23663: Fix bug #4308 - Excel save operation corrupts file ACLs.Jeremy Allison1-28/+255
You don't want to know what I discovered about Windows ACLs to make this work :-(. See : http://www.codeproject.com/win32/accessctrl2.asp Search for "Q. How does Inheritance come into this?" for details. Jeremy. (This used to be commit e1d3a80d2bff2e3540637fd741fc149eeca5fb9d)
2007-10-10r23620: Convert set_nt_acl to return NTSTATUS. Also fix the chownJeremy Allison1-56/+33
return to correctly return NT_STATUS_INVALID_OWNER if it should be disallowed. Matches better what W2K3R3 does. NFSv4 ACL module owners, please examine these changes. Jeremy. (This used to be commit fc6899a5506b272f8cd5f5837ca13300b4e69a5f)
2007-10-10r22611: Fix from Jens Nissen <jens.nissen@gmx.net>. Fix badJeremy Allison1-0/+1
memory leak I introduced into acl code, also remove redundent extra check for global_sid_System : global_sid_System == S-1-5-18 which is already included in the check for a domain of global_sid_NT_Authority == S-1-5 Jeremy. (This used to be commit 10649540ac11e679997f414d4a6b12d057bd7913)
2007-10-10r22481: Move check for non-mappable SIDs to after sid_to_uid,Jeremy Allison1-11/+10
sid_to_gid mapping, add LocalSystem to non-mappable list. Jeremy. (This used to be commit 805f01464f3feb30725dbce1f90d4296380dd796)
2007-10-10r21223: Try and fix bug #4361 - Vista backup fails.Jeremy Allison1-2/+24
Based on work from Joe Meadows <jameadows@webopolis.com>. One for the Vista patchset. Jeremy. (This used to be commit 470a4dc30874b00c599806cb6dbc06fe2775144c)
2007-10-10r20873: Some correctness fixes w.r.t. Samba4 torture BASE-DELETE.Jeremy Allison1-0/+5
Allow us to correctly refuse to set delete on close on a non-empty directory. There are still some delete-on-close wrinkles to be fixed, but I understand how to do that better now. I'll fix this tomorrow. Jeremy. (This used to be commit 029635885825a5562e7974a6f5675cce3bf1b5dc)
2007-10-10r20356: Consolidate the calls to parent_dirname() per open to one.Volker Lendecke1-7/+8
This involved passing the dirname as argument to a few routines instead of calling parent_dirname() deep down. Volker (This used to be commit 7977fd78652897bb7d4db1c21c5749043428f911)
2007-10-10r20228: Bring the calling conventions of inherit_access_acl and ↵Volker Lendecke1-3/+3
change_owner_to_parent a bit closer together: Move the lp_inherit_perms() check into the callers. Volker (This used to be commit 0874093e5fff480d8ec442072318525079add633)