Commit Graph

293 Commits

Author SHA1 Message Date
Sami Kerola 23757887f7 licence: remove references to old FSF address
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57206
2012-12-17 11:41:31 +01:00
Zbigniew Jędrzejewski-Szmek 20ad4cfd8e core: add catalog entry and MESSAGE_ID for overmounting 2012-12-05 12:25:50 +01:00
Lennart Poettering 8742514c1a timer: recalculate next elapse for calendar timer units when the system clock is changed 2012-11-25 00:33:59 +01:00
Kay Sievers f0d7b0fcff shared: FORMAT_TIMESTAMP_MAX -- include space for unicode weekdays
$ LANG=el_GR.UTF-8 ./timedatectl
      Local time: Σαβ 2012-11-24 14:53:05 CET
  Universal time: Σαβ 2012-11-24 13:53:05 UTC
        RTC time: Σαβ 2012-11-24 13:53:04
        Timezone: Europe/Berlin (CET, +0100)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Κυρ 2012-10-28 02:59:59 CEST
                  Κυρ 2012-10-28 02:00:00 CET
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Κυρ 2013-03-31 01:59:59 CET
                  Κυρ 2013-03-31 03:00:00 CEST

https://bugs.freedesktop.org/show_bug.cgi?id=57470
2012-11-24 14:55:35 +01:00
Lennart Poettering 92134489ab time-util: teach parse_timestamp to parse weekdays 2012-11-23 22:52:46 +01:00
Lennart Poettering 6a741b4a2b path-util: when parsing a timestamp we don't know the timezone 2012-11-23 22:52:38 +01:00
Lennart Poettering 9185c8e626 time-util: also rename FORMAT_TIMESTAMP_PRETTY → _MAX 2012-11-23 22:51:55 +01:00
Lennart Poettering decad9103e util: teach parse_timestamp() to parse results of format_timestamp_relative() 2012-11-23 22:20:15 +01:00
Lennart Poettering bbb8486e17 util: rename format_timestamp_pretty() to format_timestamp_relative() because that describes much better what it does 2012-11-23 22:12:59 +01:00
Lennart Poettering 9a98c7a156 util: split off time related calls from util.[ch] into time-util.[ch] 2012-11-23 22:07:24 +01:00
Lennart Poettering 36697dc019 timer: implement calendar time events 2012-11-23 21:37:58 +01:00
Lennart Poettering 525716e2f9 util: drop "," between week day and date when formatting timestamps
The glibc default (as shown by the command line tool "date") doesn't put a comma there,
and so we shouldn't either.
2012-11-23 16:26:28 +01:00
Kay Sievers 79263d0392 shared: FORMAT_TIMESTAMP_MAX +1
5 is for weekday+comma+space, but week days in french have 4 digits

https://bugs.freedesktop.org/show_bug.cgi?id=57411
2012-11-22 18:46:08 +01:00
Lennart Poettering e42e801b55 dbus: introduce _cleanup_dbus_error_free_ 2012-11-22 00:45:22 +01:00
Lennart Poettering 93b73b064c journal: by default do not decompress dat objects larger than 64K
This introduces a new data threshold setting for sd_journal objects
which controls the maximum size of objects to decompress. This is
relieves the library from having to decompress full data objects even
if a client program is only interested in the initial part of them.

This speeds up "systemd-coredumpctl" drastically when invoked without
parameters.
2012-11-21 00:28:00 +01:00
Colin Walters 1a37b9b904 dbus-common: Add helper method to handle no-reply messages
[Tested in latest gnome-ostree; if accepted, I'll look at a followup
 patch which fixes the other dbus_connection_send(reply, ...) calls
 besides logind]

DBus messages can have a flag NO_REPLY associated that means "I don't
need a reply".  This is for efficiency reasons - for one-off requests
that can't return an error, etc.

However, it's up to users to manually check
dbus_message_get_no_reply() from a message.  libdbus will happily send
out a reply if you don't.

Unfortunately, doing so is not just less efficient - it also triggers
a security error, for complex reasons.  This is something that will
eventually be fixed in dbus, but it's also correct to handle it in
client applications.

This new helper API is slightly nicer in that you don't have to pass
NULL to say you don't want a reply serial for your reply.

