summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2014-10-09sd-bus: check return value of asprintf()Daniel Mack
Check for OOM conditions of asprintf() in bus_set_address_user().
2014-10-08systemctl: suggest -xe not -xnZbigniew Jędrzejewski-Szmek
https://bugzilla.redhat.com/show_bug.cgi?id=1150289
2014-10-08sd-event: also update signal mask when disconnecting sourcesZbigniew Jędrzejewski-Szmek
2014-10-08sd-event: be more careful when enabling/disabling signalsZbigniew Jędrzejewski-Szmek
When a child event is disabled (in order to be freed) and there is no SIGCHLD signal event, sd_event_source_set_enabled will disable SIGCHLD even if there are other child events. Also remove some unneeded signalfd updates. https://bugs.freedesktop.org/show_bug.cgi?id=84659 Based-on-a-patch-by: Hristo Venev <mustrumr97@gmail.com>
2014-10-09util: avoid double close of fdThomas Hindoe Paaboel Andersen
We could end with a double close if we close the fd loop and flush_fd fails. That would make us goto fail and there we close the fd once again. This patch sets the fd to the return value for safe_close: -1 A fd with negative value will be ignored by the next call to safe_close. CID#996223
2014-10-08time: functions named "internal" really shouldn't be exportedLennart Poettering
Also, let's try to make function names descriptive, instead of using bools for flags.
2014-10-08core: map the 'rescue' argument to rescue.targetMantas Mikulėnas
Even though the 'emergency' and 'single' aliases come from sysvinit, the lack of 'rescue' is still quite confusing (caught me by surprise for the 9th time yet) and inconsistent with `systemctl rescue` as well.
2014-10-08sd-bus: sync kdbus.h (ABI break)Daniel Mack
Sync kdbus.h once again. Two thing have changed: a) KDBUS_CMD_EP_* was renamed to KDBUS_CMD_ENDPOINT_* b) struct kdbus_cmd_hello and struct kdbus_cmd_make gained a 'features' bitfield (which is currently unused)
2014-10-08nspawn: copy /dev/net/tun from hostTom Gundersen
This enables tuntap support in the container (assumning the necessary capabilities are in place).
2014-10-08systemctl: add add-wants and add-requires verbsLukas Nykryn
2014-10-08unit: move UnitDependency to unit-nameLukas Nykryn
2014-10-07core: don't allow enabling if unit is maskedJan Synacek
2014-10-07bus-proxyd: assorted cleanups and fixesDaniel Mack
Just some cleanups around policy checks that came up during review. The code is still not productive.
2014-10-07bus-proxyd: check return values of getpeercred() and getpeersec()Daniel Mack
If we can't get the remote peer or security creds, bail out. Spotted by coverity.
2014-10-07sd-bus: check return value of vasprintfDaniel Mack
Check for OOM situations when vasprintf() returns < 0 in bus_error_setfv(). Spotted by coverity.
2014-10-07sd-bus: fix KDBUS_CMD_FREE userDaniel Mack
Fix a user of the KDBUS_CMD_FREE ioctl that was missed in the transition.
2014-10-07sd-bus: fix use-after-free in close_kdbus_msg()Daniel Mack
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.
2014-10-07sd-bus: remove unused variableThomas Hindoe Paaboel Andersen
It is no longer used after d663f1b1a92a778bcdc68f29b8c08cb49431b4f7
2014-10-06sd-bus: sync kdbus.h (ABI break)Daniel Mack
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.
2014-10-05build-sys: use linux/memfd.h if availableZbigniew Jędrzejewski-Szmek
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.
2014-10-05terminal: remove an unused initializationThomas Hindoe Paaboel Andersen
2014-10-05ask-password: Add --echo to enable echoing the user inputDavid Sommerseth
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.]
2014-10-05bus: add assert to check that we're not freeing a static structureZbigniew Jędrzejewski-Szmek
CID #996315.
2014-10-05terminal/idev: don't remove consumed-mods from kbd-matchesDavid Herrmann
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.
2014-10-05terminal/screen: perform bold->light conversion only on foregroundDavid Herrmann
Bold glyphs always use light colors. However, this color conversion is limited to the foreground color, so skip it for backgrounds.
2014-10-05terminal/subterm: leave bold-light conversion to parentDavid Herrmann
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.
2014-10-05terminal/screen: add support for alternate screen buffersTom Gundersen
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)
2014-10-05terminal/screen: save state in separate objectDavid Herrmann
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.
2014-10-05terminal/subterm: skip setting parent's cursorDavid Herrmann
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.
2014-10-05terminal: fix TERM_FLAG_* commentDavid Herrmann
7BIT mode is enabled by default. Fix the comment to state this correctly.
2014-10-05terminal: fix restoring of screen flagsTom Gundersen
2014-10-04test: only use assert_seThomas Hindoe Paaboel Andersen
The asserts used in the tests should never be allowed to be optimized away
2014-10-03sd-id128: do stricter checking of random boot idZbigniew Jędrzejewski-Szmek
If we are bothering to check whether the kernel is not feeding us bad data, we might as well do it properly. CID #1237692.
2014-10-03fstab-generator: Small cleanupTobias Hunger
2014-10-03sd-bus: split out cleanup into separate functionZbigniew Jędrzejewski-Szmek
m is always non-null at this point. This function is too long anyway.
2014-10-03core/namespace: remove invalid checkZbigniew Jędrzejewski-Szmek
dir cannot be NULL here, because it was allocated with alloca. CID #1237768.
2014-10-03core/namespace: remove invalid checkZbigniew Jędrzejewski-Szmek
root cannot be NULL here, because it was allocated with alloca. CID #1237769.
2014-10-03sd-event: check the value of received signalZbigniew Jędrzejewski-Szmek
Appease coverity report #1237775. Also rename ss to n, to make it visually different from ss.
2014-10-03console: add user console daemonDavid Herrmann
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.
2014-10-03pty: optimize read loopDavid Herrmann
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).
2014-10-03terminal/screen: adjust screen age only on updateDavid Herrmann
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.
2014-10-03terminal/screen: add color converterDavid Herrmann
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.
2014-10-03terminal/screen: add cursor renderingDavid Herrmann
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.
2014-10-03terminal/screen: mark cursor dirty on enabled/disableDavid Herrmann
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.
2014-10-03terminal/idev: add helper to match keyboard shortcutsDavid Herrmann
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.
2014-10-03terminal/screen: add keyboard mappingDavid Herrmann
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!
2014-10-03terminal/idev: don't map XKB_KEY_NoSymbol as ASCII 0David Herrmann
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.
2014-10-03terminal/unifont: add built-in fallback glyphDavid Herrmann
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.
2014-10-03terminal/subterm: use screen rendererDavid Herrmann
Don't hard-code the screen renderer but use the newly introduced term_screen_draw() helper.
2014-10-03terminal: add screen rendererDavid Herrmann
We don't want to expose the term_screen internals for rendering. Therefore, provide an iterator that allows external renderers to draw terminals.