1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-28 11:55:23 +03:00
Commit Graph

21765 Commits

Author SHA1 Message Date
Alex Crawford
7e753d9d28 networkd: add private options to lease struct
This stores private-zone DHCP options inside of their respective DHCP
lease. These options aren't used by networkd (what would it do with
them?), but saving them will allow other programs to query the values.
To improve performance, the options are stored in ascending order by
tag.
2015-08-05 09:00:57 -07:00
Lennart Poettering
b7cefda16a Merge pull request #876 from zonque/logind
logind: switch to sd_bus_track helper
2015-08-05 18:48:45 +03:00
Daniel Mack
3cde9e8fa0 logind: switch to sd_bus_track helper
Let logind use the sd_bus_track helper object to track the controllers of
sessions. This does not only remove quite some code but also kills the
unconditional matches for all NameOwnerChanged signals.

The latter is something we should never ever do, as it wakes up the daemon
every time a client connects, which doesn't scale.
2015-08-05 17:06:45 +02:00
Lennart Poettering
652f0e397f Merge pull request #874 from richardmaw-codethink/doc-nspawn-machine-search-path-v2
man: Reference the canonical location of the search path in systemd-nspawn's documentation of the --machine option. (v2)
2015-08-05 15:11:27 +03:00
Richard Maw
32b64cce23 man: point nspawn --machine to machinectl search-path
The --machine option used to describe searching for machines in
/var/lib/machines, which is not the whole story, so let's link to where
it's described in more detail.
2015-08-05 12:01:16 +00:00
Daniel Mack
94029f6c3e Merge pull request #871 from poettering/journald-meta-fields
journald: fix count of object meta fields
2015-08-05 11:09:48 +02:00
Lennart Poettering
2f6dbdb408 Merge pull request #864 from phomes/master
hwdb: add Logitech LX8 DPI and wheel click settings
2015-08-05 11:40:34 +03:00
Lennart Poettering
704e4fe7a1 journald: fix count of object meta fields
There are 12 object meta fields created in dispatch_message_real(), but
we only allocated space for 11. Fix this.

Fixes #866.
2015-08-05 11:31:52 +03:00
Daniel Mack
075b226673 Merge pull request #869 from poettering/tmpfiles-enoent
sysctl: reword warning message a bit
2015-08-05 10:12:29 +02:00
Lennart Poettering
384c5b44fe sysctl: reword warning message a bit
Let's make this less dramatic, in order to not confuse people too much
making them think that this was something to actually fix.
2015-08-05 11:02:24 +03:00
Lennart Poettering
b2627f5ac4 Merge pull request #868 from jsynacek/jsynacek/sysctl
sysctl: bump loglevel when attempting to write invalid values [v2]
2015-08-05 10:58:54 +03:00
Jan Synacek
9bcfdd74fc sysctl: bump loglevel when attempting to write invalid values 2015-08-05 09:42:50 +02:00
Daniel Mack
9ae742ea4f Merge pull request #865 from mattst88/alpha-getxpid
Use getxpid syscall on alpha for raw_getpid()
2015-08-05 07:38:08 +02:00
Matt Turner
a242a99d42 Use getxpid syscall on alpha for raw_getpid()
Alpha does not have a getpid syscall, but rather has getxpid to match
OSF/1.
2015-08-04 14:47:52 -07:00
Lennart Poettering
b736ee0b0c Merge pull request #855 from richardmaw-codethink/machinectl-copy-to-from-relative-paths-v2
Allow relative paths in `machinectl copy-{from,to}` (v2)
2015-08-05 00:13:27 +03:00
Thomas Hindoe Paaboel Andersen
1ae2285324 gpt-auto-generator: remove unused variable 2015-08-04 22:36:21 +02:00
Thomas Hindoe Paaboel Andersen
75440a51b2 hwdb: add Logitech LX8 DPI and wheel click settings 2015-08-04 22:15:30 +02:00
Kay Sievers
5386501fcc Merge pull request #857 from dvdhrm/proxy-reload
bus-proxy: add ExecReload=
2015-08-04 17:26:20 +02:00
Daniel Mack
ee80b4b297 Merge pull request #860 from walyong/smack_v11
Smack v11: set only the default smack process label if the command path has no execute label
2015-08-04 14:27:09 +02:00
Daniel Mack
5977db2a3a Merge pull request #858 from dvdhrm/proxy-env
bus-proxy: discard invalid environment updates
2015-08-04 14:23:17 +02:00
WaLyong Cho
e419a0e310 core: set default process label only exec label is none
When command path has access label and no SmackProcessLabel= is not
set, default process label will be set. But if the default process
label has no rule for the access label of the command path then smack
access error will be occurred.
So, if the command path has execute label then the child have to set
its label to the same of execute label of command path instead of
default process label.
2015-08-04 21:11:24 +09:00
WaLyong Cho
5ab58c2091 smack-util: revise smack-util apis and add read smack attr apis
- Add smack xattr lookup table
- Unify all of mac_smack_apply_xxx{_fd}() to mac_smack_apply() and
  mac_smack_apply_fd().
