summaryrefslogtreecommitdiff
path: root/lib/replace/xattr.c
AgeCommit message (Collapse)AuthorFilesLines
2023-04-14lib:replace: Fix code spellingAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-04-14lib:replace: Remove trailing white spaces in xattr.cAndreas Schneider1-4/+4
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-04-11lib:replace: Fix code spellingAndreas Schneider1-1/+1
Best reviewed with: `git show --word-diff`. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-01-02lib/replace - add extra check to bsd_attr_listAndrew Walker1-0/+12
The FreeBSD extattr API may return success and truncated namelist. We need to check for this in bsd_attr_list to ensure that we don't accidentally read off the end of the buffer. In the case of a truncated value, the pascal strings for attr names will reflect the lengths as if the value were not truncated. For example: `58DosStrea` In case of short read we now set error to ERANGE and fail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15271 Signed-off-by: Andrew Walker <awalker@ixsystems.com> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Mon Jan 2 14:27:23 UTC 2023 on sn-devel-184
2022-08-04lib: Align an integer typeVolker Lendecke1-1/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-10-31lib/replace/xattr.c: typo fixesBjörn Jacke1-8/+8
Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
2019-08-29replace/setxattr: correctly use our flags on DarwinBjörn Jacke1-4/+2
Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Björn Jacke <bjacke@samba.org> Autobuild-Date(master): Thu Aug 29 17:10:32 UTC 2019 on sn-devel-184
2019-08-29xattr/setxattr: fix flag support on AIXBjörn Jacke1-2/+30
AIX requires the flags to be 0, we need to do those checks manually. Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-08-29replace/setxattr: set reasonable and unified errno value in case the EA ↵Björn Jacke1-13/+41
value was too big FreeBSD and AIX already set errno to ENAMETOOLONG, this is what we should map other platforms also to to finally map to the correct NT error code also. Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-07-03build: bundle and reduce huge number of EA function testsBjörn Jacke1-40/+34
It's sufficient to check for one basic function of an EA implementation and a use a single ifdef for each group of EA functions. This makes more sense than checking for each EA function on each platform. Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Jul 3 13:24:51 CEST 2018 on sn-devel-144
2017-02-10lib/replace: validate xattr namespace prefix on FreeBSDRalph Boehme1-24/+81
We should validate the xattr name string ensuring it either begins with "sytem." or "user.". If it doesn't, we should fail the request with EINVAL. The FreeBSD xattr API uses namespaces but doesn't put the namespace name as a string prefix at the beginning of the xattr name. It gets passed as an additional int arg instead. On the other hand, our libreplace xattr API expects the caller to put a namespace prefix into the xattr name. Unfortunately the conversion and stripping of the namespace string prefix from the xattr name gives the following unexpected result on FreeBSD: rep_setxattr("foo.bar", ...) => xattr with name "bar" The code checks if the name begins with "system.", if it doesn't find it, it defaults to the user namespace and then does a strchr(name, '.') which skips *any* leading string before the first dot. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12490 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-21replace: Fix developer build on BSD.Andreas Schneider1-0/+1
This fixes bsd_attr_list() calling geteuid(). Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Nov 21 03:37:59 CET 2013 on sn-devel-104
2013-11-08xattr: fix listing EAs on *BSD for non-root usersBjörn Jacke1-0/+4
Thanks to Stefan Rompf for reporting. This fixes bug #10247 Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Nov 8 20:43:30 CET 2013 on sn-devel-104
2012-10-28lib/replace: Return size of xattr if size argument is 0Andrew Bartlett1-3/+12
This makes rep_{f,}getxattr a more complete replacement for the linux function. Andrew Bartlett
2012-06-16attr: Look for attr/attributes.h too.Jelmer Vernooij1-1/+1
Fixes finding of ATTR_ROOT on GNU/kFreeBSD. Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Sat Jun 16 18:54:27 CEST 2012 on sn-devel-104
2012-06-05libreplace: Add copyrights to ease tracking of this file in futureAndrew Bartlett1-0/+2
As GIT didn't realise this was a copy out of lib/system.c, this should make it easier to track the copyright holders on this file. Herb's name wasn't on the original file, but was the only other author I could find in the git logs. I've added my copyright here too. Andrew Bartlett
2012-06-03libreplace: Fix up MacOS xattr functionsAndrew Bartlett1-0/+18
We need undo the rep_ macro to call the real OS function. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Sun Jun 3 06:21:21 CEST 2012 on sn-devel-104
2012-06-03libreplace: Use true rather than True in xattr.cAndrew Bartlett1-2/+2
This should fix the build on IRIX. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Sun Jun 3 02:05:35 CEST 2012 on sn-devel-104
2012-06-02libreplace: Solaris needs system/dir.h for that xattr wrapper implementationAndrew Bartlett1-0/+1
2012-06-02lib/replace: Relicence xattr.c to LGPLv3Andrew Bartlett1-11/+14
By the kind consent of the copyright holders. (There wasn't any code from tridge in the code brought in from source3/lib/system.c). Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Sat Jun 2 04:00:42 CEST 2012 on sn-devel-104
2012-06-02lib/replace: Merge remaining xattr test details from lib/utilAndrew Bartlett1-8/+8
I prefer the longer XATTR_ADDITIONAL_OPTIONS define and the NULL rather than 0 values in the getxattr test. Andrew Bartlett
2012-06-02lib/replace: We cannot use strchr_m in lib/replaceAndrew Bartlett1-6/+6
In any case, it is always safe to search for . even in a multibyte string. Andrew Bartlett
2012-06-02lib/replace: DEBUG is not acceptable here, as this may not be linked into SambaAndrew Bartlett1-7/+0
2012-06-02lib/replace: Copy lib/system.c xattr wrappers to lib/replaceAndrew Bartlett1-0/+703