chiark / gitweb /
elogind.git
9 years agoman: move commandline parsing to a separate section
Zbigniew Jędrzejewski-Szmek [Tue, 7 Oct 2014 13:19:24 +0000 (09:19 -0400)]
man: move commandline parsing to a separate section

It is very long already, and obscures the description of
ExecStart, and it is about to get longer.

9 years agobus-proxyd: check return values of getpeercred() and getpeersec()
Daniel Mack [Tue, 7 Oct 2014 10:36:09 +0000 (12:36 +0200)]
bus-proxyd: check return values of getpeercred() and getpeersec()

If we can't get the remote peer or security creds, bail out.

Spotted by coverity.

9 years agosd-bus: check return value of vasprintf
Daniel Mack [Tue, 7 Oct 2014 10:10:06 +0000 (12:10 +0200)]
sd-bus: check return value of vasprintf

Check for OOM situations when vasprintf() returns < 0 in bus_error_setfv().

Spotted by coverity.

9 years agosd-bus: fix KDBUS_CMD_FREE user
Daniel Mack [Tue, 7 Oct 2014 10:02:04 +0000 (12:02 +0200)]
sd-bus: fix KDBUS_CMD_FREE user

Fix a user of the KDBUS_CMD_FREE ioctl that was missed in the transition.

9 years agosd-bus: fix use-after-free in close_kdbus_msg()
Daniel Mack [Tue, 7 Oct 2014 09:32:07 +0000 (11:32 +0200)]
sd-bus: fix use-after-free in close_kdbus_msg()

Walk the items first, then free the memory of the message.

Also, while at it, make coverity happy with an explicit (void) prefix.
We intentionally ignore the return value here.

9 years agokeymap: Fix touchpad toggle key on Asus laptops
Martin Pitt [Tue, 7 Oct 2014 09:22:31 +0000 (11:22 +0200)]
keymap: Fix touchpad toggle key on Asus laptops

https://launchpad.net/bugs/1377352

9 years agokeymap: Fix touchpad toggle on Toshiba Satellite P75-A7200
Martin Pitt [Tue, 7 Oct 2014 09:20:04 +0000 (11:20 +0200)]
keymap: Fix touchpad toggle on Toshiba Satellite P75-A7200

Just like everywhere else we use KEY_F21 instead of KEY_TOUCHPAD_TOGGLE for X
friendliness.

9 years agosd-bus: remove unused variable
Thomas Hindoe Paaboel Andersen [Mon, 6 Oct 2014 21:58:46 +0000 (23:58 +0200)]
sd-bus: remove unused variable

It is no longer used after d663f1b1a92a778bcdc68f29b8c08cb49431b4f7

9 years agosd-bus: sync kdbus.h (ABI break)
Daniel Mack [Mon, 6 Oct 2014 16:36:16 +0000 (18:36 +0200)]
sd-bus: sync kdbus.h (ABI break)

The KDBUS_CMD_FREE ioctl now uses a struct rather than a direct pointer
to the offset to free.

The KDBUS_CMD_MSG_CANCEL ioctl has also changes, but there's no user of
it yet in systemd.

9 years agobuild-sys: use linux/memfd.h if available
Zbigniew Jędrzejewski-Szmek [Sun, 5 Oct 2014 22:41:31 +0000 (18:41 -0400)]
build-sys: use linux/memfd.h if available

linux/memfd.h was added linux 3.17, so it might not be widely
available for a while.

Also, check if memfd_create is defined, for the HAVE_LINUX_MEMFD_H
check to have a chance of succeeding.

Also, collapse all ifdefs for memfd-related stuff, because they
were all added together so there's no need to check separately.

9 years agoterminal: remove an unused initialization
Thomas Hindoe Paaboel Andersen [Sun, 5 Oct 2014 20:33:20 +0000 (22:33 +0200)]
terminal: remove an unused initialization

9 years agoUpdate TODO
Zbigniew Jędrzejewski-Szmek [Sun, 5 Oct 2014 19:29:20 +0000 (15:29 -0400)]
Update TODO

9 years agoask-password: Add --echo to enable echoing the user input
David Sommerseth [Fri, 3 Oct 2014 13:53:45 +0000 (15:53 +0200)]
ask-password: Add --echo to enable echoing the user input