This patch also tweaks logind to use the API - there are more areas of
the code that need this treatment too.
2012-11-20 19:12:19 +01:00
Anders Olofsson 7009eec208 shared/utils: systemd-cgls shows 'n/a' when piping output
-1 was used to signal failure, but the type was unsigned.

https://bugs.freedesktop.org/show_bug.cgi?id=56644
2012-11-19 17:12:17 +01:00
Zbigniew Jędrzejewski-Szmek 943aad8ca5 journal, shared: fix warnings during compilation on 32 bits
Some filesystem magics are too big to fit in 31 bits,
and are wrapped to negative. f_type is an int on 32 bits, so
it is signed, and we get a warning on comparison.
2012-11-16 23:26:44 +01:00
Lennart Poettering d4205751d4 journal: implement message catalog
The message catalog can be used to attach short help texts to log lines,
keyed by their MESSAGE_ID= fields. This is useful to help the
administrator understand the context and cause of a message, find
possible solutions and find further related documentation.

Since this is keyed off MESSAGE_ID= this will only work for native
journal messages.

The message catalog supports i18n, and is useful to augment english
language system messages with explanations in the local language.

This commit only includes short explanatory messages for a few example
message IDs, we'll add more complete documentation for the relevant
systemd messages later on.
2012-11-15 23:09:07 +01:00
Lennart Poettering 8885064fd0 polkit: if PK is not around, consider this a permission denied error
Uninstalling PK should cleanly disable PK authorization but not result
in further runtime errors.
2012-11-15 23:07:25 +01:00
Zbigniew Jędrzejewski-Szmek 45c0c61df3 systemctl: add help for --type/-t
The list of types and load states if lengthy, so a little reminder
can be sometimes useful.
2012-11-15 11:54:57 +01:00
Lennart Poettering 6e6fb527f9 shared: add API for replacing @FOO@ style variables in strings 2012-11-14 22:21:16 +01:00
Lennart Poettering 409bc9c33e util: add strreplace() to replace a substring by another string 2012-11-14 22:21:16 +01:00
Lennart Poettering 7ae03f3697 specifier: minor modernizations 2012-11-14 22:21:16 +01:00
Lennart Poettering 0290296582 polkit: fix type on comparison 2012-11-14 22:21:16 +01:00
Zbigniew Jędrzejewski-Szmek 6b6ed3e3eb shared/socket-util: kill gcc warning about uninitialized variable
The warning was invalid, but distracting.
2012-11-13 02:23:02 +01:00
Michal Schmidt 45a5ff0de7 util: nicer tree drawings
Draw trees more similar to pstree/findmnt/lsblk/...
2012-11-12 22:27:48 +01:00
Kay Sievers 1298001ec5 use the same email address everywhere 2012-11-12 19:47:43 +01:00
Kay Sievers 2311eb2ff0 timedatectl: properly print 30 minutes DST transitions 2012-11-11 16:55:25 +01:00
Lennart Poettering bece1f5215 dbus: when verifying PK privs, bypass PK if uid=0 of client
This reduces the number of roundtrips when the client is privileged and
makes the PK dep optional for root clients.
2012-11-09 15:55:36 +01:00
Dave Reisner e4f44e734c Revert "Implement SocketUser= and SocketGroup= for [Socket]"
This was never intended to be pushed.

This reverts commit aea54018a5.
2012-11-06 09:54:17 -05:00
Dave Reisner aea54018a5 Implement SocketUser= and SocketGroup= for [Socket]
Since we already allow defining the mode of AF_UNIX sockets and FIFO, it
makes sense to also allow specific user/group ownership of the socket
file for restricting access.
2012-11-05 21:17:55 -05:00
Kay Sievers c1e5704657 shared: add is_efiboot() 2012-11-04 16:06:27 +01:00
Michal Schmidt c339d9775d util : fallback to plain ASCII drawing if locale is not UTF-8
When printing cgroup and sysfs hierarchies, avoid using UTF-8 box drawing
characters if the locale is not UTF-8.

