1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 06:52:22 +03:00
Commit Graph

17222 Commits

Author SHA1 Message Date
David Herrmann
6a15ce2b3e terminal/grdev: simplify DRM event parsing
Coverity complained about this code and is partially right. We are not
really protected against integer overflows. Sure, unlikely, but lets just
avoid any overflows and properly protect our parser loop.
2014-10-03 15:57:00 +02:00
David Herrmann
f1f5b2a3bd terminal: make utf8 decoder return length
Lets return the parsed length in term_utf8_decode() instead of a buffer
pointer. Store the pointer in the passed argument.

This makes it adhere to the systemd coding-style, were we always avoid
returning pointers, but store them in output arguments. In this case, the
storage is not allocated, so it doesn't fit 100% to this idiom, but still
looks much nicer.
2014-10-03 15:57:00 +02:00
David Herrmann
db1a606610 terminal: fix back-buffer selection on DRM page-flip
We currently select front-buffers as new back-buffer if they happen to be
the last buffer in our framebuffer-array. Fix this by never selecting a
new front buffer as back buffer.
2014-10-03 15:57:00 +02:00
Zbigniew Jędrzejewski-Szmek
754fc0c720 fileio-label: return error when writing fails
The status of actually writing the file was totally ignored.
2014-10-03 08:58:40 -04:00
Jan Synacek
a62e83b48c journalctl: make --utc work everywhere
The --utc option was introduced by commit
9fd290443f.
Howerver, the implementation was incomplete.
2014-10-03 08:38:01 -04:00
Thomas Hindoe Paaboel Andersen
1c92ff85b7 bootchart: use 'n/a' if PRETTY_NAME is not found
Spotted with coverity. If parsing both /etc/os-release and
/usr/lib/os-release fails then null would be passed on. The calls
to parse the two files are allowed to fail. A empty /etc may not
have had the /etc/os-release symlink restored yet and we just
try again in the loop. If for whatever reason that does not happen
then we now pass on 'n/a' instead of null.
2014-10-03 08:31:53 -04:00
Tom Gundersen
7889087d6e man: fix sd_event_set_name compilation 2014-10-03 08:43:53 +02:00
Tom Gundersen
c3b128736d glib-event-glue: remove some unnecessary lines
Not needed in an example. Should still shorten the license, but should make sure it is still complete so people can copy-paste without problems.
2014-10-03 08:43:34 +02:00
Thomas Hindoe Paaboel Andersen
2ad8887a12 test-barrier: add checks after the barrier constructor
Coverity seems to think that we can later end up with the "them"
fd having a negative value. Even after a succesful barrier_create.
Add some test to verify that the constructor went well. If coverity
still complains then it must mean that it thinks the the value is
overwritten later.
2014-10-03 04:04:42 +02:00
Zbigniew Jędrzejewski-Szmek
043f62949e man: add sd_event_set_name(3) 2014-10-02 21:14:26 -04:00
Zbigniew Jędrzejewski-Szmek
ba4b35669e man: add sd_event_get_fd(3)
Example from Tom Gundersen is included using xi:include.
The copyright notice stands out a bit. Maybe it should be removed,
and the code placed in public domain.
2014-10-02 20:49:55 -04:00
Thomas Hindoe Paaboel Andersen
94956f8fba firstboot: silence coverity
CID#1237537
2014-10-02 21:37:33 +02:00
Lennart Poettering
2ff8abbd40 Revert "mount: order options before other arguments to mount"
This reverts commit 141a1ceaa6.

