summaryrefslogtreecommitdiff
path: root/src/hostname
Commit message (Collapse)AuthorAge
* 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.
* tmpfiles: add new line type 'v' for creating btrfs subvolumesLennart Poettering2014-12-28
|
* hostnamed: remove spurious include of <sys/capability.h>Filipe Brandenburger2014-12-25
| | | | | | | It does not use any functions from libcap directly. The CAP_SYS_ADMIN constant in use by this file comes from <linux/capability.h> imported through "missing.h". Tested that "systemd-hostnamed" 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.
* util: when using basename() for creating temporary files, verify the ↵Lennart Poettering2014-12-12
| | | | | | | | resulting name is actually valid Also, rename filename_is_safe() to filename_is_valid(), since it actually does a full validation for what the kernel will accept as file name, it's not just a heuristic.
* treewide: correct spacing near eol in code commentsTorstein Husebø2014-12-11
|
* treewide: more log_*_errno + return simplificationsMichal Schmidt2014-11-28
|
* hostnamectl: Exit with zero on successMartin Pitt2014-11-28
| | | | | | In show_all_names(), bus_map_all_properties() returns 1 on success which is then used as the return code of show_all_names() and eventually main(). Exit with zero in main() on all nonnegative results to guard against similar errors.
* 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().
* hostnamed: introduce new "embedded" chassis typeLennart Poettering2014-11-06
| | | | | | | We really don't want to get lost in adding fridge, car, plane, drone, or whatever else, hence add a generic term "embedded" cover all the cases where the computer is just part of something bigger, and not at the focus of things.
* util: introduce sethostname_idempotentMichal Sekletar2014-10-27
| | | | | Function queries system hostname and applies changes only when necessary. Also, migrate all client of sethostname to sethostname_idempotent while at it.
* mac: rename apis with mac_{selinux/smack}_ prefixWaLyong Cho2014-10-23
|
* hostname: add missing EMITS_CHANGE annotationDavid Herrmann2014-09-16
| | | | | We call into sd-bus to send PropertiesChanged notifications for "Hostname", but forgot to add the annotation to the bus-vtable. Fix that!
* 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.
* | hostnamectl: actually implement location supportLennart Poettering2014-08-15
|/
* 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.
* hostnamed: introduce new location machin-info field, tooLennart Poettering2014-07-11
|
* hostnamed: drop nss-myhostname checkLennart Poettering2014-07-11
| | | | | | The check only cares about whether the module is installed, not enabled. But installation we should know anyway, after all we ship the module with systemd these days...
* hostnamed: make use of in_charset() to verify charsetLennart Poettering2014-07-11
|
* hostnamed: minor modernizationLennart Poettering2014-07-11
|
* Add DEPLOYMENT to hostnamectlJóhann B. Guðmundsson2014-07-11
| | | | [zj: remove the check against a fixed list of environments.]
* hostnamed: add a new chassis type for watchesLennart Poettering2014-07-09
|
* util: don't consider tabs special in string_has_cc() anymoreLennart Poettering2014-07-07
| | | | Instead, take a list of exceptions to our usual CC check
* machinectl: show /etc/os-release information of container in status outputLennart Poettering2014-07-03
|
* util: generalize is_localhost() and use it everywhere where applicableLennart Poettering2014-07-02
|
* os-release: define /usr/lib/os-release as fallback for /etc/os-releaseLennart Poettering2014-06-13
| | | | | | | | | | | | | | | | The file should have been in /usr/lib/ in the first place, since it describes the OS container in /usr (and not the configuration in /etc), hence, let's support os-release files in /usr/lib as fallback if no version in /etc exists, following the usual override logic. A prior commit already enabled tmpfiles to create /etc/os-release as a symlink to /usr/lib/os-release should it be missing, thus providing nice compatibility with applications only checking in /etc. While it's probably a good idea if all apps check both locations via a fallback logic, it is only necessary in the early boot process, as long as the /etc/os-release symlink has not been restored, in case we boot with an empty /etc.
* hostnamed: Fix the way that static and transient host names interactStef Walter2014-05-28
| | | | | | | | | | | | | | | | | | It is almost always incorrect to allow DHCP or other sources of transient host names to override an explicitly configured static host name. This commit changes things so that if a static host name is set, this will override the transient host name (eg: provided via DHCP). Transient host names can still be used to provide host names for machines that have not been explicitly configured with a static host name. The exception to this rule is if the static host name is set to "localhost". In those cases we act as if no static host name has been explicitly set. As discussed elsewhere, systemd may want to have an fd based ownership of the transient name. That part is not included in this commit.
* shared: rename hwclock.[ch] to clock-util.[ch]Kay Sievers2014-05-24
|
* hostnamed: expose KernelVersion on the busDjalal Harouni2014-05-19
| | | | | | | | This is needed to fix bug: https://bugs.freedesktop.org/show_bug.cgi?id=76498 Reported-by: Zach <zachcook1991@gmail.com>
* 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).
* hostnamectl: read kernel name and release from remoteDjalal Harouni2014-04-23
|
* hostnamed: expose KernelName and KernelRelease on the busDjalal Harouni2014-04-23
|
* hostnamectl: read OS pretty_name and cpe_name from remoteDjalal Harouni2014-03-11
|
* hostnamed: expose OperatingSystemPrettyName and OperatingSystemCPEName on ↵Djalal Harouni2014-03-11
| | | | the bus
* hostnamed: minor improvements in context_write_data_other()Djalal Harouni2014-03-11
| | | | | Prepare context_write_data_other() and rename it to context_write_data_machine_info()
* hostnamectl: read virtualization/architecture from remote sideLennart Poettering2014-02-25
| | | | | This way we make this more network/container transparent and also do not require any client side privileges.
* hostnamed: correct error messageMichal Sekletar2014-02-24
| | | | We are not parsing timezone data.
* virt: make Virtualization an anonymous enumThomas Hindoe Paaboel Andersen2014-02-24
| | | | This makes llvm happy when we assign an error code to the variable.
* hostnamectl: should the sanitized arch, not the native uname() oneLennart Poettering2014-02-21
|
* make gcc shut upLennart Poettering2014-02-19
| | | | | | | If -flto is used then gcc will generate a lot more warnings than before, among them a number of use-without-initialization warnings. Most of them without are false positives, but let's make them go away, because it doesn't really matter.
* 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
|
* bus: add SD_BUS_NAME_REPLACE_EXISTING to all activatable services, fix one ↵Kay Sievers2013-12-12
| | | | flags conversion