https://bugzilla.redhat.com/show_bug.cgi?id=871153
2012-11-02 17:39:52 +01:00
Michal Schmidt 0901758558 util: add is_locale_utf8()
journalctl and vconsole-setup both implement utf8 locale detection.
Let's have a common function for it.
The next patch will add another use.
2012-11-02 17:27:15 +01:00
Kay Sievers e2fd5e5ba2 timedatectl: show "DST active: n/a" if no DST data is available 2012-11-02 05:45:02 -10:00
Kay Sievers b7f1542c8b shared: add timer_get_dst() 2012-11-02 00:44:23 +01:00
Lennart Poettering 1fd8d04e38 strv: cleanup error path loops
https://bugzilla.redhat.com/show_bug.cgi?id=858799
2012-10-30 18:30:45 +01:00
Michal Schmidt 8511dd1871 shared: "max" in the string->number conversion is meant to be inclusive 2012-10-30 15:46:49 +01:00
Michal Schmidt f8b69d1dfc shared, core: do not always accept numbers in string lookups
The behaviour of the common name##_from_string conversion is surprising.
It accepts not only the strings from name##_table but also any number
that falls within the range of the table. The order of items in most of
our tables is an internal affair. It should not be visible to the user.

I know of a case where the surprising numeric conversion leads to a crash.

We will allow the direct numeric conversion only for the tables where the
mapping of strings to numeric values has an external meaning. This holds
for the following lookup tables:
 - netlink_family, ioprio_class, ip_tos, sched_policy - their numeric
   values are stable as they are defined by the Linux kernel interface.
 - log_level, log_facility_unshifted - the well-known syslog interface.

We allow the user to use numeric values whose string names systemd does
not know. For instance, the user may want to test a new kernel featuring
a scheduling policy that did not exist when his systemd version was
released. A slightly unpleasant effect of this is that the
name##_to_string conversion cannot return pointers to constant strings
anymore. The strings have to be allocated on demand and freed by the
caller.
2012-10-30 15:41:15 +01:00
Michal Schmidt f3910003bc shared, libsystemd-daemon: check for empty strings in strto*l conversions
strtol() and friends may set EINVAL if no conversion was performed, but
they are not required to do so. In practice they don't. We need to check
for it.

https://bugzilla.redhat.com/show_bug.cgi?id=870577
2012-10-30 10:30:04 +01:00
Michal Schmidt fd09c93de9 util: improve overflow checks
commit 49371bb fixed the observed division by zero, but missed another
occurrence of the same bug. It was also not the optimal fix. We can
simply make the divisor a constant by swapping it with the compared
value.
2012-10-29 22:57:24 +01:00
Dave Reisner 49371bb50e util: avoid divide by zero FPE
In early userspace, if kernel initialization happens extremely quickly,
a call to systemd-timestamp can potentially result in division by zero.
Ensure that the check in timespec_load, which only makes sense if tv_sec
is greater than zero, is guarded by this condition.
2012-10-29 15:53:03 -04:00
Michal Sekletar 3dd8ee8fa6 util: fix possible integer overflows 2012-10-28 02:14:41 +02:00
Lennart Poettering 6524990fdc logind: support for hybrid sleep (i.e. suspend+hibernate at the same time) 2012-10-28 00:50:35 +02:00
Kay Sievers 19e6561356 hwclock: do not seal the kernel's time-warp call from inside the initrd 2012-10-27 16:31:10 +02:00
Lennart Poettering e8988fc2a2 util: return the remaining string in startswith() 2012-10-27 01:20:01 +02:00
Lennart Poettering 684341b073 coredumpctl: show timestamps in list 2012-10-26 20:34:39 +02:00
Lennart Poettering 85210bffd8 journal: provide an API that allows client to figure out whether they need to recheck the journal manually for changes in regular intervals
Network file systems generally do not offer inotify() that would work
across the network. We hence cannot rely on inotify() exclusiely in
those case. Provide an API to determine these cases, and suggest doing
manual regular rechecks.

Note that this is not complete yet, as we need to rescan journal dirs on
network file systems explicitly to find new/removed files
2012-10-26 20:07:33 +02:00
Lennart Poettering a4bcff5ba3 journal: introduce entry array chain cache
When traversing entry array chains for a bisection or for retrieving an
item by index we previously always started at the beginning of the
chain. Since we tend to look at the same chains repeatedly, let's cache
where we have been the last time, and maybe we can skip ahead with this
the next time.

This turns most bisections and index lookups from O(log(n)*log(n)) into
O(log(n)). More importantly however, we seek around on disk much less,
which is good to reduce buffer cache and seek times on rotational disks.
2012-10-26 03:24:03 +02:00