People should fix their libc's getopt(), instead of us using a weird
option ordering...
2014-10-02 21:02:03 +02:00
Lennart Poettering
cc19881a69 systemctl: remove spurious newline 2014-10-02 20:38:00 +02:00
Lennart Poettering
2c652b6bfe kdbus: don't clobber return values, use strjoin() instead of asprintf(), keep function invocations and variable declarations separate 2014-10-02 20:38:00 +02:00
Lennart Poettering
8e00bfc234 kdbus: make sure we never invoke free() on an uninitialized pointer on OOM 2014-10-02 20:38:00 +02:00
Lennart Poettering
c7eff5ec06 update TODO 2014-10-02 20:38:00 +02:00
Tom Gundersen
fe4b215625 sd-dhcp6: do basic sanity-checking of supplied DUID 2014-10-02 19:07:30 +02:00
Tom Gundersen
ebe207d4ac sd-dhcp6: specify the type explicitly when setting custom DUID
This would make it simple to verify that the data is on the right format when
the type is known.
2014-10-02 19:07:30 +02:00
Tom Gundersen
9547267dc5 sd-dhcp6: support custom DUID's up to the size specified in the RFC 2014-10-02 19:07:30 +02:00
Dan Williams
66eac1201a sd-dhcp6-client: support custom DUIDs
The caller may have an existing DUID that it wants to use, and may
want to use some other DUID generation scheme than systemd's
default DUID-EN.

[tomegun: whitespace - we never use tabs]
2014-10-02 19:07:30 +02:00
Daniel Mack
995a1063db sd-bus: sync kdbus.h (ABI break!)
struct kdbus_cmd_match got a flags field, which systemd currently makes no
use of.
2014-10-02 17:15:39 +02:00
Michal Sekletar
893e72da6b virt: detect that we are running inside the docker container 2014-10-02 17:15:17 +02:00
Zbigniew Jędrzejewski-Szmek
aa08982d62 Fix order and document user unit dirs
Fixup for 718880ba0d 'add a transient user unit directory'.
2014-10-02 11:11:31 -04:00
Zbigniew Jędrzejewski-Szmek
4d5dec2389 Rename user_runtime to user_runtime_dir
This makes this function name similar to user_config_home() and makes
it match the name of the environment variable.
2014-10-02 11:10:35 -04:00
Steven Allen
718880ba0d add a transient user unit directory
This patch adds a transient user unit directory under
`$XDG_RUNTIME_DIR/systemd/user/` and stores transient user-instance
units (such as those created by `systemd-run --user`) under there
instead of putting them in $XDG_CONFIG_HOME/systemd/user/.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=67331
2014-10-02 10:37:30 -04:00
Jan Synacek
9fd290443f journalctl: add --utc option
Introduce option to display time in UTC.
2014-10-02 14:52:32 +02:00
Lennart Poettering
b344bcbbfd localectl: always print warnings with log_warning() instead of printf()
They really should got to stderr, not stdout.
2014-10-02 14:39:07 +02:00
Lennart Poettering
63229aa1ab localectl: count locale variables from 0, instead of VARIABLE_LANG
That way the we make our code safe regarding reordering of the variables
in the enum.
2014-10-02 14:39:07 +02:00
Daniel Mack
581fe6c817 sd-bus: sync kdbus.h (ABI break)
struct kdbus_cmd_conn_info takes a list of items now instead of a string.

Fix the only user in SD of that ioctl.
2014-10-02 13:04:04 +02:00
Torstein Husebø
4cf07da260 Correct a few typos 2014-10-02 11:46:23 +02:00
David Herrmann
fc80861622 barrier: fix up constructor error handling
We cannot rely on "errno" to be non-zero on failure, if we perform
multiple glibc calls. That is, if the first eventfd() call fails, but the
second succeeds, we cleanup the barrier but return 0.

Fix this by always testing the return value immediately. This should also
fix all the coverity warnings.
2014-10-02 08:40:43 +02:00
David Herrmann
dda57d9143 terminal: add helpers to retrieve page dimensions
Allow term users to retrieve the page dimensions of a terminal screen.
This is needed to properly calculate the grid dimensions when rendering.
2014-10-02 08:40:43 +02:00
David Herrmann
a30f142513 terminal: add term.h header for library users
Like all the other parts of libsystemd-terminal, split API of
term-internal.h into term.h so we can use it from systemd-consoled.
2014-10-02 08:40:43 +02:00
David Herrmann
056e86ee7f terminal: move unifont-map to datadir
Lets avoid putting stuff into /usr/shared/unifont/, but keep it in
/usr/share/systemd/. Upstream lacks interest in this, so don't bother for
now.
2014-10-02 08:40:43 +02:00
David Herrmann
fa96534573 terminal: add unifont_get_width/height()
Allow unifont users to retrieve the width and height of unifont glyphs. In
version 1 this is hard-coded as 8/16, but may be changed in the future.
2014-10-02 08:40:43 +02:00
David Herrmann
c2977e5cb8 terminal: move unifont-internal.h to unifont.h
All the definitions are for outside users, so drop the -internal suffix.
Internal definitions are in unifont-def.h and unifont.c, no need to share
those.
2014-10-02 08:40:43 +02:00
Simon McVittie
d20a3daaa7 sd-bus: use terms from the D-Bus Specification a bit more
D-Bus' type hierarchy as described in the spec is:

