Commit Graph
20950 Commits
Author SHA1 Message Date
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
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
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
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
Daniel Mack 9261d42e6d Merge pull request #328 from kaysievers/nodist
build-sys: add all source files and no built files to the tar ball
2015-06-23 13:04:52 +02:00
Kay Sievers 2c8849add4 build-sys: add all source files and no built files to the tar ball
This fully synchronizes the content of a "make dist" and a "git archive"
tar ball.

  http://lists.freedesktop.org/archives/systemd-devel/2015-June/033214.html
2015-06-23 12:43:15 +02:00
Michael Biebl e6de49abfd man: install networkctl and sysusers.d man page conditionally 2015-06-23 10:40:29 +02:00
Daniel Mack 7a01b920d0 Merge pull request #324 from llua/zsh-completion
zsh-completion: _loginctl/_systemd/_systemd-inhibit improvements
2015-06-23 10:01:42 +02:00
Daniel Mack 53bf09836d Merge pull request #326 from whot/hwdb-updates
Hwdb updates
2015-06-23 10:00:42 +02:00
Peter Hutterer 1cbcfd3ee0 hwdb: move a couple of entries to expected sort order 2015-06-23 15:52:03 +10:00
Peter Hutterer 3fc1b05f53 hwdb: add Logitech MX Revolution 2015-06-23 15:50:09 +10:00
Kay Sievers d30449bd76 build-sys: let "make git-tar" archive HEAD 2015-06-23 00:49:34 +02:00
Eric Cook fb9d85b71a zsh-completion: _loginctl/_systemd/_systemd-inhibit improvements
_loginctl: respects the verbose style. which allows a user to get
the pre d5df0d950f behavior of not showing a description for sessions
and users, by default they aren't shown.

zstyle ':completion:*' verbose true
or
zstyle ':completion:*:loginctl*:*' verbose true # or similar
Will show the descriptions.

zstyle ':completion:*' verbose true
and
zstyle ':completion:*:loginctl*:*' verbose false # or similar
Won't show descriptions for loginctl only

_systemd: complete pids for systemd-notify's --pid option.
display a message of the expected argument for other options.

_systemd-inhibit: complete block & delay for --mode
display a message of the expected argument for --who/--why
2015-06-22 18:07:32 -04:00
Kay Sievers 5aaf87682e build-sys: remove $(NULL) 2015-06-22 23:27:08 +02:00
Kay Sievers 6f58d70e31 build-sys: add custom "make git-tar" target 2015-06-22 23:08:55 +02:00
Lennart Poettering 78a68c3454 Merge pull request #314 from geertj/missing-exports
export sd_bus_object_added() / _removed()
2015-06-22 22:47:42 +02:00
Lennart Poettering f582dbaa14 Merge pull request #319 from teg/udev-cgroup-warning
udevd: suppress warning if we don't find cgroup
2015-06-22 22:32:26 +02:00
Kay Sievers d806a1df5b Merge pull request #322 from kaysievers/wip
man: remove outdated links and stray character
2015-06-22 20:22:57 +02:00
Kay Sievers 1f35347af0 man: remove stray · from header 2015-06-22 19:54:52 +02:00
Kay Sievers b8332e7abb man: remove links to outdated kdbus development repository 2015-06-22 19:54:09 +02:00
Tom Gundersen 11b9fb15be udevd: suppress warning if we don't find cgroup
This is expected on non-systemd systems, so just log it at debug level.

This fixes issue #309.
2015-06-22 16:55:49 +02:00
WaLyong Cho e174dce271 smack: add default smack process label config
Similar to SmackProcessLabel=, if this configuration is set, systemd
executes processes with given SMACK label. If unit has
SmackProcessLabel=, this config is overwritten.
But, do NOT be confused with SMACK64EXEC of execute file. This default
execute process label(and also label which is set by
SmackProcessLabel=) is set fork-ed process SMACK subject label and
used to access the execute file.
If the execution file has also SMACK64EXEC, finally executed process
has SMACK64EXEC subject.
While if the execution file has no SMACK64EXEC, the executed process
has label of this config(or label which is set by
SmackProcessLabel=). Because if execution file has no SMACK64EXEC then
excuted process inherits label from caller process(in this case, the
caller is systemd).
2015-06-22 23:44:09 +09:00
WaLyong Cho 6656aefb42 smack: support smack access change-rule
Smack is also able to have modification rules of existing rules. In
this case, the rule has additional argument to modify previous
rule. /sys/fs/smackfs/load2 node can only take three arguments:
subject object access. So if modification rules are written to
/sys/fs/smackfs/load2, EINVAL error is happen. Those modification
rules have to be written to /sys/fs/smackfs/change-rule.
To distinguish access with operation of cipso2, split write_rules()
for each operation. And, in write access rules, parse the rule and if
the rule has four argument then write into
/sys/fs/smackfs/change-rule.
https://lwn.net/Articles/532340/

fwrite() or fputs() are fancy functions to write byte stream such like
regular file. But special files on linux such like proc, sysfs are not
stream of bytes. Those special files on linux have to be written with
specific size.
By this reason, in some of many case, fputs() was failed to write
buffer to smack load2 node.
The write operation for the smack nodes should be performed with
write().
2015-06-22 23:44:09 +09:00
Daniel Mack cc05b1bb37 Merge pull request #315 from llua/zsh-completion
zsh-completion: _systemd-nspawn - add more argument completion
2015-06-22 10:30:22 +02:00
Geert Jansen 969a9685d9 export sd_bus_object_added() / _removed()
Fixes #306.
2015-06-21 22:21:38 -04:00
Eric Cook 38cf1e292b zsh-completion: _systemd-nspawn - add more argument completion
filenames will be completed for --image/-i/--bind/--bind-ro/--tmpfs
network interfaces for --network-(interface|macvlan|ipvlan|bridge)
users for --user/-u, yes & no for --register, x86 * x86-64 for
--personality

display a message of the expected argument for --machine/-M/--uuid
--slice/-S/--port/-p/--selinux-*/-Z/-L/--setenv

Allow completing commands(and their options) of the host system for COMMAND
2015-06-21 21:59:26 -04:00
Daniel Mack 678d0c9033 Merge pull request #304 from mknjc/master
fix machinectl bind man entry
2015-06-21 11:32:12 +02:00
Jan Alexander Steffens (heftig) c5d452bb22 pam_systemd: Properly check kdbus availability
This properly avoids setting DBUS_SESSION_BUS_ADDRESS if kdbus
is loaded (or built into the kernel) but not wanted.
2015-06-21 11:24:59 +02:00
Markus Knetschke cb7bb815d2 fix machinectl bind man entry 2015-06-20 17:05:48 +02:00
David Herrmann 94c5528dc2 Merge pull request #303 from zonque/man
man: rename systemd-bus-proxyd@.service.xml → systemd-bus-proxyd.…
2015-06-20 14:43:45 +02:00
Daniel Mack faebe5a933 man: rename systemd-bus-proxyd@.service.xml → systemd-bus-proxyd.service.xml
The bus proxy is multi-threaded now. Reflect that in the man pages.
2015-06-20 14:28:50 +02:00
Daniel Mack ebc6475384 Merge pull request #301 from daurnimator/master
man: sd-bus: it's 'machine' not 'container'
2015-06-20 14:00:28 +02:00