Commit Graph

7 Commits

Author SHA1 Message Date
Sam James
c80d6bb2ed checkpath: missing includes from IWYU 2023-01-29 11:32:22 -06:00
Mike Frysinger
6f44445958 checkpath: add missing sticky/set*id mode bits to check
We incorrectly masked out the upper 3 bits when checking to see if the
permissions need updating leading us to run chmod when not needed.

Fixes #482.
2023-01-15 15:31:25 -05:00
Mike Frysinger
b778c72f81 checkpath: fix initial dirfd opening
dirfd is uninitialized at this point, and even if it were, it doesn't
make sense to use since the path is "/" -- the dirfd is ignored when
the path is absolute.  Switch to AT_FDCWD to avoid all that.
2023-01-15 15:17:18 -05:00
Sam James
e82baa17ca checkpath: fix memory leak
```
=================================================================
==22862==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 4096 byte(s) in 1 object(s) allocated from:
    #0 0x7f1fd5b12cb7 in __interceptor_malloc /usr/src/debug/sys-devel/gcc-11.2.1_p20220312/gcc-11-20220312/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x55556abecea7 in xmalloc ../src/includes/helpers.h:64
    #2 0x55556abecea7 in xasprintf ../src/includes/helpers.h:149
    #3 0x55556abeb6fb in do_check ../src/rc/checkpath.c:206
    #4 0x55556abeb6fb in main ../src/rc/checkpath.c:443
    #5 0x7f1fd58576cf in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

SUMMARY: AddressSanitizer: 4096 byte(s) leaked in 1 allocation(s).
```

Signed-off-by: Sam James <sam@gentoo.org>
2022-05-08 14:56:26 -05:00
Sam James
adc1e33f7e checkpath: fix memory leak
```
Direct leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x7f49539534a7 in __interceptor_strdup /usr/src/debug/sys-devel/gcc-11.2.1_p20220312/gcc-11-20220312/libsanitizer/asan/asan_interceptors.cpp:454
    #1 0x55d76fa66867 in xstrdup ../src/includes/helpers.h:91
    #2 0x55d76fa66867 in get_dirfd ../src/rc/checkpath.c:111
    #3 0x55d76fa66867 in do_check ../src/rc/checkpath.c:206
    #4 0x55d76fa66867 in main ../src/rc/checkpath.c:442
    #5 0x7f49536f06cf in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
```

Signed-off-by: Sam James <sam@gentoo.org>
2022-05-08 14:56:26 -05:00
Josh Soref
3054046e18 multiple spelling and typo fixes
This fixes #516.
2022-04-30 21:32:32 -05:00
William Hubbs
391d12db48 migrate fully to meson build system
- drop old build system
- move shared include and source files to common directory
- drop "rc-" prefix from shared include and source files
- move executable-specific code to individual directories under src
- adjust top-level .gitignore file for new build system

This closes #489.
2022-04-06 10:51:55 -05:00