Programs such as OpenVPN may use ask-password for not only retrieving
passwords, but also usernames.  Masking usernames with * seems just silly.

 v2 - Don't mess with termios flags, instead print the input
      instead of an asterix.  Resolves issues with backspace
      and TAB input.

 v3 - Renamed 'do_echo' variables and argument to 'echo'.  Also
      modified the ask_password_{tty,agent,auto} API instead of
      additional wrapper functions.

[zj: undo changes to ask_password_auto, since no callers were using
     the new argument.]

9 years agobus: add assert to check that we're not freeing a static structure
Zbigniew Jędrzejewski-Szmek [Sun, 5 Oct 2014 18:04:02 +0000 (14:04 -0400)]
bus: add assert to check that we're not freeing a static structure

CID #996315.

9 years agoterminal/idev: don't remove consumed-mods from kbd-matches
David Herrmann [Sun, 5 Oct 2014 15:44:09 +0000 (17:44 +0200)]
terminal/idev: don't remove consumed-mods from kbd-matches

XKB consumed mods include modifiers that *didn't* affect the translation,
but might affect it if used. This is very misleading, given that we are
usually not interested in that information. Therefore, keep them in real
mods to behave like X11 does. Maybe at some point, XKB introduces proper
shortcut matching...

Also make evcat display consumed modifiers so we can better debug those
situations.

9 years agoterminal/screen: perform bold->light conversion only on foreground
David Herrmann [Sun, 5 Oct 2014 13:49:26 +0000 (15:49 +0200)]
terminal/screen: perform bold->light conversion only on foreground

Bold glyphs always use light colors. However, this color conversion is
limited to the foreground color, so skip it for backgrounds.

9 years agoterminal/subterm: leave bold-light conversion to parent
David Herrmann [Sun, 5 Oct 2014 13:48:32 +0000 (15:48 +0200)]
terminal/subterm: leave bold-light conversion to parent

We rely on the parent terminal to do color conversion, so also leave
bold->light conversion to the parent. Otherwise, it will be performed
twice and we might apply it on the wrong color.

9 years agoterminal/screen: add support for alternate screen buffers
Tom Gundersen [Sun, 5 Oct 2014 13:26:54 +0000 (15:26 +0200)]
terminal/screen: add support for alternate screen buffers

Hook up SM/RM 47/1047-1049 and enable alternate screen buffers for term
applications.

(David: rebased on top of -git, renamed helpers and added docs)

9 years agoterminal/screen: save state in separate object
David Herrmann [Sun, 5 Oct 2014 12:53:18 +0000 (14:53 +0200)]
terminal/screen: save state in separate object

Terminal state can be saved/restored by applications. To simplify our
internal handling, put all affected state into a separate object.
Especially with alternate screen buffers, this will simplify our code
significantly.

9 years agoterminal/subterm: skip setting parent's cursor
David Herrmann [Sun, 5 Oct 2014 12:47:57 +0000 (14:47 +0200)]
terminal/subterm: skip setting parent's cursor

We draw our own cursor in subterm now, so there's no reason to update the
cursor-position of the parent terminal on each frame. The parent's cursor
is hidden, anyway.

9 years agoterminal: fix TERM_FLAG_* comment
David Herrmann [Sun, 5 Oct 2014 12:45:33 +0000 (14:45 +0200)]
terminal: fix TERM_FLAG_* comment

7BIT mode is enabled by default. Fix the comment to state this correctly.

9 years agoterminal: fix restoring of screen flags
Tom Gundersen [Sat, 4 Oct 2014 21:03:15 +0000 (23:03 +0200)]
terminal: fix restoring of screen flags

9 years agotest: only use assert_se
Thomas Hindoe Paaboel Andersen [Sat, 4 Oct 2014 21:51:45 +0000 (23:51 +0200)]
test: only use assert_se

The asserts used in the tests should never be allowed to be
optimized away

9 years agoconsoled: add a unit file
Tom Gundersen [Sat, 4 Oct 2014 11:10:41 +0000 (13:10 +0200)]
consoled: add a unit file

The unit file is statically enabled, but still requires --enable-terminal
to actually get installed.

