aboutsummaryrefslogtreecommitdiffstats
path: root/include/debug.h
AgeCommit message (Collapse)AuthorFilesLines
2025-05-20treewide: improve getauxval(AT_SECURE) usageKarel Zak1-2/+3
Let's enhance portability and readability slightly. Signed-off-by: Karel Zak <kzak@redhat.com>
2025-05-10lib/env, ...: use getauxval(AT_SECURE) for SUID checkMax Kellermann1-1/+2
Comparing effective and real uid/gid is not a proper way to check for SUID execution: 1. this does not consider file capabilities 2. this check breaks when NO_NEW_PRIVS is used as the Linux kernel resets effective ids during execve(); this means the check is false, but the process still has raised capabilities For more details about the NO_NEW_PRIVS problem, check this post and the surrounding thread: https://lore.kernel.org/lkml/20250509184105.840928-1-max.kellermann@ionos.com/ Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
2025-02-04include/debug: Relicense to Public DomainKarel Zak1-7/+2
After reaching an agreement with Ondrej Oprala, we have decided to change the license of debug.h and debugobj.h from LGPL to Public Domain. This change is more suitable for the files in the include/ directory of util-linux. CC: Ondrej Oprala <ondrej.oprala@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2023-01-12include: add missing license linesKarel Zak1-0/+2
The header files are usually based on code from lib/. This commit copies relevant license headers from lib/ to include/ to keep things consistent. The very generic things (e.g. MBR definitions) are always public domain. Fixes: https://github.com/util-linux/util-linux/issues/2010 Signed-off-by: Karel Zak <kzak@redhat.com>
2023-01-03libmount: add optlist testsKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-17include/debug: introduce __UL_INIT_DEBUG_FROM_STRING()Karel Zak1-7/+12
Let's make it possible to use debug.h without environment variables. Suggested-by: J William Piggott <elseifthen@gmx.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-12include/debug: improve debug messageKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-12include/debug: print info when addresses suppressedKarel Zak1-1/+3
Suggested-by: Peter Cordes <peter@cordes.ca> Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-12include/debug: don't print pointer address for SUID programsKarel Zak1-16/+11
* introduce new flag __UL_DEBUG_FL_NOADDR to suppress pointer address printing * use __UL_DEBUG_FL_NOADDR when SUID * move ul_debugobj() to debugobj.h, and require UL_DEBUG_CURRENT_MASK to provide access to the current mask from ul_debugobj(). It's better than modify all ul_debugobj() calls and use the global mask as argument. * remove never used UL_DEBUG_DEFINE_FLAG Reported-by: halfdog <me@halfdog.net> Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-21debug: use const void * for ul_debugobj()Igor Gnatenko1-1/+1
We don't modify data it's pointing out and we should not modify it. Also remove casting to void * as gcc will do it automatically (before we had to cast it explicitly to avoid warning on discarding 'const' qualifier). Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-05-31misc: Fix various typosSebastian Rasmussen1-1/+1
Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
2014-11-03include/debug: improve and cleanupKarel Zak1-17/+70
* use ul_debug_ prefix for all routines * support <NAME>_DEBUG=all also for programs without debug mask names (so we can avoid 0xffff mask in man pages) * add function to print debug help Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-24include/debug: fix typoKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-23whereis: cleanup debug stuff, fix argv[] usageKarel Zak1-1/+1
* use debug stuff from include/debug.h and make whereis(1) sensitive to WHEREIS_DEBUG=0xffff mask * fix problem with argv[] usage # whereis -b -m -M /usr/share/man/man1 -B /usr/bin -f gcc bin: /usr/local/bin gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz the code ignores "-B" and /usr/bin is interpreted as search pattern, expected result is: # whereis -b -m -M /usr/share/man/man1 -B /usr/bin -f gcc gcc: /usr/share/man/man1/gcc.1.gz /usr/bin/gcc Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765306 Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-01include/debug: remove duplicate 'const' declaration warningSami Kerola1-1/+1
./include/debug.h:89:55: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-08-13include/debug: allow to speficy empty masknamesKarel Zak1-1/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13include/debug: cleanup masksKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13include/debug: make masknames optionalKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13libs/debug: accept human readable names for _DEBUG=Ondrej Oprala1-1/+41
For example $ LIBMOUNT_DEBUG=tab,cache findmnt to debug only TAB and CACHE subsystem. Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-21include/debug: add another debug macrosKarel Zak1-1/+17
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-21include/debug: fix coding styleKarel Zak1-21/+22
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-13clean up redundant macros and definesOndrej Oprala1-8/+0
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-03-13libcommon: don't mention lib versions in debug macrosOndrej Oprala1-3/+0
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-03-12libcommon: define more debugging macrosOndrej Oprala1-0/+7
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-03-12libcommon: add common debugging routinesOndrej Oprala1-0/+70
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>