summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-03-17basic/missing: move syscall definitions to basic/missing_syscall.hZbigniew Jędrzejewski-Szmek
We have a bunch of syscall wrapper definitions and it's easier to see that they follow the same pattern if they are not interspersed with other defines. Change the wrappers to be uniform: - if __NR_XXX is not defined, do not bother to call the syscall, and return -1/ENOSYS immediately. - do not check __NR_XXX defines if we detect the symbol as defined, since we don't need them anyway - reindent stuff for readability New file basic/missing_syscall.h is included at the end of missing.h because it might make use of some of the definitions in missing.h.
2016-03-17basic/copy: use copy_file_range()Zbigniew Jędrzejewski-Szmek
For btrfs, c_f_r() is like BTRFS_IOC_CLONE which we already used, but also works when max_bytes is set. We do call copy_bytes in coredump code with max_bytes set, and for large files, so we might see some benefit from using c_f_r() on btrfs. For other filesystems, c_f_r() falls back to do_splice_direct(), the same as sendfile, which we already call, so there shouldn't be much difference. Tested with test-copy and systemd-coredump on Linux 4.3 (w/o c_f_r) and 4.5 (w/ c_f_r).
2016-03-17basic/missing: add copy_file_rangeZbigniew Jędrzejewski-Szmek
syscall numbers based on: https://fedora.juszkiewicz.com.pl/syscalls.html
2016-03-15test-copy: test with different max_bytes valuesZbigniew Jędrzejewski-Szmek
2016-03-15basic/copy: use sendfile smarterZbigniew Jędrzejewski-Szmek
We called sendfile with 16kb (a.k.a. COPY_BUFFER_SIZE) as the maximum number of bytes to copy. This seems rather inefficient, especially with large files. Instead, call sendfile with a "large" maximum. What "large" max means is a bit tricky: current file offset + max must fit in loff_t. This means that as we call sendfile more than once, we have to lower the max size. With this patch, test-copy calls sendfile twice, e.g.: sendfile(4, 3, NULL, 9223372036854775807) = 738760 sendfile(4, 3, NULL, 9223372036854037047) = 0 The second call is necessary to determine EOF.
2016-03-15test-copy: add a test shuffling bytes between normal filesZbigniew Jędrzejewski-Szmek
I started looking into adding copy_file_range support, and discovered that we can improve the way we call sendfile: - sendfile(2) man page is missing an important bit: the number of bytes to copy cannot be too big (SSIZE_MAX actually), and the description of EINVAL return code does not mention this either, - our implementation works but calls sendfile over and over with a small size, which seems suboptimal. First add a test which (under strace) can be used to see current behaviour.
2016-03-14Merge pull request #2735 from evverx/fix-2730Zbigniew Jędrzejewski-Szmek
Add test for -.mount with Alias=root.mount, bug #2730.
2016-03-14Merge pull request #2834 from coling/masterZbigniew Jędrzejewski-Szmek
2016-03-14Merge pull request #2832 from evverx/fix-mkfs-btrfs-checkingZbigniew Jędrzejewski-Szmek
Fix mkfs.btrfs checking
2016-03-14Merge pull request #2835 from tklauser/man-spellingZbigniew Jędrzejewski-Szmek
man: network - Fix misspelling of "router advertisement"
2016-03-14man: network - Fix misspelling of "router advertisement"Tobias Klauser
2016-03-14device: Ensure we have sysfs path before comparing.Colin Guthrie
In some cases we do not have a udev device when setting up a unit (certainly the code gracefully handles this). However, we do then go on to compare the path via path_equal which will assert if a null value is passed in. See https://bugs.mageia.org/show_bug.cgi?id=17766 Not sure if this is the correct fix, but it avoids the crash
2016-03-14shared/machine-pool: fix another mkfs.btrfs checkingEvgeny Vereshchagin
Fixes: Message: Process 806 (systemd-importd) of user 0 dumped core. Stack trace of thread 806: #0 0x00007f5eaeff7227 raise (libc.so.6) #1 0x00007f5eaeff8e8a abort (libc.so.6) #2 0x000055b6d3418f4f log_assert_failed (systemd-importd) #3 0x000055b6d3409daf safe_close (systemd-importd) #4 0x000055b6d33c25ea closep (systemd-importd) #5 0x000055b6d33c38d9 setup_machine_directory (systemd-importd) #6 0x000055b6d33b8536 method_pull_tar_or_raw (systemd-importd) #7 0x000055b6d33ed097 method_callbacks_run (systemd-importd) #8 0x000055b6d33ef929 object_find_and_run (systemd-importd) #9 0x000055b6d33eff6b bus_process_object (systemd-importd) #10 0x000055b6d3447f77 process_message (systemd-importd) #11 0x000055b6d344815a process_running (systemd-importd) #12 0x000055b6d3448a10 bus_process_internal (systemd-importd) #13 0x000055b6d3448ae1 sd_bus_process (systemd-importd) #14 0x000055b6d3449779 time_callback (systemd-importd) #15 0x000055b6d3454ff4 source_dispatch (systemd-importd) #16 0x000055b6d34562b9 sd_event_dispatch (systemd-importd) #17 0x000055b6d34566f8 sd_event_run (systemd-importd) #18 0x000055b6d33ba72a bus_event_loop_with_idle (systemd-importd) #19 0x000055b6d33b95bc manager_run (systemd-importd) #20 0x000055b6d33b9766 main (systemd-importd) #21 0x00007f5eaefe2a00 __libc_start_main (libc.so.6) #22 0x000055b6d33b5569 _start (systemd-importd)
2016-03-14shared/machine-pool: fix mkfs.btrfs checkingEvgeny Vereshchagin
binary_is_good translates ENOENT to 0 See https://github.com/systemd/systemd/commit/85eca92e#diff-bcad68c477b6651521e880c40b7a9b40R813
2016-03-12Merge pull request #2828 from mineo/run-helpRonny Chevalier
run: Improve the help message about timer options and existing units
2016-03-12run: Improve the help message about timer options and existing unitsWieland Hoffmann
2016-03-10Merge pull request #2821 from keszybz/mac_selinux_bind-do-not-rely-on-errnoDaniel Mack
socket_address_listen: do not rely on errno (2)
2016-03-10Merge pull request #2794 from jhol/dont-unmount-initramfs-mountsDaniel Mack
core/mount: Don't unmount initramfs mounts
2016-03-10socket_address_listen: do not rely on errno (2)Zbigniew Jędrzejewski-Szmek
We'd still use the invalid errno for a return value. Rework the code to simply return the right error right away.
2016-03-10Merge pull request #2818 from vinaykul/masterTom Gundersen
DHCP DUID and IAID configurability
2016-03-10Merge pull request #2820 from lnykryn/test-ipcrmDaniel Mack
test-ipcrm: fix log message
2016-03-10Merge pull request #2819 from bachradsusi/mac_selinux_bind-do-not-rely-on-errnoDaniel Mack
socket_address_listen - do not rely on errno
2016-03-10test-ipcrm: fix log messageLukas Nykryn
2016-03-10socket_address_listen - do not rely on errnoPetr Lautrbach
Currently socket_address_listen() calls mac_selinux_bind() to bind a UNIX socket and checks its return value and errno for EADDRINUSE. This is not correct. When there's an SELinux context change made for the new socket, bind() is not the last function called in mac_selinux_bind(). In that case the last call is setfscreatecon() from libselinux which can change errno as it uses access() to check if /proc/thread-self is available. It fails on kernels before 3.17 and errno is set to ENOENT. It's safe to check only the return value at it's set to -errno.
2016-03-09DHCP DUID and IAID configurabilityVinay Kulkarni
2016-03-09Merge pull request #2792 from ronnychevalier/rc/tests_movev2Zbigniew Jędrzejewski-Szmek
tests: move out unrelated tests from test-util to their own file
2016-03-09Merge pull request #2816 from rhatdan/selinuxZbigniew Jędrzejewski-Szmek
/dev/console must be labeled with SELinux label in containers
2016-03-09Merge pull request #2793 from fbuihuu/fstab-generator-automount-optionZbigniew Jędrzejewski-Szmek
fstab-generator: fix automounts to not mount automatically
2016-03-09Merge pull request #2755 from keszybz/more-testsMartin Pitt
Enable more tests by default, and even more with `--enable-tests=unsafe`
2016-03-09/dev/console must be labeled with SELinux labelDan Walsh
If the user specifies an selinux_apifs_context all content created in the container including /dev/console should use this label. Currently when this uses the default label it gets labeled user_devpts_t, which would require us to write a policy allowing container processes to manage user_devpts_t. This means that an escaped process would be allowed to attack all users terminals as well as other container terminals. Changing the label to match the apifs_context, means the processes would only be allowed to manage their specific tty. This change fixes a problem preventing RKT containers from working with systemd-nspawn.
2016-03-07Merge pull request #2768 from benjarobin/fix-2718Daniel Mack
systemctl: Replace check_one_unit() by get_state_one_unit()
2016-03-06Merge pull request #2803 from 0xAX/lacess-tree-wideRonny Chevalier
firstboot: use laccess macro instead of facessat()
2016-03-06firstboot: use laccess macro instead of facessat()Alexander Kuleshov
2016-03-05README: bump kernel version to 3.12Zbigniew Jędrzejewski-Szmek
It is required for %P is sysctl kernel.core_pattern. Fixes #2800.
2016-03-05Merge pull request #2791 from 0xAX/clear-flag-macroZbigniew Jędrzejewski-Szmek
tree-wide: use SET_FLAG() macro to make code more clear
2016-03-05Merge pull request #2795 from jhol/replace-irreversibly-on-failureZbigniew Jędrzejewski-Szmek
core/failure-action: set job-modes to replace-irreversibly
2016-03-05Merge pull request #2801 from ronnychevalier/rc/systemctl_error_msgZbigniew Jędrzejewski-Szmek
systemctl: improve error message when starting a unit failed
2016-03-05tree-wide: use SET_FLAG() macro to make code more clearAlexander Kuleshov
2016-03-05systemctl: improve error message when starting a unit failedRonny Chevalier
Fixes #2798
2016-03-04test-compress-benchmark: skip loop iteration if size is 0Zbigniew Jędrzejewski-Szmek
Otherwise we would hit an assert in the compression code.
2016-03-04test-selinux: use yes_no() and strnull()Zbigniew Jędrzejewski-Szmek
2016-03-04networkctl: avoid reading past end of input bufferZbigniew Jędrzejewski-Szmek
name is IFNAMSIZ bytes, but we would copy sizeof(info->name) bytes, which is IFNAMSIZ + 1. In effect we would go outside of the source buffer and possibly leave a non-null terminated string in info->name. CID #1351754.
2016-03-04networkctl: use ETHER_ADDR_NULL in one more placeZbigniew Jędrzejewski-Szmek
2016-03-04lldp: fix memleakZbigniew Jędrzejewski-Szmek
in_addr_to_string returned 0, which was treated as error by the calling code, which expects 1 on success. CID #1351757, #1351758.
2016-03-04test-journal-enum: enable by defaultZbigniew Jędrzejewski-Szmek
It will get at most ten values, I don't know why we wouldn't always run this test.
2016-03-04test-libudev: disable monitor mode by default and add to automatic testsZbigniew Jędrzejewski-Szmek
2016-03-04test-libudev: modernizationZbigniew Jędrzejewski-Szmek
2016-03-04build-sys: ignore Python 2 bytecode filesZbigniew Jędrzejewski-Szmek
We ignored __pycache__ which works for Python 3, but the rule for Python 2 got lost somehow.
2016-03-04Enable test-ipcrm, test-hostname in unsafe testsZbigniew Jędrzejewski-Szmek
2016-03-04Enable test-daemon, test-log, test-watchdog by defaultZbigniew Jędrzejewski-Szmek
Those should be safe to run, resulting in some messages in logs.