- Add smack xattr read apis similar with apply apis as
  mac_smack_read{_fd}().
2015-08-04 21:11:19 +09:00
WaLyong Cho
7b9c9ab810 util: add getxattr helper apis
To get xattr of given path or fd on newly allocated buffer, add new
helper api getxattr_malloc() and fgetxattr_malloc().
2015-08-04 21:09:48 +09:00
David Herrmann
c7d38b859d bus-proxy: discard invalid environment updates
If the caller provides invalid assignments via
UpdateActivationEnvironment=, we now drop it and warn loudly about it. We
need this to be compatible to dbus1, but we also clearly want to tell the
caller that they better ought to follow POSIX recommendations and use
valid labels only.

Fixes #826.
2015-08-04 13:38:40 +02:00
David Herrmann
c9bdeccd5d bus-proxy: add ExecReload=
Make sure we support ExecReload= for bus-proxyd to reload configuration
during runtime. This is *really* handy when hacking on kdbus.

Package-managers are still recommended to run
 `busctl --address=unix:path=` directly.
2015-08-04 13:19:50 +02:00
Daniel Mack
13925e4ce8 Merge pull request #856 from richardmaw-codethink/doc-invalid-environmentfile-lines
man: Document invalid lines in EnvironmentFile
2015-08-04 12:24:33 +02:00
Alex Crawford
85e22bfc3f networkd: add DHCP options for private zone 2015-08-04 03:23:43 -07:00
Alex Crawford
dbe465c93e basic: add LIST_INSERT_BEFORE
Similar in function to LIST_INSERT_AFTER, this will insert a new element
into the list before the specified position. If the specified position
is NULL, the element is added as the tail of the list.
2015-08-04 03:23:43 -07:00
Richard Maw
8f0d2981ca man: Document invalid lines in EnvironmentFile
If a line doesn't contain an = separator, it is skipped, rather than
raising an error.

This is potentially useful, so let's document this behaviour.
2015-08-04 09:58:50 +00:00
Richard Maw
1fe6fa1679 machinectl: support relative host paths in copy-{from,to} 2015-08-04 09:11:23 +00:00
Richard Maw
d844017677 machined: Relax path checks for Copy{From,To}
Absolute paths should be sufficient to prevent funny business,
and while path_is_safe() checks this, it also checks whether the path
contains . or .. components, which while odd, aren't a security risk.
2015-08-04 09:11:23 +00:00
Daniel Mack
58a2e9acd8 Merge pull request #850 from ssahani/dhcp
networkd: DHCP fix CID 1315105
2015-08-04 08:42:25 +02:00
Susant Sahani
bff92d2c2f networkd: DHCP fix CID 1315105
CID 1315105: Resource leaks (RESOURCE_LEAK)
/src/libsystemd-network/sd-dhcp-server.c: 800 in
dhcp_server_handle_message()
*** CID 1315105: Resource leaks (RESOURCE_LEAK)
/src/libsystemd-network/sd-dhcp-server.c: 800 in
2015-08-04 11:31:03 +05:30
Zbigniew Jędrzejewski-Szmek
195c9e37fc Update bugtracker address 2015-08-04 00:03:55 -04:00
Daniel Mack
2a984ebfd9 Merge pull request #845 from poettering/terminal-o-nonblock
add O_NONBLOCK to terminal handling
2015-08-03 20:57:19 +02:00
Daniel Mack
0da1624818 tree-wide: convert some more mfree() candidates 2015-08-03 19:39:42 +02:00
Lennart Poettering
35bdab779f terminal-util: no real reason to assert on O_CREAT
That's just handle this as a normal error.
2015-08-03 19:07:33 +02:00
Lennart Poettering
7d927c9a4d terminal-util: cast a couple of ioctl()s to void 2015-08-03 19:07:33 +02:00
Lennart Poettering
0a8b555ceb terminal-util: when resetting terminals, don't wait for carrier
In case of non-CLOCAL lines (i.e. those with carrier detect configured)
we shouldnt wait for a carrier if all we try to do is reset the TTY.
Hence, whenever we open such a TTY pass O_NONBLOCK.

Note that we continue to open ttys we intend to write to without
O_ONBLOCK, we only add it in cases we invoke ioctl()s or other terminal
operations without reading or writing to the device.