9 years agoconsoled: move from /bin to /lib/systemd
Tom Gundersen [Sat, 4 Oct 2014 11:12:49 +0000 (13:12 +0200)]
consoled: move from /bin to /lib/systemd

This should not normally be run manually, but rather through systemd.

9 years agosystemd-bus-proxyd: distribute the .in file also for the user version
Tom Gundersen [Sat, 4 Oct 2014 11:11:40 +0000 (13:11 +0200)]
systemd-bus-proxyd: distribute the .in file also for the user version

9 years agobuild-sys: fix make distcheck
Zbigniew Jędrzejewski-Szmek [Sat, 4 Oct 2014 02:08:23 +0000 (22:08 -0400)]
build-sys: fix make distcheck

9 years agoman: say that SecureBits= are space separated
Zbigniew Jędrzejewski-Szmek [Sat, 4 Oct 2014 01:06:52 +0000 (21:06 -0400)]
man: say that SecureBits= are space separated

9 years agosd-id128: do stricter checking of random boot id
Zbigniew Jędrzejewski-Szmek [Sat, 4 Oct 2014 00:57:30 +0000 (20:57 -0400)]
sd-id128: do stricter checking of random boot id

If we are bothering to check whether the kernel is not feeding us
bad data, we might as well do it properly.

CID #1237692.

9 years agofstab-generator: Small cleanup
Tobias Hunger [Sat, 4 Oct 2014 00:41:43 +0000 (20:41 -0400)]
fstab-generator: Small cleanup

9 years agosd-bus: split out cleanup into separate function
Zbigniew Jędrzejewski-Szmek [Fri, 3 Oct 2014 23:47:47 +0000 (19:47 -0400)]
sd-bus: split out cleanup into separate function

m is always non-null at this point. This function is too long anyway.

9 years agocore/namespace: remove invalid check
Zbigniew Jędrzejewski-Szmek [Fri, 3 Oct 2014 23:17:56 +0000 (19:17 -0400)]
core/namespace: remove invalid check

dir cannot be NULL here, because it was allocated with alloca.

CID #1237768.

9 years agocore/namespace: remove invalid check
Zbigniew Jędrzejewski-Szmek [Fri, 3 Oct 2014 23:16:11 +0000 (19:16 -0400)]
core/namespace: remove invalid check

root cannot be NULL here, because it was allocated with alloca.

CID #1237769.

9 years agosd-event: check the value of received signal
Zbigniew Jędrzejewski-Szmek [Fri, 3 Oct 2014 22:49:45 +0000 (18:49 -0400)]
sd-event: check the value of received signal

Appease coverity report #1237775.

Also rename ss to n, to make it visually different from ss.

9 years agoman: use more markup in daemon(7)
Zbigniew Jędrzejewski-Szmek [Fri, 3 Oct 2014 21:44:23 +0000 (17:44 -0400)]
man: use more markup in daemon(7)

9 years agoconsole: add user console daemon
David Herrmann [Fri, 3 Oct 2014 13:58:44 +0000 (15:58 +0200)]
console: add user console daemon

This adds a first draft of systemd-consoled. This is still missing a lot
of features and does some rather primitive rendering. However, it shows
the direction this code is going and serves as basis for further testing.

