| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add set -x like we did for fix-gnustack (87ca5c5bbe63ea3c9227fdd4a01ccdc1ce723323)
for easier debugging when something fails.
- Use Bash tests everywhere given we're already using Bash.
- Use portable Bash shebang.
- Fix shellcheck nits.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix core.NonNullParamChecker with chdir().
Clang's scan-build says:
```
install-xattr.c:331:9: warning: Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker]
if (chdir(oldpwd) != 0)
^~~~~~~~~~~~~
```
It's right - oldpwd could easily have been null:
```
$ env -u OLDPWD __PORTAGE_HELPER_PATH=foo ./install-xattr --version
```
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
Clang doesn't create executable stacks by default, so we need to force it
for the purposes of the tests.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
Closes: https://github.com/gentoo/elfix/pull/3
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
Obsolete.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's another with strdup/malloc but it gets a bit messier
to fix so let's leave that for now (this is mostly about correctness
anyway, as the runtime of install-xattr is very small):
```
Direct leak of 4097 byte(s) in 1 object(s) allocated from:
#0 0x7f4a2c22e257 in __interceptor_malloc /usr/src/debug/sys-devel/gcc-13.0.0_pre20230101/gcc-13-20230101/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x7f4a2c1d2b40 in __interceptor_realpath /usr/src/debug/sys-devel/gcc-13.0.0_pre20230101/gcc-13-20230101/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:3904
#2 0x55da3adf5629 in realpath /usr/include/bits/stdlib.h:42
#3 0x55da3adf5629 in main /home/sam/git/elfix/misc/install-xattr/install-xattr.c:252
```
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
UBSAN reports:
```
install-xattr.c:124:16: runtime error: load of address 0x55555556d440 with insufficient space for an object of type 'char'
0x55555556d440: note: pointer points here
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 61 00 00 00
^
#0 0x555555557a27 in copyxattr /home/sam/git/elfix/misc/install-xattr/install-xattr.c:124
#1 0x555555556a4d in main /home/sam/git/elfix/misc/install-xattr/install-xattr.c:410
#2 0x7ffff77c864f (/usr/lib64/libc.so.6+0x2364f)
#3 0x7ffff77c8708 in __libc_start_main (/usr/lib64/libc.so.6+0x23708)
#4 0x555555557114 in _start (/home/sam/git/elfix/misc/install-xattr/install-xattr+0x3114)
```
Triggered with:
```
mkdir /tmp/a
touch /tmp/foo
./install-xattr -c /tmp/foo /tmp/foo2 /tmp/a
```
I don't see this with Clang or < GCC 12, but I do with GCC 13 (13.0.0_pre20230101 p5);
I suspect it's because of object-size improvements.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
It's hard to see why something failed otherwise, as we only have the
exit code.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
Needed to correctly run tests with Clang, as Clang doesn't create
executable stacks by default.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
Thanks chutzpah@gentoo.org
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|
|
|
|
| |
See: https://bugs.gentoo.org/699550
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|
|
| |
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|
|
| |
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|
|
| |
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|
|
| |
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|
|
|
|
| |
This addresses https://bugs.gentoo.org/672072
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|
|
| |
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
in libelf-dev
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Reported-by: Jory Pratt <anarchy@gentoo.org>
|
| |
|
|
|
|
| |
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
if the PORTAGE_XATTR_EXCLUDE variable contains whitespace other
than just ' ', the matching fails to exclude what comes after it.
This replaces all whitespace instead of only just space.
Signed-off-by: Jason Zaman <perfinion@gentoo.org>
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
When reading on a native system, read() transparently reads two
byte or four bytes in the correct byte order and returns the correct
value. But if you read() a word in a big endian file from a little
endian system or vice versa, you get the wrong value. We wrap
read() in read_endian() to compensate for this.
|
| |
|
| |
|
| |
|
| |
|
| |
|