\- basic
   \- fixed type (u, i, etc.)
   \- string-like type (s, o, g)
\- container

Someone seems to have referred to basic types as "simple types" at
some point, but that term isn't defined in the D-Bus Specification,
and seems redundant.

So far I haven't renamed functions that use "trivial" in their names
to mean "fixed type", to avoid confusion about whether a struct of
constant length, like (iu), is a fixed type. The answer is that it is
fixed-length, but is not a "fixed type", so I can see that something
like bus_type_is_fixed() might be ambiguous.
2014-10-02 08:25:21 +02:00
Simon McVittie
e1ffdb90d9 PORTING-DBUS1: we use :1.%llu not :0.%llu for D-Bus unique bus names 2014-10-02 08:25:21 +02:00
Marcel Holtmann
2e3390ea46 hwdb: Update database of Bluetooth company identifiers 2014-10-02 07:53:15 +02:00
Zbigniew Jędrzejewski-Szmek
3018d31238 core/swap: only make configured units part of swap.target
We used to make all .swap units either RequiredBy=swap.target or
WantedBy=swap.target. But swap.target should be the "configured swap
units", either through /etc/fstab or non-generated .swap units. It
is surprising when systemd starts treating a swap device that was
possibly temporarily enabled as a hard dependency for other units.
So do not add dependencies with swap.target for units gleaned from
/proc/swaps.

Similarly, we added dependencies for all aliases of the device name,
which clutters up the dependency graph but does not seem to bring any
value, since the status of those following units is consistent with
the main one anyway.

This should be a fix for [1], and it seems the right thing to do
anyway.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1114786
2014-10-02 00:11:36 -04:00
Thomas Hindoe Paaboel Andersen
cf4acf84c6 Remove repeated includes
In pty.c there was both an include of our pty.h and the system installed pty.h.
The latter contains only two functions openpty and forkpty. We use neither so
I assume it was a typo and removed it. We still compile and pass all tests.
2014-10-01 23:25:50 +02:00
Thomas Hindoe Paaboel Andersen
56a7dd42d3 gitignore: add test-set 2014-10-01 23:24:10 +02:00
Zbigniew Jędrzejewski-Szmek
647f68249f tests: add tests for {hashmap,set}_steal_first
Just to make sure that coverity is wrong.
2014-10-01 09:34:05 -04:00
Zbigniew Jędrzejewski-Szmek
acb3b3ddc0 shared: util - use nicer idiom to silence Coverity
Change the other spot too.
2014-10-01 09:34:05 -04:00
Zbigniew Jędrzejewski-Szmek
9348f0e690 tmpfiles: use allocated buffer for path
Paths can in principle be longer then PATH_MAX, so
simply allocate the buffer with malloc().

CID #1237773
2014-10-01 08:43:09 -04:00
Zbigniew Jędrzejewski-Szmek
fdb14b7ef4 core: limit timestamp to sane precision
Anything below .1 s is meaningless anyway.
2014-10-01 08:34:05 -04:00
Thomas Hindoe Paaboel Andersen
2b01a801f6 test-fileio: Remove dead check
t cannot be null here
2014-09-30 23:40:40 +02:00
Thomas Hindoe Paaboel Andersen
14c35ce7c1 test-date: don't fail test if log_max_level is higher than LOG_INFO 2014-09-30 23:40:40 +02:00
Thomas Hindoe Paaboel Andersen
59ae3a9573 test-path-util: fix a mem leak and avoid confusing coverity
Found with coverity. Fixes CID#1237754 and #1237790
2014-09-30 22:28:46 +02:00