1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-27 10:25:06 +03:00
Commit Graph

20978 Commits

Author SHA1 Message Date
Cédric Delmas
ba27fb2111 Process cciss devices
Do not skip the persistent storage rules for cciss devices
2015-06-29 09:54:58 +02:00
Daniel Mack
a611cd7406 Merge pull request #402 from systemd-mailing-devs/1435512180-3659-1-git-send-email-ebiggers3@gmail.com
util: fix incorrect escape sequence in string_is_safe()
2015-06-29 05:43:26 +02:00
Daniel Mack
eeec69e0e0 Merge pull request #399 from gmacario/fix-issue341-v2
bootchart: reset list_sample_data head before generating SVG
2015-06-29 05:03:38 +02:00
Tom Gundersen
e88113bd44 Merge pull request #388 from fsateler/doc-pidfile-removal
systemd.service.xml: document that systemd removes the PIDFile
2015-06-28 23:10:46 +02:00
Eric Biggers
843f6bf4ef util: fix incorrect escape sequence in string_is_safe() 2015-06-28 20:02:44 +02:00
Gianpaolo Macario
ae87a4a929 bootchart: reset list_sample_data head before generating SVG
Until commit 1f2ecb0 ("bootchart: kill a bunch of global variables")
variable "head" was declared global and this action was performed by svg_header.
Now that "head" is local and passed to each function called by svg_do(...)
move the code at the beginning of svg_do(...) to restore the correct behaviour.
2015-06-28 17:30:47 +00:00
Felipe Sateler
341db20b7e systemd.service.xml: document that systemd removes the PIDFile 2015-06-27 17:25:06 -03:00
Tom Gundersen
281d4a7710 Merge pull request #377 from zonque/logind
logind: fix delayed execution regression
2015-06-26 21:41:44 +02:00
Greg Kroah-Hartman
57a2bf2329 Merge pull request #353 from kaysievers/hid
rules: remove all power management from udev
2015-06-26 09:51:11 -07:00
Kay Sievers
13b7079289 Merge pull request #379 from whot/hwdb-updates
Revert "hwdb: add a touchpad hwdb"
2015-06-26 11:33:04 +02:00
Peter Hutterer
0530459245 Revert "hwdb: add a touchpad hwdb"
The main purpose of this hwdb was to tag touchpads that have the physical
trackstick buttons wired to the touchpad (Lenovo Carbon X1 3rd, Lenovo *50
series).  This hwdb is not required on kernels 4.0 and above, the kernel now
re-routes button presses through the trackstick's device node. Userspace does
not need to do anything.

See kernel commit cdd9dc195916ef5644cfac079094c3c1d1616e4c.

