Commit Graph

88 Commits

Author SHA1 Message Date
Lennart Poettering 6524990fdc logind: support for hybrid sleep (i.e. suspend+hibernate at the same time) 2012-10-28 00:50:35 +02:00
Lennart Poettering e8988fc2a2 util: return the remaining string in startswith() 2012-10-27 01:20:01 +02:00
Kay Sievers 1c574591db udev: hwdb - remove run_once 2012-10-25 21:44:33 +02:00
Kay Sievers a9e12476ed util: add (x)bsearch_r(), the missing counterpart of qsort_r() 2012-10-22 14:31:46 +02:00
Lennart Poettering 8c7c140fca util: change endswith() to return a pointer to the suffix 2012-10-19 04:53:46 +02:00
Lennart Poettering ed757c0cb0 util: unify line caching and column caching 2012-10-19 00:07:55 +02:00
Lennart Poettering 8481248b9f util: unify usage of on_tty() in util.c 2012-10-19 00:07:55 +02:00
Lennart Poettering 28917d7dc7 util: simplify column caching logic 2012-10-19 00:07:55 +02:00
Lennart Poettering 01539d6ef9 hostnamed: allow UTF8 chars in pretty hostname again 2012-10-17 21:25:42 +02:00
Lennart Poettering 6d0274f115 timedatectl: introduce new command line client for timedated
Much like logind has a client in loginctl, and journald in journalctl
introduce timedatectl, to change the system time (incl. RTC), timezones
and related settings.
2012-10-17 21:25:42 +02:00
Lennart Poettering b1c806231b util: properly handle -1 timespec/timeval 2012-10-16 01:04:32 +02:00
Lennart Poettering cfbc22abd0 journalctl: implement --since= and --until for filtering by time 2012-10-11 16:43:37 +02:00
Martin Mikkelsen 011afa76fb shared: fix broken string_is_safe 2012-10-08 14:35:46 +02:00
Lennart Poettering 0b507b17a7 dbus: add some more safety checks before accepting data from bus clients 2012-10-03 13:29:20 -04:00
Lennart Poettering 08ace05beb logs-show: various cleanups
Among other cleanups this introduces a threshold for the size of binary
blobs we serialize as integer arrays in the JSON output. THis can be
disabled via --all.
2012-09-28 00:55:24 +02:00
Lennart Poettering 9086e840ff util: don't export parsed_columns 2012-09-24 14:43:07 +02:00
Dave Reisner 585314e84c journalctl: reset cached column count on SIGWINCH
This requires a little bit of tip-toeing around to explicitly avoid
touching the environment from a sig handler. Instead, simply create a
function to reset the var to its "unset" state, allowing the next call
to columns() to recalculate and cache the new value.
2012-09-24 08:38:03 -04:00
Lukas Nykryn e98055de98 shared: call va_end in all cases 2012-09-21 12:07:41 +02:00
Lennart Poettering aa408e7799 util: fix overflow checks 2012-09-20 17:53:03 +02:00
Lennart Poettering 040f18ea8a util: overflow hardening 2012-09-20 11:08:27 +02:00
Lennart Poettering 7d5e9c0f60 util: define union dirent_storage and make use of it everywhere
Make sure to allocate enough space for readdir_r().

https://bugzilla.redhat.com/show_bug.cgi?id=858754
2012-09-19 22:21:09 +02:00
Lennart Poettering 57f3067825 util: fix bad strstrip() return value in normalize_env_assignment()
https://bugzilla.redhat.com/show_bug.cgi?id=858780
2012-09-19 22:01:31 +02:00
Lennart Poettering 901c3d0d85 util: introduce get_process_gid() 2012-09-18 01:53:15 +02:00
Lennart Poettering faa368e337 conf-parser: don't unescape parsed configuration strings by default
In many cases this might have a negative effect since we drop escaping
from strings where we better shouldn't have dropped it.

If unescaping makes sense for some settings we can readd it later again,
on a per-case basis.

https://bugs.freedesktop.org/show_bug.cgi?id=54522
2012-09-17 21:58:03 +02:00
Lennart Poettering 669bec5d17 util: various cleanups for printing boot status 2012-09-17 19:05:32 +02:00
Zbigniew Jędrzejewski-Szmek 25ea79fe07 nspawn: use automatic cleanup for umask 2012-09-16 16:20:09 +02:00
Lennart Poettering 424a19f8a2 timedate: assorted improvements
- Make writing/reading of /etc/timezone dependendent of HAVE_SYSV_COMPAT

- Introduce symlink_atomic() after all, and use it

