Merge pull request #15472 from keszybz/dbus-api-docs

A few more dbus api documentation updates
This commit is contained in:
Lennart Poettering
2020-04-23 17:01:11 +02:00
committed by GitHub
63 changed files with 345 additions and 307 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ bool hostname_is_set(void) {
if (isempty(u.nodename))
return false;
/* This is the built-in kernel default host name */
/* This is the built-in kernel default hostname */
if (streq(u.nodename, "(none)"))
return false;
@@ -77,7 +77,7 @@ bool valid_ldh_char(char c) {
}
/**
* Check if s looks like a valid host name or FQDN. This does not do
* Check if s looks like a valid hostname or FQDN. This does not do
* full DNS validation, but only checks if the name is composed of
* allowed characters and the length is not above the maximum allowed
* by Linux (c.f. dns_name_is_valid()). Trailing dot is allowed if
+1 -1
View File
@@ -186,7 +186,7 @@ int unit_name_printf(const Unit *u, const char* format, char **ret) {
* %u: the username of the running user
*
* %m: the machine ID of the running system
* %H: the host name of the running system
* %H: the hostname of the running system
* %b: the boot ID of the running system
*/
+1 -1
View File
@@ -691,7 +691,7 @@ static int help(void) {
" --locale-messages=LOCALE Set message locale (LC_MESSAGES=)\n"
" --keymap=KEYMAP Set keymap\n"
" --timezone=TIMEZONE Set timezone\n"
" --hostname=NAME Set host name\n"
" --hostname=NAME Set hostname\n"
" --machine-ID=ID Set machine ID\n"
" --root-password=PASSWORD Set root password\n"
" --root-password-file=FILE Set root password from file\n"
+8 -8
View File
@@ -281,7 +281,7 @@ static int context_update_kernel_hostname(Context *c) {
if (hostname_is_useful(static_hn))
hn = static_hn;
/* ... the transient host name, (ie: DHCP) comes next ... */
/* ... the transient hostname, (ie: DHCP) comes next ... */
else if (!isempty(c->data[PROP_HOSTNAME]))
hn = c->data[PROP_HOSTNAME];
@@ -455,11 +455,11 @@ static int method_set_hostname(sd_bus_message *m, void *userdata, sd_bus_error *
r = context_update_kernel_hostname(c);
if (r < 0) {
log_error_errno(r, "Failed to set host name: %m");
log_error_errno(r, "Failed to set hostname: %m");
return sd_bus_error_set_errnof(error, r, "Failed to set hostname: %m");
}
log_info("Changed host name to '%s'", strna(c->data[PROP_HOSTNAME]));
log_info("Changed hostname to '%s'", strna(c->data[PROP_HOSTNAME]));
(void) sd_bus_emit_properties_changed(sd_bus_message_get_bus(m), "/org/freedesktop/hostname1", "org.freedesktop.hostname1", "Hostname", NULL);
@@ -507,17 +507,17 @@ static int method_set_static_hostname(sd_bus_message *m, void *userdata, sd_bus_
r = context_update_kernel_hostname(c);
if (r < 0) {
log_error_errno(r, "Failed to set host name: %m");
log_error_errno(r, "Failed to set hostname: %m");
return sd_bus_error_set_errnof(error, r, "Failed to set hostname: %m");
}
r = context_write_data_static_hostname(c);
if (r < 0) {
log_error_errno(r, "Failed to write static host name: %m");
log_error_errno(r, "Failed to write static hostname: %m");
return sd_bus_error_set_errnof(error, r, "Failed to set static hostname: %m");
}
log_info("Changed static host name to '%s'", strna(c->data[PROP_STATIC_HOSTNAME]));
log_info("Changed static hostname to '%s'", strna(c->data[PROP_STATIC_HOSTNAME]));
(void) sd_bus_emit_properties_changed(sd_bus_message_get_bus(m), "/org/freedesktop/hostname1", "org.freedesktop.hostname1", "StaticHostname", NULL);
@@ -548,7 +548,7 @@ static int set_machine_info(Context *c, sd_bus_message *m, int prop, sd_bus_mess
if (prop == PROP_ICON_NAME && !filename_is_valid(name))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid icon name '%s'", name);
if (prop == PROP_PRETTY_HOSTNAME && string_has_cc(name, NULL))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid pretty host name '%s'", name);
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid pretty hostname '%s'", name);
if (prop == PROP_CHASSIS && !valid_chassis(name))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid chassis '%s'", name);
if (prop == PROP_DEPLOYMENT && !valid_deployment(name))
@@ -586,7 +586,7 @@ static int set_machine_info(Context *c, sd_bus_message *m, int prop, sd_bus_mess
}
log_info("Changed %s to '%s'",
prop == PROP_PRETTY_HOSTNAME ? "pretty host name" :
prop == PROP_PRETTY_HOSTNAME ? "pretty hostname" :
prop == PROP_DEPLOYMENT ? "deployment" :
prop == PROP_LOCATION ? "location" :
prop == PROP_CHASSIS ? "chassis" : "icon name", strna(c->data[prop]));
@@ -17,8 +17,8 @@
<vendor_url>http://www.freedesktop.org/wiki/Software/systemd</vendor_url>
<action id="org.freedesktop.hostname1.set-hostname">
<description gettext-domain="systemd">Set host name</description>
<message gettext-domain="systemd">Authentication is required to set the local host name.</message>
<description gettext-domain="systemd">Set hostname</description>
<message gettext-domain="systemd">Authentication is required to set the local hostname.</message>
<defaults>
<allow_any>auth_admin_keep</allow_any>
<allow_inactive>auth_admin_keep</allow_inactive>
@@ -27,8 +27,8 @@
</action>
<action id="org.freedesktop.hostname1.set-static-hostname">
<description gettext-domain="systemd">Set static host name</description>
<message gettext-domain="systemd">Authentication is required to set the statically configured local host name, as well as the pretty host name.</message>
<description gettext-domain="systemd">Set static hostname</description>
<message gettext-domain="systemd">Authentication is required to set the statically configured local hostname, as well as the pretty hostname.</message>
<defaults>
<allow_any>auth_admin_keep</allow_any>
<allow_inactive>auth_admin_keep</allow_inactive>
+1 -1
View File
@@ -1746,7 +1746,7 @@ static int server_open_hostname(Server *s) {
r = sd_event_source_set_priority(s->hostname_event_source, SD_EVENT_PRIORITY_IMPORTANT-10);
if (r < 0)
return log_error_errno(r, "Failed to adjust priority of host name event source: %m");
return log_error_errno(r, "Failed to adjust priority of hostname event source: %m");
return 0;
}
+1 -1
View File
@@ -700,7 +700,7 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const void *option, void
case SD_DHCP_OPTION_HOST_NAME:
r = lease_parse_domain(option, len, &lease->hostname);
if (r < 0) {
log_debug_errno(r, "Failed to parse host name, ignoring: %m");
log_debug_errno(r, "Failed to parse hostname, ignoring: %m");
return 0;
}
+1 -1
View File
@@ -77,7 +77,7 @@ enum nss_status _nss_myhostname_gethostbyname4_r(
return NSS_STATUS_TRYAGAIN;
}
/* We respond to our local host name, our hostname suffixed with a single dot. */
/* We respond to our local hostname, our hostname suffixed with a single dot. */
if (!streq(name, hn) && !streq_ptr(startswith(name, hn), "."))
goto not_found;
+1 -1
View File
@@ -1116,7 +1116,7 @@ static void bus_method_resolve_service_complete(DnsQuery *q) {
if (has_root_domain && found <= 0) {
/* If there's exactly one SRV RR and it uses
* the root domain as host name, then the
* the root domain as hostname, then the
* service is explicitly not offered on the
* domain. Report this as a recognizable
* error. See RFC 2782, Section "Usage
+2 -2
View File
@@ -100,7 +100,7 @@ static int parse_line(EtcHosts *hosts, unsigned nr, const char *line) {
r = extract_first_word(&line, &name, NULL, EXTRACT_RELAX);
if (r < 0)
return log_error_errno(r, "/etc/hosts:%u: couldn't extract host name: %m", nr);
return log_error_errno(r, "/etc/hosts:%u: couldn't extract hostname: %m", nr);
if (r == 0)
break;
@@ -162,7 +162,7 @@ static int parse_line(EtcHosts *hosts, unsigned nr, const char *line) {
}
if (!found)
log_warning("/etc/hosts:%u: line is missing any host names", nr);
log_warning("/etc/hosts:%u: line is missing any hostnames", nr);
return 0;
}
+3 -3
View File
@@ -341,7 +341,7 @@ static int determine_hostname(char **full_hostname, char **llmnr_hostname, char
p = h;
r = dns_label_unescape(&p, label, sizeof label, 0);
if (r < 0)
return log_error_errno(r, "Failed to unescape host name: %m");
return log_error_errno(r, "Failed to unescape hostname: %m");
if (r == 0)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Couldn't find a single label in hostname.");
@@ -371,7 +371,7 @@ static int determine_hostname(char **full_hostname, char **llmnr_hostname, char
r = dns_label_escape_new(decoded, r, &n);
if (r < 0)
return log_error_errno(r, "Failed to escape host name: %m");
return log_error_errno(r, "Failed to escape hostname: %m");
if (is_localhost(n))
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL),
@@ -411,7 +411,7 @@ static int make_fallback_hostnames(char **full_hostname, char **llmnr_hostname,
p = fallback_hostname();
r = dns_label_unescape(&p, label, sizeof label, 0);
if (r < 0)
return log_error_errno(r, "Failed to unescape fallback host name: %m");
return log_error_errno(r, "Failed to unescape fallback hostname: %m");
assert(r > 0); /* The fallback hostname must have at least one label */
+1 -1
View File
@@ -115,7 +115,7 @@ int install_full_printf(const UnitFileInstallInfo *i, const char *format, char *
* %U the UID of the running user
* %u the username of running user
* %m the machine ID of the running system
* %H the host name of the running system
* %H the hostname of the running system
* %b the boot ID of the running system
* %v `uname -r` of the running system
*/