This reverts commit 001a247324.
2015-06-26 16:09:48 +10:00
Daniel Mack
418b22b88f logind: fix delayed execution regression
Commit c0f32805 ("logind: use sd_event timer source for inhibitor
logic") reworked the main loop logic of logind so that it uses a
real timeout callback handler to execute delayed functions.

What the old code did, however, was to call those functions on
every iteration in the main loop, not only when the timeout
expired.

Restore that behavior by bringing back manager_dispatch_delayed(),
and call it from manager_run(). The internal event source callback
manager_inhibit_timeout_handler() was turned into a wrapper of
manager_dispatch_delayed() now.
2015-06-25 17:18:41 +02:00
Daniel Mack
906fa49076 Merge pull request #367 from msekletar/install-unit-file-list-assert
install: explicitly return 0 on success
2015-06-25 16:38:41 +02:00
Daniel Mack
9674f042b2 Merge pull request #366 from gmacario/fix-issue139-v5
bootchart: Account CPU time spent in non-main threads of processes (v5)
2015-06-25 16:37:06 +02:00
Michal Sekletar
77cd2c87a4 install: explicitly return 0 on success
Maybe there is some left-over value stored in r from previous function
call. Let's make sure we always return consistent error code when we reach end of
the function body.

Fixes following crash of test-install,

Assertion 'r == 0' failed at src/test/test-install.c:52, function main(). Aborting.
[1]    11703 abort (core dumped)  ./test-install
2015-06-25 16:15:36 +02:00
Gianpaolo Macario
caa4339784 bootchart: Account CPU time spent in non-main threads of processes (v5)
Fix for issue https://github.com/systemd/systemd/issues/139

- Implement fixes suggested by @teg to -v2
- Implement fixes suggested by @zonque to -v3 and -v4
2015-06-25 13:39:41 +00:00
Kay Sievers
9ebdb1e057 Merge pull request #363 from zonque/proxy
bus-proxy: ignore 'log' attributes in XML policy
2015-06-25 14:36:59 +02:00
Daniel Mack
b9191d7a52 bus-proxy: ignore 'log' attributes in XML policy
'log' is unsupported but nothing to warn about. Ignore it just like we
ignore 'eavesdrop'.
2015-06-25 13:13:17 +02:00
Tom Gundersen
3dfc034b4d Merge pull request #355 from dvdhrm/netlink
sd-netlink cleanups
2015-06-25 13:02:53 +02:00
Lennart Poettering
9124468a5e Merge pull request #335 from aroig/gh/fix_check_unneeded
core: fix reversed dependency check in unit_check_unneeded
2015-06-24 08:52:21 -04:00
Lennart Poettering
4cd51a7fe5 Merge pull request #347 from poettering/check-api-docs
build-sys: make sure check-api-docs sees each symbol just once
2015-06-24 08:40:09 -04:00
David Herrmann
dd906398dd sd-netlink: don't export internal type-system details
The kernel bonding layer allows passing an array of ARP IP targets as
bond-configuration. Due to the weird implementation of arrays in netlink
(which we haven't figure out a generic way to support, yet), we usually
hard-code the supported array-sizes. However, this should not be exported
from sd-netlink.

Instead, make sure the caller just uses it's current hack of enumerating
the types, and the sd-netlink core will have it's own list of supported
array-sizes (to be removed in future extensions, btw!). If either does not
match, we will just return a normal error.

Note that we provide 2 constants for ARP_IP_TARGETS_MAX now. However, both
have very different reasons:
 - the constant in netdev-bond.c is used to warn the user that the given
   number of targets might not be supported by the kernel (even though the
   kernel might increase that number at _any_ time)
 - the constant in sd-netlink is solely used due to us missing a proper
   array implementation. Once that's supported in the type-system, it can
   be removed without notice

Last but not least, this patch turns the log_error() into a log_warning().
Given that the previous condition was off-by-one, anyway, it never hit at
the right time. Thus, it was probably of no real use.
2015-06-24 13:46:15 +02:00
David Herrmann
846a6b3d89 sd-netlink: don't treat NULL as root type-system
Explicitly export the root type-system to the type-system callers. This
avoids treating NULL as root, which for one really looks backwards (NULL
is usually a leaf, not root), and secondly prevents us from properly
debugging calling into non-nested types.

Also rename the root to "type_system_root". Once we support more than
rtnl, well will have to revisit that, anyway.
2015-06-24 13:46:11 +02:00
David Herrmann
e7de105cf6 sd-netlink: don't treat type_system->count==0 as invalid
Empty type-systems are just fine. Avoid the nasty hack in
union-type-systems that treat empty type-systems as invalid. Instead check
for the actual types-array and make sure it's non-NULL (which is even true
for empty type-systems, due to "empty_types" array).
2015-06-24 13:45:56 +02:00
David Herrmann
12b7dff45b sd-netlink: make sure the root-level type is nested
In sd-netlink-message, we always guarantee that the currently selected
type-system is non-NULL. Otherwise, we would be unable to parse any types
in the current container level. Hence, this assertion must be true:
    message->container_type_system[m->n_containers] != NULL

During message_new() we currently do not verify that this assertion is
true. Instead, we blindly access nl_type->type_system and use it (which
might be NULL for basic types and unions). Fix this, by explicitly
checking that the root-level type is nested.

Note that this is *not* a strict requirement of netlink, but it's a strict
requirement for all message types we currently support. Furthermore, all
the callers of message_new() already verify that only supported types are
passed, therefore, this is a pure cosmetic check. However, it might be
needed on the future, so make sure we don't trap into this once we change
the type-system.
2015-06-24 13:45:56 +02:00
David Herrmann
979e7eb9cc sd-netlink: drop NETLINK_TYPE_META
The NETLINK_TYPE_META pseudo-type is actually equivalent to an empty
nested type. Drop it and define an empty type-system instead.

This also has the nice side-effect that m->container_type_system[0] is
never NULL (which has really nasty side-effects if you try to read
attributes).
2015-06-24 13:45:56 +02:00
David Herrmann
c1df8dee28 sd-netlink: turn 'max' into 'count' to support empty type-systems
Right now we store the maximum type-ID of a type-system. This prevents us
from creating empty type-systems. Store the "count" instead, which should
be treated as max+1.

Note that type_system_union_protocol_get_type_system() currently has a
nasty hack to treat empty type-systems as invalid. This might need some
modification later on as well.
2015-06-24 13:45:47 +02:00
David Herrmann
6c14ad61db sd-netlink: avoid casting size_t into int
size_t is usually 64bit and int 32bit on a 64bit machine. This probably
does not matter for netlink message sizes, but nevertheless, avoid
hard-coding it anywhere.
2015-06-24 13:45:47 +02:00
David Herrmann
435bbb0233 sd-netlink: make NLTypeSystem internal
Same as NLType, move NLTypeSystem into netlink-types.c and hide it from
the outside. Provide an accessor function for the 'max' field that is used
to allocate suitable array sizes.

Note that this will probably be removed later on, anyway. Once we support
bigger type-systems, it just seems impractical to allocate such big arrays
for each container entry. An RBTree would probably do just fine.
2015-06-24 13:45:47 +02:00
David Herrmann
817d1cd824 sd-netlink: make NLType internal
If we extend NLType to support arrays and further extended types, we
really want to avoid hard-coding the type-layout outside of
netlink-types.c. We already avoid accessing nl_type->type_system outside
of netlink-types.c, extend this to also avoid accessing any other fields.

Provide accessor functions for nl_type->type and nl_type->size and then
move NLType away from the type-system header.

With this in place, follow-up patches can safely turn "type_system" and
"type_system_union" into a real "union { }", and then add another type for
arrays.
2015-06-24 13:45:47 +02:00
David Herrmann
c658008f50 sd-netlink: don't access type->type_system[_union] directly
Make sure we never access type->type_system or type->type_system_union
directly. This is an implementation detail of the type-system and we
should always use the accessors. Right now, they only exist for 2-level
accesses (type-system to type-system). This patch introduces the 1-level
accessors (type to type-system) and makes use of it.

This patch makes sure the proper assertions are in place, so we never
accidentally access sub-type-systems for non-nested/union types.

Note that this places hard-asserts on the accessors. This should be fine,
as we expect callers to only access sub type-systems if they *know*
they're dealing with nested types.
2015-06-24 13:45:47 +02:00
David Herrmann
cafbc790d1 sd-netlink: rename NLA_ to NETLINK_TYPE_
The NLA_ names are used to name real datatypes we extract out of netlink
messages. The kernel has an internal enum with the same names
(NLA_foobar), which is *NOT* binary compatible to our types. Furthermore,
we support a different set of types than the kernel (as we try to treat
some kernel peculiarities as our own types to simplify the API).

Rename NLA_ to NETLINK_TYPE_ to make clear that this is our own set of
types.
2015-06-24 13:45:47 +02:00
Kay Sievers
e2452eef02 rules: remove all power management from udev
It is not udev's task to apply any of these setting that way, or
from udev rules files. Things need to be sortet out in the kernel,
or explicit whitelist can possibly be added to the hardware database.
Until that is sorted out, and general agreement, udev is not
willing to maintain any such lists or power management settings
in general.

"Thanks for digging this out! I thought my Kinesis keyboard got broken
and ordered a new one, only to find out that the new one doesn't work
as well. I'm not sure whether we should start collecting a blacklist
of keyboards which don't work with USB autosuspend, or rather a
whitelist? Or revert this wholesale?"

  https://github.com/systemd/systemd/issues/340
2015-06-24 13:18:53 +02:00
Daniel Mack
54af0c65f7 Merge pull request #346 from poettering/install-bad-memory
install: fix minor bad memory access
2015-06-24 10:09:43 +02:00
Kay Sievers
482db06ff8 Merge pull request #349 from systemd-mailing-devs/1435103298-2439-1-git-send-email-jengelh@inai.de
ata_id: unbotch format specifier
2015-06-24 02:27:30 +02:00
Jan Engelhardt
ec62e85873 ata_id: unbotch format specifier
Commit v218-247-g11c6f69 broke the output of the utility. "%1$" PRIu64
"x" expands to "%1$lux", essentially "%lux", which shows the problem.
u and x cannot be combined, u wins as the type character, and x gets
emitted verbatim to stdout.

References: https://bugzilla.redhat.com/show_bug.cgi?id=1227503
2015-06-24 02:02:05 +02:00
Lennart Poettering
25d40bf57c install: fix bad memory access 2015-06-23 19:16:18 -04:00
Lennart Poettering
b7b85f227c build-sys: make sure check-api-docs sees each symbol just once
Given that some symbols are exposed by multiple libraries (due to the
compatibility libraries), let's ensure "make check-api-docs" only shows
each symbol once by filtering out duplicates.
2015-06-23 19:13:07 -04:00
Daniel Mack
0891c5ed0b Merge pull request #339 from teg/udev-coverity
coverity fixes in udev
2015-06-24 00:12:28 +02:00
Kay Sievers
3f9340a685 Merge pull request #338 from xnox/fix-copy-bytes
test: fix test-copy without /etc/os-release.
2015-06-23 17:34:24 +02:00
Dimitri John Ledkov
4f36d4004c test: fix test-copy without /etc/os-release. 2015-06-23 16:22:40 +01:00
Tom Gundersen
56b13bcc99 udevadm: trigger - check return values
Fixes CID#1296243.
2015-06-23 17:20:12 +02:00
Tom Gundersen
b6aab8ef9c udev: worker - check return value of udev_monitor_enable_receiving()
Fixes CID#1297430.
2015-06-23 17:20:12 +02:00
Tom Gundersen
f6e0a35376 udev: event - check return code of dup2()
This fixes CID#1304688.
2015-06-23 17:20:12 +02:00
Tom Gundersen
e448a1c3a3 udev: bulitin-hwdb - fix memory leak
This fixes CID#1292782.
2015-06-23 17:20:12 +02:00
Daniel Mack
63ea609849 Merge pull request #332 from xnox/bootchart-scales
bootchart: fix per-cpu & small scales.
2015-06-23 16:37:19 +02:00
Dimitri John Ledkov
75034e5836 bootchart: fix per-cpu scales.
Closes systemd/systemd#330
2015-06-23 15:25:17 +01:00
Abdo Roig-Maranges
084918ba41 core: fix reversed dependency check in unit_check_unneeded
This was introduced by commit be7d9ff730 and breaks
StopWhenUnneeded=true in the presence of a Requisite dependency.
2015-06-23 14:13:13 +02:00
Kay Sievers
82627069e9 README: mention "git archive" 2015-06-23 13:41:15 +02:00
Daniel Mack
f3941a6f33 Merge pull request #318 from walyong/smack_v02
SMACK v02: support modify rules and add default executed process label
2015-06-23 13:26:23 +02:00