summaryrefslogtreecommitdiff
path: root/src/machine
Commit message (Collapse)AuthorAgeFilesLines
* machine,portable: fix a typo in an info messageFrantisek Sumsal2023-05-131-1/+1
|
* machine: fix a memory leak when showing multiple machinesFrantisek Sumsal2023-05-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + machinectl status long-running long-running long-running ================================================================= ==986==ERROR: LeakSanitizer: detected memory leaks Direct leak of 1568 byte(s) in 2 object(s) allocated from: #0 0x7fe57caba097 in calloc (/lib64/libasan.so.8+0xba097) #1 0x7fe57b891e8e in message_from_header ../src/libsystemd/sd-bus/bus-message.c:372 #2 0x7fe57b892dfd in bus_message_from_malloc ../src/libsystemd/sd-bus/bus-message.c:421 #3 0x7fe57b9089a8 in bus_socket_make_message ../src/libsystemd/sd-bus/bus-socket.c:1165 #4 0x7fe57b90affe in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1294 #5 0x7fe57b92db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082 #6 0x7fe57b933352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483 #7 0x7fe57b84da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183 #8 0x7fe57b2789e8 in bus_call_method ../src/shared/bus-locator.c:109 #9 0x40f71c in show_machine ../src/machine/machinectl.c:713 #10 0x7fe57b65c8cf in dispatch_verb ../src/shared/verbs.c:103 #11 0x42e9ce in machinectl_main ../src/machine/machinectl.c:2980 #12 0x42ebf9 in run ../src/machine/machinectl.c:3005 #13 0x42ed1f in main ../src/machine/machinectl.c:3008 #14 0x7fe579e4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) Indirect leak of 234 byte(s) in 2 object(s) allocated from: #0 0x7fe57cab95b5 in __interceptor_realloc.part.0 (/lib64/libasan.so.8+0xb95b5) #1 0x7fe57b909822 in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1214 #2 0x7fe57b92db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082 #3 0x7fe57b933352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483 #4 0x7fe57b84da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183 #5 0x7fe57b2789e8 in bus_call_method ../src/shared/bus-locator.c:109 #6 0x40f71c in show_machine ../src/machine/machinectl.c:713 #7 0x7fe57b65c8cf in dispatch_verb ../src/shared/verbs.c:103 #8 0x42e9ce in machinectl_main ../src/machine/machinectl.c:2980 #9 0x42ebf9 in run ../src/machine/machinectl.c:3005 #10 0x42ed1f in main ../src/machine/machinectl.c:3008 #11 0x7fe579e4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) Indirect leak of 4 byte(s) in 2 object(s) allocated from: #0 0x7fe57ca7243b in strdup (/lib64/libasan.so.8+0x7243b) #1 0x7fe57b8c1543 in message_parse_fields ../src/libsystemd/sd-bus/bus-message.c:4125 #2 0x7fe57b893586 in bus_message_from_malloc ../src/libsystemd/sd-bus/bus-message.c:443 #3 0x7fe57b9089a8 in bus_socket_make_message ../src/libsystemd/sd-bus/bus-socket.c:1165 #4 0x7fe57b90affe in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1294 #5 0x7fe57b92db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082 #6 0x7fe57b933352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483 #7 0x7fe57b84da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183 #8 0x7fe57b2789e8 in bus_call_method ../src/shared/bus-locator.c:109 #9 0x40f71c in show_machine ../src/machine/machinectl.c:713 #10 0x7fe57b65c8cf in dispatch_verb ../src/shared/verbs.c:103 #11 0x42e9ce in machinectl_main ../src/machine/machinectl.c:2980 #12 0x42ebf9 in run ../src/machine/machinectl.c:3005 #13 0x42ed1f in main ../src/machine/machinectl.c:3008 #14 0x7fe579e4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) SUMMARY: AddressSanitizer: 1806 byte(s) leaked in 6 allocation(s).
* machine: fix a memory leak when showing multiple imagesFrantisek Sumsal2023-05-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + machinectl image-status container1 container1 container0 container1 container2 container3 container4 ================================================================= ==1354==ERROR: LeakSanitizer: detected memory leaks Direct leak of 4704 byte(s) in 6 object(s) allocated from: #0 0x7fc3670ba097 in calloc (/lib64/libasan.so.8+0xba097) #1 0x7fc365e91e8e in message_from_header ../src/libsystemd/sd-bus/bus-message.c:372 #2 0x7fc365e92dfd in bus_message_from_malloc ../src/libsystemd/sd-bus/bus-message.c:421 #3 0x7fc365f089a8 in bus_socket_make_message ../src/libsystemd/sd-bus/bus-socket.c:1165 #4 0x7fc365f0affe in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1294 #5 0x7fc365f2db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082 #6 0x7fc365f33352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483 #7 0x7fc365e4da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183 #8 0x7fc3658789e8 in bus_call_method ../src/shared/bus-locator.c:109 #9 0x413b76 in show_image ../src/machine/machinectl.c:1014 #10 0x7fc365c5c8cf in dispatch_verb ../src/shared/verbs.c:103 #11 0x42e992 in machinectl_main ../src/machine/machinectl.c:2981 #12 0x42ebbd in run ../src/machine/machinectl.c:3006 #13 0x42ece3 in main ../src/machine/machinectl.c:3009 #14 0x7fc36444a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) Indirect leak of 666 byte(s) in 6 object(s) allocated from: #0 0x7fc3670b95b5 in __interceptor_realloc.part.0 (/lib64/libasan.so.8+0xb95b5) #1 0x7fc365f09822 in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1214 #2 0x7fc365f2db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082 #3 0x7fc365f33352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483 #4 0x7fc365e4da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183 #5 0x7fc3658789e8 in bus_call_method ../src/shared/bus-locator.c:109 #6 0x413b76 in show_image ../src/machine/machinectl.c:1014 #7 0x7fc365c5c8cf in dispatch_verb ../src/shared/verbs.c:103 #8 0x42e992 in machinectl_main ../src/machine/machinectl.c:2981 #9 0x42ebbd in run ../src/machine/machinectl.c:3006 #10 0x42ece3 in main ../src/machine/machinectl.c:3009 #11 0x7fc36444a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) Indirect leak of 12 byte(s) in 6 object(s) allocated from: #0 0x7fc36707243b in strdup (/lib64/libasan.so.8+0x7243b) #1 0x7fc365ec1543 in message_parse_fields ../src/libsystemd/sd-bus/bus-message.c:4125 #2 0x7fc365e93586 in bus_message_from_malloc ../src/libsystemd/sd-bus/bus-message.c:443 #3 0x7fc365f089a8 in bus_socket_make_message ../src/libsystemd/sd-bus/bus-socket.c:1165 #4 0x7fc365f0affe in bus_socket_read_message ../src/libsystemd/sd-bus/bus-socket.c:1294 #5 0x7fc365f2db71 in bus_read_message ../src/libsystemd/sd-bus/sd-bus.c:2082 #6 0x7fc365f33352 in sd_bus_call ../src/libsystemd/sd-bus/sd-bus.c:2483 #7 0x7fc365e4da61 in sd_bus_call_methodv ../src/libsystemd/sd-bus/bus-convenience.c:183 #8 0x7fc3658789e8 in bus_call_method ../src/shared/bus-locator.c:109 #9 0x413b76 in show_image ../src/machine/machinectl.c:1014 #10 0x7fc365c5c8cf in dispatch_verb ../src/shared/verbs.c:103 #11 0x42e992 in machinectl_main ../src/machine/machinectl.c:2981 #12 0x42ebbd in run ../src/machine/machinectl.c:3006 #13 0x42ece3 in main ../src/machine/machinectl.c:3009 #14 0x7fc36444a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f) SUMMARY: AddressSanitizer: 5382 byte(s) leaked in 18 allocation(s).
* Merge pull request #25608 from poettering/dissect-moarLennart Poettering2023-04-121-4/+4
|\ | | | | dissect: add dissection policies
| * tree-wide: hook up image dissection policy logic everywhereLennart Poettering2023-04-051-4/+4
| |
* | tree-wide: drop unneeded output paramsDavid Tardon2023-04-121-5/+1
| | | | | | | | | | | | Neither of the callers of bus_deserialize_and_dump_unit_file_changes() touches the changes array, so let's simplify things and keep it internal to the function.
* | Merge pull request #27033 from dtardon/array-cleanupYu Watanabe2023-04-121-26/+21
|\ \ | | | | | | Use CLEANUP_ARRAY more
| * | machinectl: do not repeat the same comparisonDavid Tardon2023-04-111-6/+8
| | |
| * | machinectl: drop unneeded elseDavid Tardon2023-04-111-2/+2
| | |
| * | machinectl: use CLEANUP_ARRAYDavid Tardon2023-04-111-19/+12
| |/
* | Merge pull request #27174 from YHNdnzj/edit-util-fixletsYu Watanabe2023-04-081-3/+1
|\ \ | | | | | | edit-util: several improvements
| * | edit-util: introduce overwrite_with_origin switchMike Yuan2023-04-071-3/+1
| |/ | | | | | | | | | | | | Before this commit, if `original_path` is given, it will always be used to overwrite `path`. After this commit, it's controlled by the newly-added switch `overwrite_with_origin`.
* | tree-wide: reset optind to 0 when GNU extensions in optstring are usedYu Watanabe2023-03-291-0/+4
|/ | | | | | | | | | Otherwise, if getopt() and friends are used before parse_argv(), then the GNU extensions may be ignored. This should not change any behavior at least now, as we usually use getopt_long() only once per invocation. But in the next commit, getopt_long() will be used for other arrays, hence this change will become necessary.
* machinectl: add verb edit and cat to operate on .nspawn filesMike Yuan2023-03-151-4/+166
| | | | | | This allows operating on .nspawn files using machinectl. Closes #26246
* Merge pull request #26641 from medhefgo/boot-elf2efiYu Watanabe2023-03-111-1/+2
|\ | | | | boot: Drop gnu-efi / Add elf2efi.py
| * meson: Introduce userspace depJan Janssen2023-03-101-1/+2
| | | | | | | | This will help in a later commit to separate userspace from EFI builds.
* | basic: add RuntimeScope enumLennart Poettering2023-03-102-2/+2
|/ | | | | | | | | | | | In various tools and services we have a per-system and per-user concept. So far we sometimes used a boolean indicating whether we are in system mode, or a reversed boolean indicating whether we are in user mode, or the LookupScope enum used by the lookup path logic. Let's address that, in introduce a common enum for this, we can use all across the board. This is mostly just search/replace, no actual code changes.
* machined: add support for memory pressure + SIGRTMIN+18Lennart Poettering2023-03-011-1/+11
|
* tree-wide: use unlink_and_freep() moreoverLennart Poettering2023-02-231-4/+4
|
* meson: Use dicts for test definitionsJan Janssen2023-02-211-4/+8
| | | | | | | Although this slightly more verbose it makes it much easier to reason about. The code that produces the tests heavily benefits from this. Test lists are also now sorted by test name.
* meson: Do not include headers in source listsJan Janssen2023-01-241-6/+0
| | | | | | Meson+ninja+compiler do this for us and are better at it. https://mesonbuild.com/FAQ.html#do-i-need-to-add-my-headers-to-the-sources-list-like-in-autotools
* machinectl: add --now to start/stop containers when enabling/disablingMike Yuan2023-01-241-2/+30
| | | | Closes #26154
* machinectl: remove unnecessary initializationMike Yuan2023-01-241-1/+1
|
* machinectl: also enable machines.target when enabling machinesMike Yuan2023-01-241-0/+6
| | | | | | It's mostly desired to enable machines.target along with the machine since only when both are enabled it would really work.
* machined: pass shell command line to polkitLudwig Nussel2022-12-291-0/+5
| | | | | | | Pass the joined arguments to polkit as command_line property like pkexec does. Obviously not exactly perfect as it lacks quoting. Good enough for polkit rules to check whether a program was called with or without arguments though.
* tree-wide: use -EBADF moreYu Watanabe2022-12-211-3/+3
|
* tree-wide: introduce PIPE_EBADF macroYu Watanabe2022-12-203-7/+7
|
* tree-wide: use -EBADF also in pipe initializersZbigniew Jędrzejewski-Szmek2022-12-193-7/+7
| | | | In some places, initialization is dropped when unnecesary.
* tree-wide: use -EBADF for fd initializationZbigniew Jędrzejewski-Szmek2022-12-195-21/+21
| | | | | | | | | | | | | | | | -1 was used everywhere, but -EBADF or -EBADFD started being used in various places. Let's make things consistent in the new style. Note that there are two candidates: EBADF 9 Bad file descriptor EBADFD 77 File descriptor in bad state Since we're initializating the fd, we're just assigning a value that means "no fd yet", so it's just a bad file descriptor, and the first errno fits better. If instead we had a valid file descriptor that became invalid because of some operation or state change, the other errno would fit better. In some places, initialization is dropped if unnecessary.
* machine: propagate error from machine_newDavid Tardon2022-12-144-14/+19
|
* machine: use _cleanup_ in machine_newDavid Tardon2022-12-141-10/+7
|
* import: wire up SYSTEMD_IMPORT_BTRFS_{SUBVOL,QUOTA} to importdIvan Shapovalov2022-12-031-1/+1
| | | | | | | | | | | Btrfs quotas are actually being enabled in systemd-importd via setup_machine_directory(), not in systemd-{import,pull} where those environment variables are checked. Therefore, also check them in systemd-importd and avoid enabling quotas if requested by the user. Fixes: #18421 Fixes: #15903 Fixes: #24387
* nulstr-util: Declare NULSTR_FOREACH() iterator inlineDaan De Meyer2022-11-111-1/+1
|
* copy: Support passing a deny list of files/directories to not copyDaan De Meyer2022-11-101-2/+2
|
* Rename def.h to constants.hZbigniew Jędrzejewski-Szmek2022-11-081-1/+1
| | | | | | The name "def.h" originates from before the rule of "no needless abbreviations" was established. Let's rename the file to clarify that it contains a collection of various semi-related constants.
* basic: rename util.h to logarithm.hZbigniew Jędrzejewski-Szmek2022-11-081-1/+0
| | | | | util.h is now about logarithms only, so we can rename it. Many files included util.h for no apparent reason… Those includes are dropped.
* basic: move version() to build.h+cZbigniew Jędrzejewski-Szmek2022-11-081-0/+1
|
* machinectl: allow --max-addresses=0Zbigniew Jędrzejewski-Szmek2022-10-201-21/+16
| | | | Sometimes the addresses are not important, so allow skipping them in output.
* shared/install: rename UnitFileChange to InstallChangeZbigniew Jędrzejewski-Szmek2022-10-131-2/+2
| | | | | It's shorter and more generic. The struct can contain info about changes to unit files, but also symlinks and errors.
* Merge pull request #24686 from d4nuu8/delta_outputLennart Poettering2022-09-231-2/+2
|\ | | | | shared/logs-show: add new --output= format "short-delta"
| * shared/logs-show: add new --output= format "short-delta"Daniel Braunwarth2022-09-231-2/+2
| | | | | | | | | | | | | | This new output formatting option is similar to "short-monotonic" but also shows the time delta between two messages. This fixes #24641.
* | shared/format-table: use enum instead of Table.empty_stringZbigniew Jędrzejewski-Szmek2022-09-221-1/+1
|/ | | | | | | | | | | | All users were setting this to some static string (usually "-"), so let's simplify things by not doing strdup, but instead limiting callers to a fixed set of values. In preparation for the next commit, the function is renamed from "empty" to "replacement", because it'll be used for more than empty fields. I didn't do the whole string-table setup, because it's all used internally in one file and this way we can immediately assert if an invalid value is passed in. Some callers were (void)ing the error, others were ignoring it, and others propagating. It's nicer to remove the boilerplate.
* tree-wide: use ASSERT_PTR moreDavid Tardon2022-09-136-138/+57
|
* tree-wide: change --kill-who to --kill-whomZbigniew Jędrzejewski-Szmek2022-08-261-11/+11
| | | | | | | | | | | getopt allows non-ambiguous abbreviations, so backwards-compat is maintained, and people can use --kill-who (or even shorter abbreviations). English is flexible, so in common speach people would use both forms, even if "whom" is technically more correct. The advantage of using the longer form in the code is that we effectively allow both forms, so we stop punishing people who DTGCT¹, but still allow people to use the spoken form if they prefer. 1. Do the gramatically correct thing
* tree-wide: port things dirname_malloc() → path_extract_directory()Lennart Poettering2022-08-231-14/+10
|
* machine: drop an unused variableFrantisek Sumsal2022-08-201-4/+2
|
* machinectl: Add plumbing for a `--force` flag for file copyAlexander Wilson2022-07-274-1/+54
| | | | | | machine: Add APIs CopyTo[Machine]WithFlags + CopyFrom[Machine]WithFlags - Same API to those without `WithFlags` (except this can take flags) - Initially, only a flag to allow replacing a file if it already exists
* machine: switch to BusLocator-oriented helpersQuentin Deslandes2022-07-052-24/+7
| | | | Replace existing sd_bus_x calls with counterparts from bus-locator.h.
* Use https for freedesktop.orgMichael Biebl2022-06-282-2/+2
| | | | grep -l -r http:// | xargs sed -E -i s'#http://(.*).freedesktop.org#https://\1.freedesktop.org#'
* Merge pull request #23616 from keszybz/in-addr-to-string-formattingYu Watanabe2022-06-091-7/+2
|\ | | | | Add macros that allocate a fixed buffer for in_addr_to_string(), in_addr_prefix+to_string()