Commit Graph

552 Commits

Author SHA1 Message Date
Mike Yuan
e9a46668c3 macro: rename VA_ARGS_FOREACH to FOREACH_ARGUMENT
"VA_ARGS" is kinda confusing, as the macro just iterates through
all arguments passed and has nothing to do with va_arg.
2024-01-24 21:21:57 +08:00
Antonio Alvarez Feijoo
5e16328506 analyze: clarify that security --offline=true requires an argument
Without `--root` or `--image`, the `security` command inspects all currently
loaded service units if no unit name is specified. But with `--root` or
`--image` with `--offline=true`, the `security` command exits silently if no
unit name is specified.

Also, fixed description of `--root` and `--image` in the man page, and added
missing `--unit` option to help text.
2024-01-11 12:19:20 +00:00
Antonio Alvarez Feijoo
ca02969379 analyze: man and --help fixes
man:
- `verify` requires an argument
- `security` does not require an argument
- `fdstore` requires an argument
- `image-policy` requires an argument

`--help` text:
- missing `image-policy` command
- `cat-config` requires NAME or PATH
2024-01-09 10:11:59 +01:00
Antonio Alvarez Feijoo
7c0e0bbb6b analyze: fix -q option
Follow-up to 52117f5af8
2024-01-09 09:05:50 +01:00
Mike Yuan
bdd2036e81 hexdecoct: make unbase64mem and unhexmem always use SIZE_MAX 2024-01-09 03:59:15 +09:00
Lennart Poettering
d4fee8941a confext: make sure we pick up configuration extensions passed to us from the stub
With fixes from Maanya Goenka.
2024-01-03 11:23:27 +01:00
Luca Boccassi
5df839e99f analyze: allow --no-legend with architectures verb
It prints a table with a header, allow omitting it

Follow-up for fb8cc599ed
2023-12-27 17:50:07 +01:00
Yu Watanabe
287a5f1cff Merge pull request #30628 from YHNdnzj/format-table-improvement
Some improvements for format-table
2023-12-25 20:01:32 +09:00
Mike Yuan
2413a0fab4 format-table: introduce table_isempty and use it where appropriate 2023-12-25 17:47:18 +08:00
Yu Watanabe
07e8c3055d tree-wide: drop several doubled space 2023-12-25 02:13:49 +09:00
Mike Yuan
c6195c9667 analyze-fdstore: don't log duplicate error
table_print_with_pager() logs print error internally.
2023-12-24 04:27:55 +08:00
Mike Yuan
9e710d2665 analyze-fdstore: ignore table header when checking stored fd count 2023-12-24 04:27:55 +08:00
Yu Watanabe
abf0ccc1c6 analyze-verify: verify all executables
ExecStart= and friends for .service and .socket can be specified
multiple times.
This also checks all commands for .mount and .swap, not only for the
current control command.
2023-12-20 23:56:16 +09:00
Frantisek Sumsal
3c4d0ec940 analyze: use strempty() 2023-12-18 17:25:10 +01:00
Yu Watanabe
6d9d556579 analyze: also find template unit when a template instance is specified
Fixes a regression caused by 2f6181ad4d.

Fixes #30357.

Co-authored-by: Jeff King <peff@peff.net>
2023-12-11 15:12:38 +09:00
Frantisek Sumsal
f57d06c308 analyze: dump system config files with highlighted sections/directives 2023-12-07 15:35:54 +01:00
Yu Watanabe
786a337817 Merge pull request #30060 from poettering/analyze-archs
analyze: add "archs" verb that lists all known architectures
2023-12-07 15:47:30 +09:00
Lennart Poettering
bf4ffc43c5 analyze: teach "exit-status" verb json output too 2023-12-06 22:18:14 +01:00
Lennart Poettering
81373a0e28 analyze: teach "capability" verb JSON output too 2023-12-06 22:18:14 +01:00
Lennart Poettering
fb8cc599ed analyze: add "architectures" verb that lists all known architectures 2023-12-06 22:18:14 +01:00
Zbigniew Jędrzejewski-Szmek
f9568765d4 variuos: fwrite() does not set errno
The man page doesn't even mention errno. It just says that ferror() should
be used to check for errors. Those writes are unlikely to fail, but if they
do, errno might even be 0. Also, we have fflush_and_check() which does
additional paranoia around errno, because we apparently do not trust that
errno will always be set correctly.
2023-12-05 19:18:23 +01:00
Yu Watanabe
33d11a2b69 analyze: return earlier when there is no path to be prepended
Follow-up for 2f6181ad4d.

Addresses the post-merge comment:
https://github.com/systemd/systemd/pull/30172#discussion_r1404209035
2023-11-25 12:52:59 +09:00
Yu Watanabe
2f6181ad4d analyze: do not prepend the current working directory to SYSTEMD_UNIT_PATH needlessly
If the requested unit is not in the current working directory, it is not
necessary to include the current working directory in SYSTEMD_UNIT_PATH.

Follow-up for 45519d13a4.

Fixes #30166.
2023-11-24 05:28:14 +09:00
Yu Watanabe
ff7af46edb analyze: set SYSTEMD_UNIT_PATH in verify_generate_path()
Then, rename verify_generate_path() -> verify_set_unit_path().
2023-11-24 05:20:13 +09:00
Yu Watanabe
c131e8b706 analyze: shorten code a bit
No functional change, just refactoring.
2023-11-24 05:19:14 +09:00