- Use relative symlink for /etc/localtime
2012-09-14 20:02:52 +02:00
Lennart Poettering 73836c5c43 util: more modernizations 2012-09-14 10:36:50 +02:00
Lennart Poettering a05f97b3ac util: various additional modernizations 2012-09-14 10:24:27 +02:00
Lennart Poettering e67f47e55b util: modernize a few functions with automatic cleanup variables
Just trying to get the feel for it. And it's pretty cool.
2012-09-14 10:06:42 +02:00
Lennart Poettering 2fbe635a83 macro: introduce _cleanup_free_ macro for automatic freeing of scoped vars and make use of it 2012-09-13 22:30:26 +02:00
Tom Gundersen b3d284696c util: rm_rf_children_dangerous: delete all descendants dangerously
Call rm_rf_children_dangerous() recursively rather than falling back to
rm_rf_children(). This fixes a bug in systemd-tmpfiles.

The problem can easily be reproduced by:

  # mount /dev/sda1 /mnt
  # mkdir /mnt/test
  # echo "D /mnt" > /root/test.conf
  # systemd-tmpfiles --remove /root/test.conf
  Attempted to remove disk file system, and we can't allow that.
  rm_rf(/root/test): Operation not permitted

Reported-by: Lukas Jirkovsky <l.jirkovsky@gmail.com>
2012-09-11 02:55:29 +02:00
Lennart Poettering d87be9b0af nspawn: handle poweroff/reboot nicely in containers 2012-09-05 16:23:41 -07:00
Lennart Poettering 5809560d85 journal: move syslog specific calls out of util.c 2012-08-22 03:24:46 +02:00
Lennart Poettering ef63833d53 journald: split /dev/kmsg related stuff into its own .c file 2012-08-22 03:09:44 +02:00
Dave Reisner 84cc2abf34 shared/util: add fstab support for partuuid/partlabel
udev has supported this since 172, so it should be a safe (and welcome)
addition for users of GPT partitioned disks.
2012-08-21 11:48:26 -04:00
Dave Reisner 383182b5c4 shared/util: refactor fstab_node_to_udev_node
Since this is purely duplicated logic, separate it out into a small
static function.
2012-08-21 11:48:26 -04:00
Lennart Poettering a228a22fda journalctl: really include .journal~ files in listing 2012-08-21 02:13:21 +02:00
Lennart Poettering f6a971bc0b journalctl: output FSS key as QR code on generating 2012-08-20 22:02:19 +02:00
Lukas Nykryn 96342de68d service: add options RestartPreventExitStatus and SuccessExitStatus
In some cases, like wrong configuration, restarting after error
does not help, so administrator can specify statuses by RestartPreventExitStatus
which will not cause restart of a service.

Sometimes you have non-standart exit status, so this can be specified
by SuccessfulExitStatus.
2012-08-14 14:46:03 +02:00
Lennart Poettering ac0930c892 namespace: rework namespace support
- don't use pivot_root() anymore, just reuse root hierarchy
- first create all mounts, then mark them read-only so that we get the
  right behaviour when people want writable mounts inside of
  read-only mounts
- don't pass invalid combinations of MS_ constants to the kernel
2012-08-13 15:27:04 +02:00
Lennart Poettering 5b4c61cd0b journald: properly unescape messages from /dev/kmsg 2012-08-09 16:49:28 +02:00
Zbigniew Jędrzejewski-Szmek 11f96fac8f cgtop: use full terminal width 2012-07-26 23:32:01 +02:00
Shawn Landden 0d0f0c50d3 log.h: new log_oom() -> int -ENOMEM, use it
also a number of minor fixups and bug fixes: spelling, oom errors
that didn't print errors, not properly forwarding error codes,
few more consistency issues, et cetera
2012-07-26 11:48:26 +02:00
Shawn Landden 669241a076 use "Out of memory." consistantly (or with "\n")
glibc/glib both use "out of memory" consistantly so maybe we should
consider that instead of this.

Eliminates one string out of a number of binaries. Also fixes extra newline
in udev/scsi_id
2012-07-25 11:23:57 +02:00
Lennart Poettering d05c5031ad unit: introduce %s specifier for the user shell 2012-07-16 12:34:54 +02:00
Lennart Poettering 7c5f152aca util: add getusername_malloc(), get_shell(), get_home_dir() 2012-07-16 12:16:30 +02:00
Kay Sievers 4a0ff4780d aquire_terminal(): fix uninitialized variable
./src/shared/util.c:2457:45: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized]
2012-07-15 15:34:22 +02:00
Lennart Poettering 32c4bef882 util: temporarily ignore SIGHUP while we are issuing TIOCSTTY 2012-07-13 13:55:35 +02:00
Lennart Poettering b7def68494 util: rename join() to strjoin()
This is to match strappend() and the other string related functions.
2012-07-13 13:41:01 +02:00