Fixes #835.
2015-08-03 19:06:35 +02:00
Tom Gundersen
9317cbecf8 Merge pull request #844 from poettering/clock-boottime2
tree-wide: convert bootchart and lldp code to use clock_boottime_or_m…
2015-08-03 17:58:54 +02:00
Tom Gundersen
6934f402cd Merge pull request #843 from poettering/clock-boottime
sd-event: make sure sd_event_now() cannot fail
2015-08-03 17:57:26 +02:00
Lennart Poettering
27ec691bfd tree-wide: convert bootchart and lldp code to use clock_boottime_or_monotonic()
We should avoid using CLOCK_BOOTTIME directly unless we actually can
sensible distuingish it from CLOCK_MONOTONIC. CLOCK_BOOTTIME is only
fully feature on very recent Linux kernels, hence we should stick to a
fallback logic, which is already available in the
clock_boottime_or_monotonic() call.
2015-08-03 17:40:46 +02:00
Lennart Poettering
5ef9b2203e Merge pull request #840 from systemd-mailing-devs/1438566907-9544-1-git-send-email-wangkefeng.wang@huawei.com
logind: add standard gpio power button support
2015-08-03 17:34:54 +02:00
Lennart Poettering
38a03f06a7 sd-event: make sure sd_event_now() cannot fail
Previously, if the event loop never ran before sd_event_now() would
fail. With this change it will instead fall back to invoking now(). This
way, the function cannot fail anymore, except for programming error when
invoking it with wrong parameters.

This takes into account the fact that many callers did not handle the
error condition correctly, and if the callers did, then they kept simply
invoking now() as fall back on their own. Hence let's shorten the code
using this call, and make things more robust, and let's just fall back
to now() internally.

Whether now() is used or the cache timestamp may still be detected via
the return value of sd_event_now(). If > 0 is returned, then the fall
back to now() was used, if == 0 is returned, then the cached value was
returned.

This patch also simplifies many of the invocations of sd_event_now():
the manual fall back to now() can be removed. Also, in cases where the
call is invoked withing void functions we can now protect the invocation
via assert_se(), acknowledging the fact that the call cannot fail
anymore except for programming errors with the parameters.

This change is inspired by #841.
2015-08-03 17:34:49 +02:00
Daniel Mack
4d2bee0620 Merge pull request #841 from teg/resolved-exponential-resend
resolved: exponential backoff of packet resend
2015-08-03 16:32:40 +02:00
Tom Gundersen
3b31df8301 resolved: transaction - increase number of retry attempts
With the exponential backoff, we can perform more requests in the same amount of time,
so bump this a bit.

In case of large RTT this may be necessary in order not to regress, and in case
of large packet-loss it will make us more robust. The latter is particularly
relevant once we start probing for features (and hence may see packet-loss
until we settle on the right feature level).
2015-08-03 14:25:49 +02:00
Tom Gundersen
9df3ba6c6c resolved: transaction - exponentially increase retry timeouts
Rather than fixing this to 5s for unicast DNS and 1s for LLMNR, start
at a tenth of those values and increase exponentially until the old
values are reached. For LLMNR the recommended timeout for IEEE802
networks (which basically means all of the ones we care about) is 100ms,
so that should be uncontroversial. For unicast DNS I have found no
recommended value. However, it seems vastly more likely that hitting a
500ms timeout is casued by a packet loss, rather than the RTT genuinely
being greater than 500ms, so taking this as a startnig value seems
reasonable to me.

In the common case this greatly reduces the latency due to normal packet
loss. Moreover, once we get support for probing for features, this means
that we can send more packets before degrading the feature level whilst
still allowing us to settle on the correct feature level in a reasonable
timeframe.

The timeouts are tracked per server (or per scope for the multicast
protocols), and once a server (or scope) receives a successfull package
the timeout is reset. We also track the largest RTT for the given
server/scope, and always start our timouts at twice the largest
observed RTT.
2015-08-03 14:06:58 +02:00
Tom Gundersen
240b589b14 resolved: cache - use clock_boottime_or_monotonic()
We cannot rely on CLOCK_BOOTTIME being supported by the kernel, so fallack
to CLOCK_MONOTONIC if the former is not supported.
2015-08-03 13:42:44 +02:00
Daniel Mack
b04d9f2871 Merge pull request #837 from ssahani/dhcp
networkd: fix neworkd crash
2015-08-03 09:55:41 +02:00
Kefeng Wang
405e116f57 logind: add standard gpio power button support
Many boards like hisilicon D02 board use standard gpio key to power down system.
A description of gpio-key in dts shown below,

gpio_keys {
	compatible = "gpio-keys";
	#address-cells = <1>;
	#size-cells = <0>;

	pwrbutton {
		label = "Power Button";
		gpios = <&porta 8 1>;
		linux,code = <116>;  // KEY_POWER, used by SC System Power Down
	};
};

-bash-4.3# udevadm info -a /dev/input/event3

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/gpio_keys/input/input3/event3':
    KERNEL=="event3"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device '/devices/platform/gpio_keys/input/input3':
    KERNELS=="input3"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="gpio_keys"
    ATTRS{phys}=="gpio-keys/input0"
    ATTRS{uniq}==""
    ATTRS{properties}=="0"

  looking at parent device '/devices/platform/gpio_keys':
    KERNELS=="gpio_keys"
    SUBSYSTEMS=="platform"
    DRIVERS=="gpio-keys"
    ATTRS{keys}=="116"
    ATTRS{switches}==""
    ATTRS{driver_override}=="(null)"
    ATTRS{disabled_keys}==""
    ATTRS{disabled_switches}==""

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""
2015-08-03 04:04:27 +02:00