summaryrefslogtreecommitdiff
path: root/src/timedate
Commit message (Collapse)AuthorAge
* bus-util: simplify bus_verify_polkit_async() a bitLennart Poettering2014-08-18
| | | | | | | | | | | First, let's drop the "bus" argument, we can determine it from the message anyway. Secondly, determine the right callback/userdata pair automatically from what is currently is being dispatched. This should simplify things a lot for us, since it makes it unnecessary to pass pointers through the original handlers through all functions when we process messages, which might require authentication.
* Merge commit 'b39a2770ba55637da80e2e389222c59dbea73507'Lennart Poettering2014-08-15
|\
| * sd-bus: Remove bus arg from bus_verify_polkit_async_registry_free()Stef Walter2014-08-15
| | | | | | | | | | It's unneccessary, not used, and complicates callers of the function.
* | sd-bus: add API to check if a client has privilegesLennart Poettering2014-08-15
|/ | | | | | | | | | | | | This is a generalization of the vtable privilege check we already have, but exported, and hence useful when preparing for a polkit change. This will deal with the complexity that on dbus1 one cannot trust the capability field we retrieve via the bus, since it is read via /proc/$$/stat (and thus might be out-of-date) rather than directly from the message (like on kdbus) or bus connection (as for uid creds on dbus1). Also, port over all code to this new API.
* bus: always explicitly close bus from main programsLennart Poettering2014-08-04
| | | | | | | | | | | | | | Since b5eca3a2059f9399d1dc52cbcf9698674c4b1cf0 we don't attempt to GC busses anymore when unsent messages remain that keep their reference, when they otherwise are not referenced anymore. This means that if we explicitly want connections to go away, we need to close them. With this change we will no do so explicitly wherver we connect to the bus from a main program (and thus know when the bus connection should go away), or when we create a private bus connection, that really should go away after our use. This fixes connection leaks in the NSS and PAM modules.
* Unify parse_argv styleZbigniew Jędrzejewski-Szmek2014-08-03
| | | | | | | | | | | | | | | | getopt is usually good at printing out a nice error message when commandline options are invalid. It distinguishes between an unknown option and a known option with a missing arg. It is better to let it do its job and not use opterr=0 unless we actually want to suppress messages. So remove opterr=0 in the few places where it wasn't really useful. When an error in options is encountered, we should not print a lengthy help() and overwhelm the user, when we know precisely what is wrong with the commandline. In addition, since help() prints to stdout, it should not be used except when requested with -h or --help. Also, simplify things here and there.
* core: only set the kernel's timezone when the RTC runs in local timeKay Sievers2014-07-27
| | | | | | | | | | | | | | | | | | | We can not reliably manage any notion of local time. Every daylight saving time change or time zone change by traveling will make the time jump, and the local time might jump backwards which creates unsolvable problems with file timestamps. We will no longer tell the kernel our local time zone and leave everything set to UTC. This will effectively turn FAT timestamps into UTC timestamps. If and only if the machine is configured to read the RTC in local time mode, the kernel's time zone will be configured, but systemd-timesysnc will disable the kernel's system time to RTC syncing. In this mode, the RTC will not be managed, and external tools like Windows bootups are expected to manage the RTC's time. https://bugs.freedesktop.org/show_bug.cgi?id=81538
* timedated: manage systemd-timesyncd directly instead of lists of alternativesKay Sievers2014-07-09
| | | | | | Alternative NTP implementations should add a: Conflicts=systemd-timesyncd.service to take over the built-in NTP functionality of systemd.
* shared: make timezone and locale enumeration and validation genericLennart Poettering2014-07-07
| | | | | This way we can reuse it other code thatn just localectl/localed + timedatectl/timedated.
* timedated: refuse manual system time updates when automatic timesync is enabledKay Sievers2014-05-24
|
* clock-util: clock_[sg]et_time() -> clock_[sg]et_hwclock()Kay Sievers2014-05-24
|
* shared: rename hwclock.[ch] to clock-util.[ch]Kay Sievers2014-05-24
|
* Remove unnecessary casts in printfsZbigniew Jędrzejewski-Szmek2014-05-15
| | | | No functional change expected :)
* sd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables ↵Lennart Poettering2014-05-15
| | | | | | | | | | | attached to a bus connection This makes callback behaviour more like sd-event or sd-resolve, and creates proper object for unregistering callbacks. Taking the refernce to the slot is optional. If not taken life time of the slot will be bound to the underlying bus object (or in the case of an async call until the reply has been recieved).
* rename timedate-sntp to timesyncKay Sievers2014-04-28
|
* timedatectl: avoid using uninitialized varThomas Hindoe Paaboel Andersen2014-04-14
| | | | | | | | sec is not set if have_time is false so avoid using it. have_time was introduced in 9ff09bcb86fb125768667aca9bc0b10b1745370a but only the first uses for sec were covered Found with scan-build
* timedated: ignore initial delta in history dataKay Sievers2014-04-10
|
* timedated: adjust accuracy and slew valuesKay Sievers2014-03-31
|
* timedate: fix numerous grammar errors in comments and output/debug messagesJason St. John2014-03-24
|
* sd-event: rework API to support CLOCK_REALTIME_ALARM and ↵Lennart Poettering2014-03-24
| | | | CLOCK_BOOTTIME_ALARM, too
* timedated: do not reset poll interval with a spikeKay Sievers2014-03-21
|
* timedated: update test addressKay Sievers2014-03-18
|
* timedatectl: clear ADJ_MAXERROR to make sure we keep STA_SYNC setKay Sievers2014-03-18
|
* core, libsystemd, systemd, timedate, udev: spelling fixesMiklos Vajna2014-03-17
|
* timedated: move test logging to test programKay Sievers2014-03-17
|
* timedated: update spike handlingKay Sievers2014-03-16
|
* timedated: update spike handlingKay Sievers2014-03-16
|
* timedated: handle external system time changesKay Sievers2014-03-16
|
* timedated: print delay and jitter in debug outputKay Sievers2014-03-15
|
* timedated: use builtins for integer log and expZbigniew Jędrzejewski-Szmek2014-03-14
|
* timedated: add SNTP client/query hookup (unused for now)Kay Sievers2014-03-14
|
* timedatectl: fix minor memory leakLennart Poettering2014-02-19
|
* bus: fix exit-on-idle for driverdLennart Poettering2013-12-19
|
* event: rework sd-event exit logicLennart Poettering2013-12-13
| | | | | | | | | | | | | With this change a failing event source handler will not cause the entire event loop to fail. Instead, we just disable the specific event source, log a message at debug level and go on. This also introduces a new concept of "exit code" which can be stored in the event loop and is returned by sd_event_loop(). We also rename "quit" to "exit" everywhere else. Altogether this should make things more robus and keep errors local while still providing a way to return event loop errors in a clear way.
* bus: remove explicit activator-specific flags, the kdbus supports it nowKay Sievers2013-12-12
|
* timedatectl: work with old timedatedShawn Landden2013-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Which does have TimeUSec. Should we specifically check for this method instead of assuming time=0 means it doesn't exist? Before: shawn@debian-T61:~/git/systemd$ ./timedatectl Local time: Wed 1969-12-31 16:00:00 PST Universal time: Thu 1970-01-01 00:00:00 UTC RTC time: n/a Timezone: America/Los_Angeles (PST, -0800) NTP enabled: n/a NTP synchronized: no RTC in local TZ: no DST active: no Last DST change: DST ended at Sun 1969-10-26 01:59:59 PDT Sun 1969-10-26 01:00:00 PST Next DST change: DST begins (the clock jumps one hour forward) at Sun 1970-04-26 01:59:59 PST Sun 1970-04-26 03:00:00 PDT After: shawn@debian-T61:~/git/systemd$ ./timedatectl Local time: Wed 2013-12-11 14:03:21 PST Universal time: Wed 2013-12-11 22:03:21 UTC RTC time: n/a Timezone: America/Los_Angeles (PST, -0800) NTP enabled: n/a NTP synchronized: no RTC in local TZ: no DST active: no Last DST change: DST ended at Sun 2013-11-03 01:59:59 PDT Sun 2013-11-03 01:00:00 PST Next DST change: DST begins (the clock jumps one hour forward) at Sun 2014-03-09 01:59:59 PST Sun 2014-03-09 03:00:00 PDT
* bus: add SD_BUS_NAME_REPLACE_EXISTING to all activatable services, fix one ↵Kay Sievers2013-12-12
| | | | flags conversion
* bus: instead of exposing the dbus1 flags when acquiring a name use our own ↵Lennart Poettering2013-12-12
| | | | | | | that are closer to kdbus This turns around DO_NOT_QUEUE into QUEUE which implies a more useful default. (And negative options are awful anyway.)
* timedated: make sure GetAll() succeeds in systems lacking /dev/rtc (such as ↵Lennart Poettering2013-12-12
| | | | containers)
* event: hook up sd-event with the service watchdog logicLennart Poettering2013-12-11
| | | | | | | | | | | | | Adds a new call sd_event_set_watchdog() that can be used to hook up the event loop with the watchdog supervision logic of systemd. If enabled and $WATCHDOG_USEC is set the event loop will ping the invoking systemd daemon right after coming back from epoll_wait() but not more often than $WATCHDOG_USEC/4. The epoll_wait() will sleep no longer than $WATCHDOG_USEC/4*3, to make sure the service manager is called in time. This means that setting WatchdogSec= in a .service file and calling sd_event_set_watchdog() in your daemon is enough to hook it up with the watchdog logic.
* bus: introduce "trusted" bus concept and encode access control in object vtablesLennart Poettering2013-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduces a new concept of "trusted" vs. "untrusted" busses. For the latter libsystemd-bus will automatically do per-method access control, for the former all access is automatically granted. Per-method access control is encoded in the vtables: by default all methods are only accessible to privileged clients. If the SD_BUS_VTABLE_UNPRIVILEGED flag is set for a method it is accessible to unprivileged clients too. By default whether a client is privileged is determined via checking for its CAP_SYS_ADMIN capability, but this can be altered via the SD_BUS_VTABLE_CAPABILITY() macro that can be ORed into the flags field of the method. Writable properties are also subject to SD_BUS_VTABLE_UNPRIVILEGED and SD_BUS_VTABLE_CAPABILITY() for controlling write access to them. Note however that read access is unrestricted, as PropertiesChanged messages might send out the values anyway as an unrestricted broadcast. By default the system bus is set to "untrusted" and the user bus is "trusted" since per-method access control on the latter is unnecessary. On dbus1 busses we check the UID of the caller rather than the configured capability since the capability cannot be determined without race. On kdbus the capability is checked if possible from the attached meta-data of a message and otherwise queried from the sending peer. This also decorates the vtables of the various daemons we ship with these flags.
* Help output spring cleaningZbigniew Jędrzejewski-Szmek2013-12-08
| | | | | Use [brackets] only for optional elements. Use <optional> in XML sources.
* bus: make sd_bus_request_name() and sd_bus_release_name() behave more like ↵Lennart Poettering2013-12-03
| | | | | | | | | | | | other calls Instead of returning an enum of return codes, make them return error codes like kdbus does internally. Also, document this behaviour so that clients can stick to it. (Also rework bus-control.c to always have to functions for dbus1 vs. kernel implementation of the various calls.)
* bus: rework message handlers to always take an error argumentLennart Poettering2013-11-21
| | | | | | | | | | | | | | | | | | | | Message handler callbacks can be simplified drastically if the dispatcher automatically replies to method calls if errors are returned. Thus: add an sd_bus_error argument to all message handlers. When we dispatch a message handler and it returns negative or a set sd_bus_error we send this as message error back to the client. This means errors returned by handlers by default are given back to clients instead of rippling all the way up to the event loop, which is desirable to make things robust. As a side-effect we can now easily turn the SELinux checks into normal function calls, since the method call dispatcher will generate the right error replies automatically now. Also, make sure we always pass the error structure to all property and method handlers as last argument to follow the usual style of passing variables for return values as last argument.
* bus: let's simplify things by getting rid of unnecessary bus parametersLennart Poettering2013-11-21
|
* remove unused variablesThomas Hindoe Paaboel Andersen2013-11-18
|
* bus: introduce concept of a default bus for each thread and make use of it ↵Lennart Poettering2013-11-12
| | | | | | | | everywhere We want to emphasize bus connections as per-thread communication primitives, hence introduce a concept of a per-thread default bus, and make use of it everywhere.
* bus: introduce concept of a "default" event loop per-thread and make use of ↵Lennart Poettering2013-11-12
| | | | | | | | | it everywhere Try to emphasize a bit that there should be a mapping between event loops and threads, hence introduce a logic that there's one "default" event loop for each thread, that can be queried via "sd_event_default()".
* clients: try to follow roughly the same order in --help texts for common optionsLennart Poettering2013-11-07
|
* polkit: don't spawn local client if we access a remote systemLennart Poettering2013-11-07
|