summaryrefslogtreecommitdiff
path: root/source3/lib/sysacls.c
AgeCommit message (Collapse)AuthorFilesLines
2026-01-07lib: Remove two unused functionsVolker Lendecke1-12/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-01-07lib: Simplify sys_acl_to_text() with talloc_asprintf_addbuf()Volker Lendecke1-40/+6
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2023-07-13s3:lib: Fix code spellingAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2022-02-18vfs_aixacl: add proper header fileBjoern Jacke1-0/+4
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7239 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-02-18acl: fix function arguments for AIX' and Solaris' sys_acl_get_fd()Björn Jacke1-2/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14974 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-06-09s3: lib: sysacls: Remove all implementations of sys_acl_set_file().Jeremy Allison1-46/+0
No longer called. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09s3: lib: sysacls: Add the 'SMB_ACL_TYPE_T type' parameter to sys_acl_set_fd().Jeremy Allison1-9/+19
Pass it through to the backends. The default posixacl_sys_acl_set_fd() already copes with this anyway, as does the AIX, and Solaris backends. The HPUX code isn't compiled and was broken anyway (there was a missmatch of the number of parameters being passed to the sys_acl_set_fd_fn backend hpuxacl_sys_acl_set_fd()), and HPUX doesn't have fd-based ACLs, so just switch to calling hpuxacl_sys_acl_set_file(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09s3: lib: sysacls: Remove sys_acl_get_file(). No longer used.Jeremy Allison1-46/+0
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09VFS: SMB_VFS_SYS_ACL_GET_FD: Modify api to take additional type paramNoel Power1-1/+1
Modify all implementations (and the definitions) related to SMB_VFS_SYS_ACL_GET_FD to accept additional SMB_ACL_TYPE_T type param. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2021-06-09VFS: SMB_VFS_SYS_ACL_GET_FD: Add SMB_ACL_TYPE_T type argNoel Power1-7/+18
preparatory patch for api change to SMB_VFS_SYS_ACL_GET_FD to add new SMB_ACL_TYPE_T arg to SMB_VFS_SYS_ACL_GET_FD. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2021-05-18s3: lib: Fix the solaris build. Commit 8d0ea8bafa00 added SMB_ACL_TYPE_T ↵Jeremy Allison1-1/+4
type to solarisacl_sys_acl_set_fd() in the .c file, but not the .h. The fact no one noticed means currently no one is building master on Solaris/Illumos/OmniOS. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue May 18 19:23:25 UTC 2021 on sn-devel-184
2021-05-18s3: smbd: Remove all references to utility and backend functions supporting ↵Jeremy Allison1-36/+0
sys_acl_delete_def_file(). No longer used. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2021-05-18s3: lib: sysacls: Add sys_acl_delete_def_fd().Jeremy Allison1-1/+33
In the default (posix) case goes to posixacl_sys_acl_delete_def_fd(). For all other systems goes to their relevent backends. Now we can fill in the delete_def_fd() function in vfs_default.c Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2021-03-19s3: Remove last vestiges of Tru64 ACL support (missed in earlier patch).Jeremy Allison1-41/+0
Added WHATSNEW.txt note. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Mar 19 14:15:02 UTC 2021 on sn-devel-184
2020-12-17vfs: add acl type arg to SMB_VFS_SYS_ACL_SET_FD()Ralph Boehme1-1/+1
No change in behaviour, the new arg is not yet used in any module. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-03-01s3:lib: Add FALL_THROUGH statements in sysacls.cAndreas Schneider1-2/+4
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-05-31s3: VFS: Change SMB_VFS_SYS_ACL_SET_FILE to use const struct smb_filename * ↵Jeremy Allison1-11/+23
instead of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2017-05-31s3: VFS: Change SMB_VFS_SYS_ACL_GET_FILE to use const struct smb_filename * ↵Jeremy Allison1-16/+23
instead of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Requires a few extra cleanups in calling code. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2017-05-31s3: VFS: Change SMB_VFS_SYS_ACL_DELETE_DEF_FILE to use const struct ↵Jeremy Allison1-11/+11
smb_filename * instead of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2015-05-06lib: Fix indentationVolker Lendecke1-4/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-06lib: Fix whitespaceVolker Lendecke1-16/+16
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-03-08build: Do not rely on sys.platform for ACL tests, combine UnixWare and ↵Andrew Bartlett1-2/+2
Solaris ACL tests This avoids issues with whatever sys.platform may return, fixes the order of arguments to the CHECK_FUNCS_IN call, and only runs after Linux-style POSIX ACL detection fails. Andrew Bartlett Change-Id: I930dff1e03c1cd1ceb8f3a35823ceb805694b66a Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Tested-by: Thomas Schulz <schulz@adi.com>
2012-12-21s3-lib: Make it clear that we want to fall trough here.Andreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2012-10-11vfs: Remove irixacl module (all the fucntions in it are unimplemented)Andrew Bartlett1-37/+0
2012-10-11vfs: Fix alternative posix and no-op sys acl implementations to take a mem_ctxAndrew Bartlett1-22/+37
These were missed with the initial conversion to use a talloc context. Andrew Bartlett
2012-10-11smbd: Add mem_ctx to sys_acl_init() and all callersAndrew Bartlett1-6/+6
This changes from allocation on NULL to allocation on the supplied memory context. Currently that supplied context is talloc_tos() at the the final consumer of the ACL. Andrew Bartlett
2012-09-12smbd: Remove pre-allocation of ACL array in sys_acl_init()Andrew Bartlett1-12/+9
Instead, this is just handled with realloc in sys_acl_create_entry() This allows us to remove the size element from the SMB_ACL_T. Andrew Bartlett
2012-09-12smbd-posix_acls: Use a IDL union to store the ACL entryAndrew Bartlett1-9/+7
This is a clearer, long-term-stable structure we can hash without risking it changing. Andrew Bartlett
2012-08-15s3-sysacls: Remove sys_acl_free_qualifier() as it is a no-opAndrew Bartlett1-5/+0
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Aug 15 05:23:18 CEST 2012 on sn-devel-104
2012-08-15s3-sysacls: Remove sys_acl_free_acl() and replace with TALLOC_FREE()Andrew Bartlett1-6/+0
2012-08-15s3-smbd: Change allocation of smb_acl_t to talloc()Andrew Bartlett1-10/+9
The acl element is changed to be a talloc child, and is no longer one element longer than requested by virtue of the acl[1] base pointer. This also avoids one of the few remaining cases of over-allocation of a structure. Andrew Bartlett
2012-05-09s3-lib/sysacls: Do not include an embedded \0 between ACL entries in ↵Andrew Bartlett1-2/+3
sys_acl_to_text() This makes it possible to print the entire string again. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed May 9 06:07:06 CEST 2012 on sn-devel-104
2012-05-09s3-lib: Add const to sys_acl_to_textAndrew Bartlett1-1/+1
2012-05-09s3-lib: Fix indentation in sys_acl_to_text()Andrew Bartlett1-2/+2
2011-04-14s3-includes: only include acl prototypes when needed.Günther Deschner1-0/+20
Guenther
2011-03-30s3-includes: only include system/passwd.h when needed.Günther Deschner1-0/+1
Guenther
2008-01-08Remove redundant parameter fd from SMB_VFS_SYS_ACL_SET_FD().Michael Adam1-14/+14
Michael (This used to be commit 9296e93588c0e795cae770765050247ac1474a74)
2008-01-07Remove redundant parameter fd from SMB_VFS_SYS_ACL_GET_FD().Michael Adam1-13/+13
Michael (This used to be commit 42663e8736e1a3dfb57e0aafdcbf5fec880da779)
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-10r21953: One format fix, clarify a condition that the IBMJeremy Allison1-1/+1
checker was worried about. Jeremy. (This used to be commit 70eec7b8ae6a4992b43df853dffc21dd91498390)
2007-10-10r18016: OpenBSD apparently does not have ENOTSUPVolker Lendecke1-0/+20
(This used to be commit 8e087b7e462aaa14e3918cdfe125f8375d4d5fd8)
2007-10-10r17804: Fix a enum/int mixup found by the IRIX compiler.Volker Lendecke1-1/+1
Volker (This used to be commit 3a1cf623765cd8b6615ad317d25cebc379c762a2)
2007-10-10r17334: Some C++ warningsVolker Lendecke1-4/+5
(This used to be commit 8ae7ed1f3cecbb5285313d17b5f9511e2e622f0b)
2007-10-10r17179: Merge the vl-posixacls tmp branch into mainline. ItJim McDonough1-2768/+153
modularizes our interface into the special posix API used on the system. Without this patch the specific API flavor is determined at compile time, something which severely limits usability on systems with more than one file system. Our first targets are AIX with its JFS and JFS2 APIs, at a later stage also GPFS. But it's certainly not limited to IBM stuff, this abstraction is also necessary for anything that copes with NFSv4 ACLs. For this we will check in handling very soon. Major contributions can be found in the copyright notices as well as the checkin log of the vl-posixacls branch. The final merge to 3_0 post-3.0.23 was done by Peter Somogyi <psomogyi@gamax.hu> (This used to be commit ca0c73f281a2a65a988094a46bb3e46a94011a53)
2007-10-10r15525: fix compile error on HP-UX reported by Ryan NovosielskiGerald Carter1-1/+0
(This used to be commit e439660f916050291107f699e32ba2872ba95fcf)
2007-10-10r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison1-9/+2
realloc can return NULL in one of two cases - (1) the realloc failed, (2) realloc succeeded but the new size requested was zero, in which case this is identical to a free() call. The error paths dealing with these two cases should be different, but mostly weren't. Secondly the standard idiom for dealing with realloc when you know the new size is non-zero is the following : tmp = realloc(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } However, there were *many* *many* places in Samba where we were using the old (broken) idiom of : p = realloc(p, size) if (!p) { return error; } which will leak the memory pointed to by p on realloc fail. This commit (hopefully) fixes all these cases by moving to a standard idiom of : p = SMB_REALLOC(p, size) if (!p) { return error; } Where if the realloc returns null due to the realloc failing or size == 0 we *guarentee* that the storage pointed to by p has been freed. This allows me to remove a lot of code that was dealing with the standard (more verbose) method that required a tmp pointer. This is almost always what you want. When a realloc fails you never usually want the old memory, you want to free it and get into your error processing asap. For the 11 remaining cases where we really do need to keep the old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR, which can be used as follows : tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the pointer p, even on size == 0 or realloc fail. All this is done by a hidden extra argument to Realloc(), BOOL free_old_on_error which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR macros (and their array counterparts). It remains to be seen what this will do to our Coverity bug count :-). Jeremy. (This used to be commit 1d710d06a214f3f1740e80e0bffd6aab44aac2b0)
2007-10-10r5789: Patch from William Jojo <jojowil@hvcc.edu> - AIX has no default ACLs.Jeremy Allison1-0/+7
Bug #2445. Jeremy. (This used to be commit c9b5e32650ef957841d488416922b948804474e2)
2007-10-10r4305: Fix from Albert Chin (china@thewrittenword.com) to fix theJeremy Allison1-5/+5
earlier malloc changes. Jeremy. (This used to be commit da7ef2517162740bc61a81ae814d48348aa513d5)
2007-10-10r4291: More *alloc fixes inspired by Albert Chin (china@thewrittenword.com).Jeremy Allison1-31/+30
Jeremy (This used to be commit efc1b688cf9b1a17f1a6bf46d481280ed8bd0c46)