summaryrefslogtreecommitdiffstats
path: root/src/hostname (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use initalization instead of explicit zeroingZbigniew Jędrzejewski-Szmek2013-04-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | Before, we would initialize many fields twice: first by filling the structure with zeros, and then a second time with the real values. We can let the compiler do the job for us, avoiding one copy. A downside of this patch is that text gets slightly bigger. This is because all zero() calls are effectively inlined: $ size build/.libs/systemd text data bss dec hex filename before 897737 107300 2560 1007597 f5fed build/.libs/systemd after 897873 107300 2560 1007733 f6075 build/.libs/systemd … actually less than 1‰. A few asserts that the parameter is not null had to be removed. I don't think this changes much, because first, it is quite unlikely for the assert to fail, and second, an immediate SEGV is almost as good as an assert.
* hostnamectl: if somebody invokes 'hostnamectl set-hostname' with a valid ↵Lennart Poettering2013-04-032-9/+29
| | | | | | | | | | | | internet hostname unset the pretty name If people are unaware or uninterested in the concept of pretty host names, and simply invoke "hostnamectl set-hostname" for a valid internet host name, then use this as indication to unset the pretty host name and only set the static/dynamic one. This also allows fqdn, hence "hostnamectl set-hostname www.foobar.com" will just work if people really insist on using fqdns as hostnames.
* shared: rework env file readerLennart Poettering2013-04-031-1/+1
| | | | | | Implement this with a proper state machine, so that newlines and escaped chars can appear in string assignments. This should bring the parser much closer to shell.
* util: rename write_one_line_file() to write_string_file()Lennart Poettering2013-04-031-1/+1
| | | | | You can write much more than just one line with this call (and we frequently do), so let's correct the naming.
* hostnamed: pretty_string_is_safe() already exists in string_has_cc(), so use ↵Lennart Poettering2013-03-221-14/+1
| | | | that
* Use bus_maybe_send_reply() where applicableColin Walters2013-03-191-1/+1
| | | | | | | | | This is a followup to: commit 1a37b9b9043ef83e9900e460a9a1fccced3acf89 It will fix denial messages from dbus-daemon between gdm and systemd-logind on logging into GNOME due to this. See the previous commit for more details.
* hostnamed: allow more special characters in pretty hostnameNathaniel Chen2013-03-051-1/+14
| | | | | | | | | | | | | | | this addresses the bug at: https://bugs.freedesktop.org/show_bug.cgi?id=59311 https://bugzilla.redhat.com/show_bug.cgi?id=895299 hostnamectl is supposed to allow a range of special characters for the 'pretty' hostname: $ hostnamectl set-hostname --pretty "Nathaniels Desktop !@#$%" ..however, it rejects apostrophes, double quotes, and backslashes. The manual for hostnamectl suggests that this should be allowed. It makes sense to reject \0, \n, etc. pretty_string_is_safe() is the same as string_is_safe(), but allows more special characters.
* honor SELinux labels, when creating and writing config filesHarald Hoyer2013-02-142-3/+6
| | | | | | | Also split out some fileio functions to fileio.c and provide a SELinux aware pendant in fileio-label.c see https://bugzilla.redhat.com/show_bug.cgi?id=881577
* env: considerably beef up environment cleaning logicLennart Poettering2013-02-111-0/+1
| | | | | | | | | | | | | Now, actually check if the environment variable names and values used are valid, before accepting them. With this in place are at some places more rigid than POSIX, and less rigid at others. For example, this code allows lower-case environment variables (which POSIX suggests not to use), but it will not allow non-UTF8 variable values. All in all this should be a good middle ground of what to allow and what not to allow as environment variables. (This also splits out all environment related calls into env-util.[ch])
* build-sys: drop all distribution specfic checksLennart Poettering2013-01-041-1/+0
| | | | Yay, we now have a completely generic systemd. No distribution specific checks anymore!
* polkit: add "imply" rules to a number of polkit actionsLennart Poettering2012-12-311-0/+1
|
* hostnamed: make chassis type configurable via /etc/machine-infoLennart Poettering2012-12-242-26/+156
| | | | | | | | | | | | | | | | | | | | | | For many usecases it is useful to store the chassis type somewhere, and /etc/machine-info sounds like a good place. Ideally we could always detect the chassis type from firmware, but frequently that's not available and in many embedded devices probably entirely unrealistic. This patch adds a configurable setting CHASSIS= to /etc/machine-info and exposes this via hostnamectl/hostnamed. hostnamed will guess the chassis type from DMI if nothing is set explicitly. I also added support for detecting it from ACPI, which should be more useful as ACPI 5.0 actually knows a "tablet" chassis type, which neither DMI nor previous ACPI versions knew. This also enables DMI-based and ACPI-based detection for non-x86 systems as ACPI is apparently coming to ARM platforms soon. I tried to minimize the vocabulary of chassis types understood and added: desktop, laptop, server, tablet, handset. This is much less than either APCI or DMI know. If we need more types later on we can easily add them.
* hostnamectl: fix parsing of --no-ask-passwordLennart Poettering2012-11-151-0/+4
|
* enable localization for common *ctl commandsDave Reisner2012-11-121-0/+2
|
* hostnamectl: do not choke on set-hostname with no argumentKay Sievers2012-10-291-1/+1
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=871172
* hostnamectl: add more really basic system info to the status outputLennart Poettering2012-10-211-2/+21
|
* timedatectl,hostnamectl: rework --help textLennart Poettering2012-10-191-7/+7
|
* hostname: add new hostnamectl tool as text client for hostnamedLennart Poettering2012-10-171-0/+525
|
* dbus: add some more safety checks before accepting data from bus clientsLennart Poettering2012-10-031-0/+8
|
* log.h: new log_oom() -> int -ENOMEM, use itShawn Landden2012-07-261-2/+1
| | | | | | 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
* use "Out of memory." consistantly (or with "\n")Shawn Landden2012-07-251-1/+1
| | | | | | | | 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
* relicense to LGPLv2.1 (with exceptions)Lennart Poettering2012-04-124-10/+10
| | | | | | | | | | | | | | We finally got the OK from all contributors with non-trivial commits to relicense systemd from GPL2+ to LGPL2.1+. Some udev bits continue to be GPL2+ for now, but we are looking into relicensing them too, to allow free copy/paste of all code within systemd. The bits that used to be MIT continue to be MIT. The big benefit of the relicensing is that closed source code may now link against libsystemd-login.so and friends.
* logind: introduce CanReboot/CanPowerOff bus callsLennart Poettering2012-02-111-3/+3
|
* login: move seat udev rules to login subdirKay Sievers2012-01-221-0/+1
|
* dbus: more efficient implementation of propertiesMichal Schmidt2012-01-161-8/+14
| | | | | | | | | | | | | | | | | The way the various properties[] arrays are initialized is inefficient: - only the .data members change at runtime, yet the whole arrays of properties with all the fields are constructed on the stack one by one by the code. - there's duplication, eg. the properties of "org.freedesktop.systemd1.Unit" are repeated in several unit types. Fix it by moving the information about properties into static const sections. Instead of storing the .data directly in the property, store a constant offset from a run-time base. The small arrays of struct BusBoundProperties bind together the constant information with the right runtime information (the base pointer). On my system the code shrinks by 60 KB, data increases by 10 KB.
* build-sys: add stub makefiles to subdirsLennart Poettering2012-01-051-0/+1
|
* hostnamed, localed: move config files to subdirKay Sievers2011-12-313-0/+88
|
* hostnamed: move sources to subdirectoryKay Sievers2011-12-311-0/+623