The systemd-consoled binary should be run as `systemd --user' unit. It
automatically picks up any session marked as Desktop=SYSTEMD-CONSOLE.
Therefore, you can use any login-manager you want (ranging from /bin/login
to gdm) to create sessions for systemd-consoled. However, the sessions
managers must be prepared to set the Desktop= variable properly.

The user-session is called `systemd-console', only the daemon providing
the terminal environment is called `systemd-consoled' (mind the 'd').

So far, only a single terminal session is provided on each opened
user-session. However, we support multiple user-sessions (even across
multiple seats) just fine. In the future, the workspace logic will get
extended so you can have multiple terminal sessions in a single
user-session for easier access.

Note that this is still experimental! Instructions on how to run it will
follow shortly.

9 years agopty: optimize read loop
David Herrmann [Fri, 3 Oct 2014 13:54:21 +0000 (15:54 +0200)]
pty: optimize read loop

As it turns out, I can actually send data to the pty faster than the
terminal can read. Therefore, make sure we read as much data as possible
but bail out early enough to not cause starvation.

Kernel TTY buffers are 4k, so reduce the overall buffer size, but read
more than once if possible (up to 8 times sounds reasonable).

9 years agoterminal/screen: adjust screen age only on update
David Herrmann [Fri, 3 Oct 2014 13:27:25 +0000 (15:27 +0200)]
terminal/screen: adjust screen age only on update

Instead of increasing the screen-age on redraw, we now increase it only on
real updates. This is effectively the same, but avoids increased age
counters on backbuffer rendering. Therefore, we can now check age counters
against fronbuffers safely, while rendering frames in background.

9 years agoterminal/screen: add color converter
David Herrmann [Fri, 3 Oct 2014 12:44:41 +0000 (14:44 +0200)]
terminal/screen: add color converter

Terminals use pseudo color-codes mixed with 8bit and 24bit colors. Provide
a color-converter so external renderers only have to deal with ARGB32
colors.

This requires a color-palette as input as there's no fixed mapping. We
provide a default, but maybe we wanna support external palettes in the
future.

9 years agoterminal/screen: add cursor rendering
David Herrmann [Fri, 3 Oct 2014 12:42:42 +0000 (14:42 +0200)]
terminal/screen: add cursor rendering

This is the most simple way to render cursors: flip attr->inverse of the
cursor cell. This causes the background and foreground colors of the
cursor-cell to be inversed.

Now that we render cursors ourselves, make subterm not call into the
parent terminal to render cursors.

9 years agoterminal/screen: mark cursor dirty on enabled/disable
David Herrmann [Fri, 3 Oct 2014 12:30:37 +0000 (14:30 +0200)]
terminal/screen: mark cursor dirty on enabled/disable

If we hide or show the cursor, we change visual attributes and have to
mark the underlying cell as dirty. Otherwise, the terminal will not be
redrawn.

9 years agoterminal/idev: add helper to match keyboard shortcuts
David Herrmann [Fri, 3 Oct 2014 11:11:08 +0000 (13:11 +0200)]
terminal/idev: add helper to match keyboard shortcuts

Matching keyboard shortcuts on internationalized keyboards is actually
non-trivial. Matching the actual key is easy, but the modifiers can be
used by both, the matching and the translation step. Therefore, XKB
exports "consumed-modifiers" that we use to figure out whether a modifier
was already used by the translation step.

The new IDEV_KBDMATCH() helper can be used to match on any keyboard
shortcut and it will do the right thing.

9 years agoterminal/screen: add keyboard mapping
David Herrmann [Fri, 3 Oct 2014 10:50:41 +0000 (12:50 +0200)]
terminal/screen: add keyboard mapping

Implement the feed_keyboard() handling by mapping XKB keys according to
DEC-VT behavior.

Public information on terminal key-mappings is pretty scarce. We only
implement the most basic mapping for now. Further improvements welcome!

9 years agoterminal/idev: don't map XKB_KEY_NoSymbol as ASCII 0
David Herrmann [Fri, 3 Oct 2014 10:48:36 +0000 (12:48 +0200)]
terminal/idev: don't map XKB_KEY_NoSymbol as ASCII 0

XKB_KEY_NoSymbol is defined as 0 but does not correspond to a VT key with
ASCII value 0. No such key exists, so don't try to find such a key.

9 years agoterminal/unifont: add built-in fallback glyph
David Herrmann [Thu, 2 Oct 2014 17:47:21 +0000 (19:47 +0200)]
terminal/unifont: add built-in fallback glyph

In case we cannot render a glyph, we want a fallback we can display
instead. If we rely on the font itself to provide the fallback character,
we have nothing to display if that character is not available. Therefore,
add a static fallback that we can use at any time.

9 years agoterminal/subterm: use screen renderer
David Herrmann [Thu, 2 Oct 2014 17:34:14 +0000 (19:34 +0200)]
terminal/subterm: use screen renderer

Don't hard-code the screen renderer but use the newly introduced
term_screen_draw() helper.

9 years agoterminal: add screen renderer
David Herrmann [Thu, 2 Oct 2014 17:31:43 +0000 (19:31 +0200)]
terminal: add screen renderer

We don't want to expose the term_screen internals for rendering.
Therefore, provide an iterator that allows external renderers to draw
terminals.

9 years agoterminal/drm: clear 'applied' flag when changing state
David Herrmann [Thu, 2 Oct 2014 16:51:29 +0000 (18:51 +0200)]
terminal/drm: clear 'applied' flag when changing state

If a pipe is enabled/disabled, we have to clear crtc->applied of the
linked CRTC. Otherwise, we will not run a deep modeset, but leave the crtc
in the pre-configured state.

9 years agoterminal/grdev: allow arbitrary fb-age contexts
David Herrmann [Thu, 2 Oct 2014 16:47:01 +0000 (18:47 +0200)]
terminal/grdev: allow arbitrary fb-age contexts

Instead of limiting fb-aging to 64bit integers, allow any arbitrary
context together with a release function to free it once the FB is
destroyed.

9 years agoterminal/grdev: provide front and back buffer to renderers
David Herrmann [Thu, 2 Oct 2014 16:26:06 +0000 (18:26 +0200)]
terminal/grdev: provide front and back buffer to renderers

We really want more sophisticated aging than just 64bit integers. So
always provide front *and* back buffers to renderers so they can compare
arbitrary aging information and decide whether to re-render.

9 years agoterminal/drm: provide pipe->target() callback
David Herrmann [Thu, 2 Oct 2014 15:59:26 +0000 (17:59 +0200)]
terminal/drm: provide pipe->target() callback

Instead of looking for available back-buffers on each operation, set it to
NULL and wait for the next frame request. It will call back into the pipe
to request the back-buffer via ->target(), where we can do the same and
look for an available backbuffer.

This simplifies the code and avoids double lookups if we run short of
buffers.

9 years agoterminal/grdev: simplify DRM event parsing
David Herrmann [Thu, 2 Oct 2014 15:09:05 +0000 (17:09 +0200)]
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.

9 years agoterminal: make utf8 decoder return length
David Herrmann [Thu, 2 Oct 2014 14:36:09 +0000 (16:36 +0200)]
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.

9 years agoterminal: fix back-buffer selection on DRM page-flip
David Herrmann [Thu, 2 Oct 2014 11:11:53 +0000 (13:11 +0200)]
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.

9 years agofileio-label: return error when writing fails
Zbigniew Jędrzejewski-Szmek [Fri, 3 Oct 2014 12:58:40 +0000 (08:58 -0400)]
fileio-label: return error when writing fails

The status of actually writing the file was totally ignored.

9 years agojournalctl: make --utc work everywhere
Jan Synacek [Fri, 3 Oct 2014 07:51:33 +0000 (09:51 +0200)]
journalctl: make --utc work everywhere

The --utc option was introduced by commit
9fd290443f5f99fca0dcd4216b1de70f7d3b8db1.
Howerver, the implementation was incomplete.

9 years agobootchart: use 'n/a' if PRETTY_NAME is not found
Thomas Hindoe Paaboel Andersen [Fri, 26 Sep 2014 20:01:32 +0000 (22:01 +0200)]
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.

9 years agoman: fix sd_event_set_name compilation
Tom Gundersen [Fri, 3 Oct 2014 06:43:53 +0000 (08:43 +0200)]
man: fix sd_event_set_name compilation

9 years agoglib-event-glue: remove some unnecessary lines
Tom Gundersen [Fri, 3 Oct 2014 06:43:34 +0000 (08:43 +0200)]
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.

9 years agotest-barrier: add checks after the barrier constructor
Thomas Hindoe Paaboel Andersen [Fri, 3 Oct 2014 01:58:51 +0000 (03:58 +0200)]
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.

9 years agoman: add sd_event_set_name(3)
Zbigniew Jędrzejewski-Szmek [Fri, 3 Oct 2014 01:14:26 +0000 (21:14 -0400)]
man: add sd_event_set_name(3)

9 years agoman: add sd_event_get_fd(3)
Zbigniew Jędrzejewski-Szmek [Fri, 3 Oct 2014 00:49:30 +0000 (20:49 -0400)]
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.

9 years agofirstboot: silence coverity
Thomas Hindoe Paaboel Andersen [Thu, 2 Oct 2014 19:26:11 +0000 (21:26 +0200)]
firstboot: silence coverity

CID#1237537

9 years agoRevert "mount: order options before other arguments to mount"
Lennart Poettering [Thu, 2 Oct 2014 19:02:03 +0000 (21:02 +0200)]
Revert "mount: order options before other arguments to mount"

This reverts commit 141a1ceaa62578f1ed14f04cae2113dd0f49fd7f.

People should fix their libc's getopt(), instead of us using a weird
option ordering...

9 years agosystemctl: remove spurious newline
Lennart Poettering [Thu, 2 Oct 2014 18:37:50 +0000 (20:37 +0200)]
systemctl: remove spurious newline

9 years agokdbus: don't clobber return values, use strjoin() instead of asprintf(), keep functio...
Lennart Poettering [Thu, 2 Oct 2014 18:37:36 +0000 (20:37 +0200)]
kdbus: don't clobber return values, use strjoin() instead of asprintf(), keep function invocations and variable declarations separate

9 years agokdbus: make sure we never invoke free() on an uninitialized pointer on OOM
Lennart Poettering [Thu, 2 Oct 2014 18:36:58 +0000 (20:36 +0200)]
kdbus: make sure we never invoke free() on an uninitialized pointer on OOM

9 years agoupdate TODO
Lennart Poettering [Thu, 2 Oct 2014 18:36:23 +0000 (20:36 +0200)]
update TODO

9 years agosd-dhcp6: do basic sanity-checking of supplied DUID
Tom Gundersen [Thu, 2 Oct 2014 14:25:08 +0000 (16:25 +0200)]
sd-dhcp6: do basic sanity-checking of supplied DUID

9 years agosd-dhcp6: specify the type explicitly when setting custom DUID
Tom Gundersen [Thu, 2 Oct 2014 14:04:20 +0000 (16:04 +0200)]
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.

9 years agosd-dhcp6: support custom DUID's up to the size specified in the RFC
Tom Gundersen [Thu, 2 Oct 2014 14:00:55 +0000 (16:00 +0200)]
sd-dhcp6: support custom DUID's up to the size specified in the RFC

9 years agosd-dhcp6-client: support custom DUIDs
Dan Williams [Fri, 26 Sep 2014 20:12:36 +0000 (15:12 -0500)]
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]

9 years agosd-bus: sync kdbus.h (ABI break!)
Daniel Mack [Thu, 2 Oct 2014 15:12:13 +0000 (17:12 +0200)]
sd-bus: sync kdbus.h (ABI break!)

struct kdbus_cmd_match got a flags field, which systemd currently makes no
use of.

9 years agovirt: detect that we are running inside the docker container
Michal Sekletar [Tue, 9 Sep 2014 16:14:25 +0000 (18:14 +0200)]
virt: detect that we are running inside the docker container

9 years agoFix order and document user unit dirs
Zbigniew Jędrzejewski-Szmek [Thu, 2 Oct 2014 12:11:21 +0000 (08:11 -0400)]
Fix order and document user unit dirs

Fixup for 718880ba0d 'add a transient user unit directory'.

9 years agoRename user_runtime to user_runtime_dir
Zbigniew Jędrzejewski-Szmek [Thu, 2 Oct 2014 12:01:00 +0000 (08:01 -0400)]
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.

9 years agoadd a transient user unit directory
Steven Allen [Sun, 28 Sep 2014 21:54:25 +0000 (14:54 -0700)]
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

9 years agojournalctl: add --utc option
Jan Synacek [Thu, 2 Oct 2014 12:39:29 +0000 (14:39 +0200)]
journalctl: add --utc option

Introduce option to display time in UTC.

9 years agolocalectl: always print warnings with log_warning() instead of printf()
Lennart Poettering [Thu, 2 Oct 2014 12:35:34 +0000 (14:35 +0200)]
localectl: always print warnings with log_warning() instead of printf()

They really should got to stderr, not stdout.

9 years agolocalectl: count locale variables from 0, instead of VARIABLE_LANG
Lennart Poettering [Thu, 2 Oct 2014 12:34:55 +0000 (14:34 +0200)]
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.

9 years agosd-bus: sync kdbus.h (ABI break)
Daniel Mack [Thu, 2 Oct 2014 11:02:41 +0000 (13:02 +0200)]
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.

9 years agoCorrect a few typos
Torstein Husebø [Tue, 30 Sep 2014 13:25:47 +0000 (15:25 +0200)]
Correct a few typos

9 years agobarrier: fix up constructor error handling
David Herrmann [Thu, 2 Oct 2014 06:31:28 +0000 (08:31 +0200)]
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.

9 years agoterminal: add helpers to retrieve page dimensions
David Herrmann [Wed, 1 Oct 2014 09:29:09 +0000 (11:29 +0200)]
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.

9 years agoterminal: add term.h header for library users
David Herrmann [Wed, 1 Oct 2014 09:27:46 +0000 (11:27 +0200)]
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.

9 years agoterminal: move unifont-map to datadir
David Herrmann [Wed, 1 Oct 2014 09:25:27 +0000 (11:25 +0200)]
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.

9 years agoterminal: add unifont_get_width/height()
David Herrmann [Wed, 1 Oct 2014 09:24:08 +0000 (11:24 +0200)]
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.

9 years agoterminal: move unifont-internal.h to unifont.h
David Herrmann [Wed, 1 Oct 2014 09:23:02 +0000 (11:23 +0200)]
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.

9 years agosd-bus: use terms from the D-Bus Specification a bit more
Simon McVittie [Wed, 1 Oct 2014 15:11:59 +0000 (16:11 +0100)]
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.

9 years agoPORTING-DBUS1: we use :1.%llu not :0.%llu for D-Bus unique bus names
Simon McVittie [Wed, 1 Oct 2014 15:12:00 +0000 (16:12 +0100)]
PORTING-DBUS1: we use :1.%llu not :0.%llu for D-Bus unique bus names

9 years agohwdb: Update database of Bluetooth company identifiers
Marcel Holtmann [Thu, 2 Oct 2014 05:53:15 +0000 (07:53 +0200)]
hwdb: Update database of Bluetooth company identifiers

9 years agocore/swap: only make configured units part of swap.target
Zbigniew Jędrzejewski-Szmek [Thu, 2 Oct 2014 04:11:36 +0000 (00:11 -0400)]
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

9 years agoRemove repeated includes
Thomas Hindoe Paaboel Andersen [Wed, 1 Oct 2014 21:15:34 +0000 (23:15 +0200)]
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.

9 years agogitignore: add test-set
Thomas Hindoe Paaboel Andersen [Wed, 1 Oct 2014 21:22:02 +0000 (23:22 +0200)]
gitignore: add test-set

9 years agotests: add tests for {hashmap,set}_steal_first
Zbigniew Jędrzejewski-Szmek [Wed, 1 Oct 2014 13:32:16 +0000 (09:32 -0400)]
tests: add tests for {hashmap,set}_steal_first

Just to make sure that coverity is wrong.

9 years agoshared: util - use nicer idiom to silence Coverity
Zbigniew Jędrzejewski-Szmek [Tue, 30 Sep 2014 11:44:04 +0000 (07:44 -0400)]
shared: util - use nicer idiom to silence Coverity

Change the other spot too.

9 years agotmpfiles: use allocated buffer for path
Zbigniew Jędrzejewski-Szmek [Wed, 1 Oct 2014 12:33:22 +0000 (07:33 -0500)]
tmpfiles: use allocated buffer for path

Paths can in principle be longer then PATH_MAX, so
simply allocate the buffer with malloc().

CID #1237773

9 years agocore: limit timestamp to sane precision
Zbigniew Jędrzejewski-Szmek [Wed, 1 Oct 2014 12:34:05 +0000 (07:34 -0500)]
core: limit timestamp to sane precision

Anything below .1 s is meaningless anyway.

9 years agotest-fileio: Remove dead check
Thomas Hindoe Paaboel Andersen [Tue, 30 Sep 2014 21:37:10 +0000 (23:37 +0200)]
test-fileio: Remove dead check

t cannot be null here

9 years agotest-date: don't fail test if log_max_level is higher than LOG_INFO
Thomas Hindoe Paaboel Andersen [Tue, 30 Sep 2014 21:30:30 +0000 (23:30 +0200)]
test-date: don't fail test if log_max_level is higher than LOG_INFO