Commit graph

25209 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 70e43ee7be Merge pull request #2735 from evverx/fix-2730
Add test for -.mount with Alias=root.mount, bug #2730.
2016-03-14 09:12:29 -04:00
Zbigniew Jędrzejewski-Szmek 51f2174037 Merge pull request #2834 from coling/master 2016-03-14 08:31:08 -04:00
Zbigniew Jędrzejewski-Szmek a0796d1c1f Merge pull request #2832 from evverx/fix-mkfs-btrfs-checking
Fix mkfs.btrfs checking
2016-03-14 08:14:41 -04:00
Zbigniew Jędrzejewski-Szmek 87836c67d8 Merge pull request #2835 from tklauser/man-spelling
man: network - Fix misspelling of "router advertisement"
2016-03-14 07:47:01 -04:00
Tobias Klauser 3708bd466e man: network - Fix misspelling of "router advertisement" 2016-03-14 12:13:58 +01:00
Colin Guthrie 5e1558f4a0 device: Ensure we have sysfs path before comparing.
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-14 09:43:03 +00:00
Evgeny Vereshchagin 579afbea21 shared/machine-pool: fix another mkfs.btrfs checking
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-14 00:54:35 +00:00
Evgeny Vereshchagin c3b0e5ac57 shared/machine-pool: fix mkfs.btrfs checking
binary_is_good translates ENOENT to 0
See https://github.com/systemd/systemd/commit/85eca92e#diff-bcad68c477b6651521e880c40b7a9b40R813
2016-03-14 00:01:33 +00:00
Ronny Chevalier ed0b16e279 Merge pull request #2828 from mineo/run-help
run: Improve the help message about timer options and existing units
2016-03-12 15:56:54 +01:00
Wieland Hoffmann b61a09a522 run: Improve the help message about timer options and existing units 2016-03-12 11:50:34 +01:00
Daniel Mack 5d331c192f Merge pull request #2821 from keszybz/mac_selinux_bind-do-not-rely-on-errno
socket_address_listen: do not rely on errno (2)
2016-03-10 17:37:40 +01:00
Daniel Mack bffac070d0 Merge pull request #2794 from jhol/dont-unmount-initramfs-mounts
core/mount: Don't unmount initramfs mounts
2016-03-10 15:24:21 +01:00
Zbigniew Jędrzejewski-Szmek 825546ef76 socket_address_listen: do not rely on errno (2)
We'd still use the invalid errno for a return value. Rework
the code to simply return the right error right away.
2016-03-10 09:24:08 -05:00
Tom Gundersen ead02a14ed Merge pull request #2818 from vinaykul/master
DHCP DUID and IAID configurability
2016-03-10 14:38:42 +01:00
Daniel Mack 79c96fd204 Merge pull request #2820 from lnykryn/test-ipcrm
test-ipcrm: fix log message
2016-03-10 13:43:48 +01:00
Daniel Mack b5adc91a67 Merge pull request #2819 from bachradsusi/mac_selinux_bind-do-not-rely-on-errno
socket_address_listen - do not rely on errno
2016-03-10 13:31:59 +01:00
Lukas Nykryn 7322824832 test-ipcrm: fix log message 2016-03-10 12:57:23 +01:00
Petr Lautrbach a0c9496cc8 socket_address_listen - do not rely on errno
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-10 10:34:37 +01:00
Vinay Kulkarni c83321e6d4 DHCP DUID and IAID configurability 2016-03-09 21:58:44 -08:00
Zbigniew Jędrzejewski-Szmek c41d3b3a0c Merge pull request #2792 from ronnychevalier/rc/tests_movev2
tests: move out unrelated tests from test-util to their own file
2016-03-09 23:53:54 -05:00
Zbigniew Jędrzejewski-Szmek ef240bf0df Merge pull request #2816 from rhatdan/selinux
/dev/console must be labeled with SELinux label in containers
2016-03-09 23:47:00 -05:00
Zbigniew Jędrzejewski-Szmek 0551ec7355 Merge pull request #2793 from fbuihuu/fstab-generator-automount-option
fstab-generator: fix automounts to not mount automatically
2016-03-09 23:41:24 -05:00
Martin Pitt bd7e03af00 Merge pull request #2755 from keszybz/more-tests
Enable more tests by default, and even more with `--enable-tests=unsafe`
2016-03-09 18:21:42 +01:00
Dan Walsh 68b020494d /dev/console must be labeled with SELinux label
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-09 11:19:45 -05:00
Daniel Mack 280d397ab3 Merge pull request #2768 from benjarobin/fix-2718
systemctl: Replace check_one_unit() by get_state_one_unit()
2016-03-07 14:50:08 +01:00
Ronny Chevalier ef03147173 Merge pull request #2803 from 0xAX/lacess-tree-wide
firstboot: use laccess macro instead of facessat()
2016-03-06 21:20:49 +01:00
Alexander Kuleshov b3cd687d86 firstboot: use laccess macro instead of facessat() 2016-03-06 13:27:59 +06:00
Zbigniew Jędrzejewski-Szmek 58015d7815 README: bump kernel version to 3.12
It is required for %P is sysctl kernel.core_pattern.

