aboutsummaryrefslogtreecommitdiffstats
path: root/ports/linux/xattr
AgeCommit message (Collapse)Author
2021-01-08add arm64 versions for xattrross/attrRoss Burton
Signed-off-by: Ross Burton <ross.burton@arm.com>
2020-10-08ports/linux/xattr: Fix NULL pointer dereferenceRichard Purdie
In the xattr handling functions, if result is NULL, which it can be with the path ignore code, there is a NULL pointer dereference and segfault. Everywhere else checks result first, this appears to just be an omission. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-26xattr: Fixed corrupting UID&GID when running setfacl -m on a directoryJohannes Beisswenger
The file mode was accidentally overwritten with only the permission bits, causing the server to falsely assume that the database was corrupted (because the msg_header.mode did not contain S_IFDIR anymore) even though it was the client doing the corruption. In practice that had the effect of leaking the UID of the user, into the pseudo environment. This fixes Bug 13959 -- https://bugzilla.yoctoproject.org/show_bug.cgi?id=13959 Signed-off-by: Johannes Beisswenger <johannes.beisswenger@cetitec.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-26On a tumbleweed system, "install X Y" was showing the error:Richard Purdie
pseudo: ENOSYS for 'fsetxattr'. which was being caused by dlsym() for that function returning NULL. This appears to be due to it finding an unresolved symbol in libacl for this symbol in libattr. It hasn't been resolved so its NULL. dlerror() returns nothing since this is a valid symbol entry, its just not the one we want. We can add the glibc version string for the symbol we actually want so we get that version rather than the libattr/libacl one. To quote libattr: """ These dumb wrappers are for backwards compatibility only. Actual syscall wrappers are long gone to libc. """ and they are simply wrappers around the libc version so our attaching to the libc versions should intercept any accesses via these too. RP 2020/06/22 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org Upstream-Status: Pending [discussed with seebs on irc and appears the correct fix] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-26xattr: adjust for attr 2.4.48 releaseAlexander Kanavin
Latest versions of attr have removed the xattr.h header, with the rationale that libc is providing the same wrappers. attr/attributes.h is providing the ENOATTR definition. Upstream-Status: Pending Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-15Add SPDX-License-Identifier: LGPL-2.1-only to filesRichard Purdie
This adds SPDX license headers to all source files in pseudo so license identification models current best practise. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-30Recently (2015) coreutils cp -Rp changed its behavior such that chmod()Seebs
is followed by setxattr(); previously it was the other way around. This broke pseudo when a copied directory has one of the special bits (setuid, setgid, sticky) set; the special bit wound up getting removed. Root cause is that ACLs never included special bits in the first place, so we need to merge them back in ourselves. [YOCTO #12379] Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
2017-02-24Don't try to record 0-length posix_acl_default xattrsSeebs
Based on a submission from Anton Gerasimov <anton@advancedtelematic.com> On some systems, with some kernel configs, "cp -a" apparently tries to set an empty ACL list, with a valid header but no contents, which causes strange and mysterious behavior later if we actually create such an entry. So filter that out, also sanity-check a couple of other things. Signed-off-by: Seebs <seebs@seebs.net>
2015-08-20Initial profiling implementation.Peter Seebach
A partially-implemented profiler for client time, which basically just inserts (optional) gettimeofday calls in various places and stashes data in a flat file containing one data block per pid. Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
2014-07-10make xattr work on DarwinSeebs
More complicated, because we actually need to make com.apple stuff work probably.
2014-04-24Spell flag override correctly, rename flagsPeter Seebach
The "/* flags = AT_SYMLINK_NOFOLLOW */" comment only works if it comes AFTER the semicolon in wrapfuncs.in. Who knew? Fix those. Also rename the "flags" arguments for *setxattr() to "xflags" to avoid any confusion about the flags variable. Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
2014-04-22xattr support and other path stuff: reduce allocation and copyingPeter Seebach
The xattr first-pass implementation was allocating a buffer to hold the name and value for a set operation, then pseudo_client was allocating *another* buffer to hold the path and those two values. pseudo_client_op develops more nuanced argument handling, and also uses a static buffer for the extended paths it sometimes needs. So for the typical use case, only occasional operations will need to reallocate/expand the buffer, and we'll be down to copying things into that buffer once per operation, instead of having two alloc/free pairs and two copies. And of course, that wasn't two alloc/free pairs, it was one alloc/free pair and one alloc without a free. Whoops. Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
2014-04-21Extended attributes: Intercept posix_acl_accessPeter Seebach
In the fairly common case where someone is using setxattr() to specify the "posix_acl_access" attribute, but in fact the ACL list specified can be fully represented in a plain old mode, we intercept the request and just do a chmod. Even if the request can't be fully represented, we try to represent any aspects of it that we can in the plain old mode. Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
2014-04-21Initial draft xattr supportPeter Seebach
Initial, incomplete, support for extended attributes. Extended attributes are implemented fairly naively, using a second table in the file database using the primary file table's id as a foreign key. The ON DELETE CASCADE behavior requires sqlite 3.6.19 or later with foreign key and trigger support compiled in. To reduce round-trips, the client does not check for existing attributes, but rather, sends three distinct set messages; OP_SET_XATTR, OP_CREATE_XATTR, OP_REPLACE_XATTR. A SET message always succeeds, a CREATE fails if the attribute already exists, and a REPLACE fails if the attribute does not already exist. The /* flags */ feature of makewrappers is used to correct path names appropriately, so all functions are already working with complete paths, and can always use functions that work on links; if they were supposed to dereference, the path fixup code got that. The xattr support is enabled, for now, conditional on whether getfattr --help succeeds. Not yet implemented: Translation for system.posix_acl_access, which is used by "cp -a" (or "cp --preserve-all") on some systems to try to copy modes. Signed-off-by: Peter Seebach <peter.seebach@windriver.com>