summaryrefslogtreecommitdiff
path: root/src/timedate
Commit message (Collapse)AuthorAge
* timedatectl: many fixesLennart Poettering2015-04-02
| | | | | | | | | | | - print runtime warnings with log_warning() - save and restore $TZ properly - Get rid of exit() pseudo error handling - Using time() is OK when connecting to a local container or when showing data about local host, but certainly not for remote hosts.
* timedatectl: remove unused variablesThomas Hindoe Paaboel Andersen2015-03-24
|
* timedate: remove daylight saving time handling and tzfile parserKay Sievers2015-03-24
| | | | | | | | | | | | We planned to support (the conceptually broken) daylight saving time/local time features in the kernel, SCSI, networking, FAT filesystem, but it turned out to be a race we cannot win and do not want to get involved. Systemd should not fiddle with daylight saving time or parse timezone information itself. Leave everything to glibc or tools like date(1) and do not make any promises or raise expectations that systemd should handle anything like this.
* timedatectl: fix when queried system has differn't timezoneShawn Landden2015-03-24
| | | | | | Also allow getting time from time(2) when BUS_TRANSPORT_MACHINE. v2: check for error
* timedated: fix enable/disable reversalZbigniew Jędrzejewski-Szmek2015-03-21
| | | | | | | | | Bug introduced in 984f1b1d1b. The state was flipped later, but the enable/disable routine made use of the state to decide what to do. context_enable_ntp() and context_start_ntp() now get the desired state directly, so the Context parameter can be removed.
* timedated: flip internal status after executing operationZbigniew Jędrzejewski-Szmek2015-03-21
| | | | | | | | | timedated would set the internal status before calling out to systemd to do the actual change. When the operation was refused because of a SELinux denial, the state kept in timedated would get out of sync, and the second call from timedatectl would appear to succeed. https://bugzilla.redhat.com/show_bug.cgi?id=1014315
* Use space after a silencing (void)Zbigniew Jędrzejewski-Szmek2015-03-13
| | | | | We were using a space more often than not, and this way is codified in CODING_STYLE.
* tree-wide: there is no ENOTSUP on linuxDavid Herrmann2015-03-13
| | | | Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
* adjust for time spent in timedated even without dbus timestampShawn Landden2015-03-07
| | | | | | | | it is trivial to fall back to our own timestamp v2: use now() v3: remove useless if () v4: add comment
* timedated: when performing "SetTime" compensate for program lagShawn Landden2015-02-26
| | | | (David: fix up compile-failure and simplify code a bit)
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* logind: open up most bus calls for unpriviliged processes, using PolicyKitLennart Poettering2015-02-18
| | | | | | Also, allow clients to alter their own objects without any further priviliges. i.e. this allows clients to kill and lock their own sessions without involving PK.
* time-util: let's make xstrftime() useful for everybody, even if we only have ↵Lennart Poettering2015-02-02
| | | | a single user so far.
* Add a snprinf wrapper which checks that the buffer was big enoughZbigniew Jędrzejewski-Szmek2015-02-01
| | | | | | | | | | If we scale our buffer to be wide enough for the format string, we should expect that the calculation was correct. char_array_0() invocations are removed, since snprintf nul-terminates the output in any case. A similar wrapper is used for strftime calls, but only in timedatectl.c.
* tmpfiles: add new line type 'v' for creating btrfs subvolumesLennart Poettering2014-12-28
|
* timedated: remove spurious include of <sys/capability.h>Filipe Brandenburger2014-12-25
| | | | | | | It does not use any functions from libcap directly. The CAP_SYS_TIME constant in use by this file comes from <linux/capability.h> imported through "missing.h". Tested that "systemd-timedated" builds cleanly and works after this change.
* sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()Lennart Poettering2014-12-24
| | | | | | | Pretty much everywhere else we use the generic term "machine" when referring to containers in API, so let's do though in sd-bus too. In particular, since the concept of a "container" exists in sd-bus too, but as part of the marshalling system.
* sd-bus: move common errors src/shared/bus-errors.h → ↵Lennart Poettering2014-12-10
| | | | | | src/libsystemd/sd-bus/bus-common-errors.h Stuff in src/shared/ should not use stuff from src/libsystemd/ really.
* sd-bus: rework ELF error mapping table magicLennart Poettering2014-12-08
| | | | | | | The ELF magic cannot work for consumers of our shard library, since they are in a different module. Hence make all the ELF magic private, and instead introduce a public function to register additional static mapping table.
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-28
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: yet more log_*_errno + return simplificationsMichal Schmidt2014-11-28
| | | | | | | | | | | | | Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* log: fix order of log_unit_struct() to match other logging callsLennart Poettering2014-11-28
| | | | | Also, while we are at it, introduce some syntactic sugar for creating ERRNO= and MESSAGE= structured logging fields.
* Make bus errno mappings non-staticZbigniew Jędrzejewski-Szmek2014-10-31
| | | | | | | | | | | | | | | __attribute__((used)) is not enough to force static variables to be carried over to a compiled program from a library. Mappings defined in libsystemd-shared.a were not visible in the compiled binaries. To ensure that the mappings are present in the final binary, the tables are made non-static and are given a real unique name by which they can be referenced. To use a mapping defined not in the local compilation unit (e.g. in a library) a reference to the mapping table is added. This is done by including a declaration in the header file. Expected values in test-engine are fixed to reflect the new mappings.
* Convert the rest to sd_bus_errnomapZbigniew Jędrzejewski-Szmek2014-10-30
| | | | | | I tried to preserve most errno values, but in some cases they were inconsistent (different errno values for the same error name) or just mismatched.
* mac: rename apis with mac_{selinux/smack}_ prefixWaLyong Cho2014-10-23
|
* 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
|