Fixes #2800.
2016-03-05 11:22:45 -05:00
Zbigniew Jędrzejewski-Szmek b61c9cf925 Merge pull request #2791 from 0xAX/clear-flag-macro
tree-wide: use SET_FLAG() macro to make code more clear
2016-03-05 10:31:04 -05:00
Zbigniew Jędrzejewski-Szmek 22a9adac34 Merge pull request #2795 from jhol/replace-irreversibly-on-failure
core/failure-action: set job-modes to replace-irreversibly
2016-03-05 10:19:25 -05:00
Zbigniew Jędrzejewski-Szmek 0ca49eed1f Merge pull request #2801 from ronnychevalier/rc/systemctl_error_msg
systemctl: improve error message when starting a unit failed
2016-03-05 10:16:50 -05:00
Alexander Kuleshov 5883ff6017 tree-wide: use SET_FLAG() macro to make code more clear 2016-03-05 18:26:01 +06:00
Ronny Chevalier 0b8505b7c9 systemctl: improve error message when starting a unit failed
Fixes #2798
2016-03-05 12:47:21 +01:00
Zbigniew Jędrzejewski-Szmek 15b947fb79 test-compress-benchmark: skip loop iteration if size is 0
Otherwise we would hit an assert in the compression code.
2016-03-04 21:46:47 -05:00
Zbigniew Jędrzejewski-Szmek b5ec6ada9c test-selinux: use yes_no() and strnull() 2016-03-04 21:45:58 -05:00
Zbigniew Jędrzejewski-Szmek 2388b2f4d4 networkctl: avoid reading past end of input buffer
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-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek 72e551f40b networkctl: use ETHER_ADDR_NULL in one more place 2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek b3ad5fa944 lldp: fix memleak
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-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek ce1e49c3d6 test-journal-enum: enable by default
It will get at most ten values, I don't know why we wouldn't
always run this test.
2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek 301a9c67aa test-libudev: disable monitor mode by default and add to automatic tests 2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek cc4c1d2290 test-libudev: modernization 2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek 8b663bdf9b build-sys: ignore Python 2 bytecode files
We ignored __pycache__ which works for Python 3, but the rule
for Python 2 got lost somehow.
2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek c1ab819162 Enable test-ipcrm, test-hostname in unsafe tests 2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek 134953c99c Enable test-daemon, test-log, test-watchdog by default
Those should be safe to run, resulting in some messages in logs.
2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek 67a47c6096 shared/acpi-fpdt: use ENODATA for missing data and skip test
This data is simply missing on non-UEFI systems, and it is useful
to distinguish that from corrupted data.
2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek a4bfedec70 Rename test-boot-timestamp to test-boot-timestamps and enable by default
The source file name and the binary name were mismatched.
Rename binary to match.

Make the test exit with TEST_SKIP if the data is missing or we
have no permissions. Otherwise, the data will be printed, which
should be safe to enable by default.
2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek f26b57d12a Move test-loopback to normal tests
In the normal case lo should be already configured and this should be
a noop, even when run under root.
2016-03-04 21:45:44 -05:00
Franck Bui 2b14df4a9a fstab-generator: fix automount option and don't start associated mount unit at boot
Without this patch applied the mount unit with 'automount' option was still
pulled by local-fs.target and thus was activated during the boot process which
defeats the purpose of the 'automount' option:

   $ grep /mnt /etc/fstab
   /dev/vdb1 /mnt ext2 defaults,x-systemd.automount 0 0

   $ reboot
   ...

   $ mount | grep mnt
   systemd-1 on /mnt type autofs (rw,relatime,fd=34,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
   /dev/vdb1 on /mnt type ext2 (rw,relatime)

   $ systemctl status mnt.mount | grep Active
      Active: active (mounted) since Thu 2016-03-03 21:36:22 CET; 42s ago

With the patch applied:

   $ reboot
   ...

   $ mount | grep mnt
   systemd-1 on /mnt type autofs (rw,relatime,fd=22,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)

   $ systemctl status mnt.mount | grep Active
      Active: inactive (dead)

   $ ls /mnt
   lost+found

   $ systemctl status mnt.mount | grep Active
      Active: active (mounted) since Thu 2016-03-03 21:47:32 CET; 4s ago
2016-03-04 22:09:08 +01:00
Joel Holdsworth 04a9393122 core/mount: Don't unmount initramfs mounts
A mount within /run/initramfs is indicative that the mount was
created by initramfs init and will be unmounted by initramfs
shutdown.

It is unlikely that such a mount point would even be unmountable
by the the main system, for example in the case of the root file-
system being loop-mounted from a file in a /run/initramfs mount.
2016-03-04 15:16:34 +00:00
Joel Holdsworth 9c0d1c1cb5 core/failure-action: Set job-modes to replace-irreversibly
Up until now, the failure action has launched reboot.target and
poweroff.target with a less aggressive job mode than
"systemctl reboot" does. This has meant that the reboot and power-
off operations can stall if there are any conflicts with the target
during rebooting.
2016-03-04 15:13:40 +00:00