Compare commits
8 Commits
1b87e27999
...
3d9489ee45
Author | SHA1 | Date |
---|---|---|
Anita Zhang | 3d9489ee45 | |
Anita Zhang | 4fbf39926e | |
Anita Zhang | 3adb304ae6 | |
Topi Miettinen | b8b7b838fd | |
Lennart Poettering | e46f877c5c | |
Zbigniew Jędrzejewski-Szmek | e6a4e25a82 | |
Zbigniew Jędrzejewski-Szmek | 82b2281dd5 | |
Zbigniew Jędrzejewski-Szmek | 934cf0a9c7 |
|
@ -398,8 +398,8 @@
|
|||
<varlistentry>
|
||||
<term><option>--output-fields=</option></term>
|
||||
|
||||
<listitem><para>A comma separated list of the fields which should be included in the output. This only has an
|
||||
effect for the output modes which would normally show all fields (<option>verbose</option>,
|
||||
<listitem><para>A comma separated list of the fields which should be included in the output. This has an
|
||||
effect only for the output modes which would normally show all fields (<option>verbose</option>,
|
||||
<option>export</option>, <option>json</option>, <option>json-pretty</option>, <option>json-sse</option> and
|
||||
<option>json-seq</option>). The <literal>__CURSOR</literal>, <literal>__REALTIME_TIMESTAMP</literal>,
|
||||
<literal>__MONOTONIC_TIMESTAMP</literal>, and <literal>_BOOT_ID</literal> fields are always
|
||||
|
@ -416,8 +416,13 @@
|
|||
<varlistentry>
|
||||
<term><option>--no-hostname</option></term>
|
||||
|
||||
<listitem><para>Don't show the hostname field of log messages originating from the local host. This switch only
|
||||
has an effect on the <option>short</option> family of output modes (see above).</para></listitem>
|
||||
<listitem><para>Don't show the hostname field of log messages originating from the local host. This
|
||||
switch has an effect only on the <option>short</option> family of output modes (see above).
|
||||
</para>
|
||||
|
||||
<para>Note: this option does not remove occurrences of the hostname from log entries themselves, so
|
||||
it does not prevent the hostname from being visible in the logs.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
|
|
|
@ -795,6 +795,7 @@ const sd_bus_vtable bus_exec_vtable[] = {
|
|||
SD_BUS_PROPERTY("MountFlags", "t", bus_property_get_ulong, offsetof(ExecContext, mount_flags), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("PrivateTmp", "b", bus_property_get_bool, offsetof(ExecContext, private_tmp), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("PrivateDevices", "b", bus_property_get_bool, offsetof(ExecContext, private_devices), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("ProtectClock", "b", bus_property_get_bool, offsetof(ExecContext, protect_clock), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("ProtectKernelTunables", "b", bus_property_get_bool, offsetof(ExecContext, protect_kernel_tunables), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("ProtectKernelModules", "b", bus_property_get_bool, offsetof(ExecContext, protect_kernel_modules), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("ProtectKernelLogs", "b", bus_property_get_bool, offsetof(ExecContext, protect_kernel_logs), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
|
|
|
@ -1765,6 +1765,45 @@ static int calculate_disk_size(UserRecord *h, const char *parent_dir, uint64_t *
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int home_truncate(
|
||||
UserRecord *h,
|
||||
int fd,
|
||||
const char *path,
|
||||
uint64_t size) {
|
||||
|
||||
bool trunc;
|
||||
int r;
|
||||
|
||||
assert(h);
|
||||
assert(fd >= 0);
|
||||
assert(path);
|
||||
|
||||
trunc = user_record_luks_discard(h);
|
||||
if (!trunc) {
|
||||
r = fallocate(fd, 0, 0, size);
|
||||
if (r < 0 && ERRNO_IS_NOT_SUPPORTED(errno)) {
|
||||
/* Some file systems do not support fallocate(), let's gracefully degrade
|
||||
* (ZFS, reiserfs, …) and fall back to truncation */
|
||||
log_notice_errno(errno, "Backing file system does not support fallocate(), falling back to ftruncate(), i.e. implicitly using non-discard mode.");
|
||||
trunc = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (trunc)
|
||||
r = ftruncate(fd, size);
|
||||
|
||||
if (r < 0) {
|
||||
if (ERRNO_IS_DISK_SPACE(errno)) {
|
||||
log_error_errno(errno, "Not enough disk space to allocate home.");
|
||||
return -ENOSPC; /* make recognizable */
|
||||
}
|
||||
|
||||
return log_error_errno(errno, "Failed to truncate home image %s: %m", path);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int home_create_luks(
|
||||
UserRecord *h,
|
||||
char **pkcs11_decrypted_passwords,
|
||||
|
@ -1917,20 +1956,9 @@ int home_create_luks(
|
|||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to set file attributes on %s, ignoring: %m", temporary_image_path);
|
||||
|
||||
if (user_record_luks_discard(h))
|
||||
r = ftruncate(image_fd, host_size);
|
||||
else
|
||||
r = fallocate(image_fd, 0, 0, host_size);
|
||||
if (r < 0) {
|
||||
if (ERRNO_IS_DISK_SPACE(errno)) {
|
||||
log_debug_errno(errno, "Not enough disk space to allocate home.");
|
||||
r = -ENOSPC; /* make recognizable */
|
||||
goto fail;
|
||||
}
|
||||
|
||||
r = log_error_errno(errno, "Failed to truncate home image %s: %m", temporary_image_path);
|
||||
r = home_truncate(h, image_fd, temporary_image_path, host_size);
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
log_info("Allocating image file completed.");
|
||||
}
|
||||
|
@ -2625,19 +2653,9 @@ int home_resize_luks(
|
|||
|
||||
if (S_ISREG(st.st_mode)) {
|
||||
/* Grow file size */
|
||||
|
||||
if (user_record_luks_discard(h))
|
||||
r = ftruncate(image_fd, new_image_size);
|
||||
else
|
||||
r = fallocate(image_fd, 0, 0, new_image_size);
|
||||
if (r < 0) {
|
||||
if (ERRNO_IS_DISK_SPACE(errno)) {
|
||||
log_debug_errno(errno, "Not enough disk space to grow home.");
|
||||
return -ENOSPC; /* make recognizable */
|
||||
}
|
||||
|
||||
return log_error_errno(errno, "Failed to grow image file %s: %m", ip);
|
||||
}
|
||||
r = home_truncate(h, image_fd, ip, new_image_size);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
log_info("Growing of image file completed.");
|
||||
}
|
||||
|
|
|
@ -786,7 +786,7 @@ static int help(void) {
|
|||
" --listen-http=ADDR Listen for HTTP connections at ADDR\n"
|
||||
" --listen-https=ADDR Listen for HTTPS connections at ADDR\n"
|
||||
" -o --output=FILE|DIR Write output to FILE or DIR/external-*.journal\n"
|
||||
" --compress[=BOOL] XZ-compress the output journal (default: yes)\n"
|
||||
" --compress[=BOOL] Use compression in the output journal (default: yes)\n"
|
||||
" --seal[=BOOL] Use event sealing (default: no)\n"
|
||||
" --key=FILENAME SSL key in PEM format (default:\n"
|
||||
" \"" PRIV_KEY_FILE "\")\n"
|
||||
|
|
|
@ -314,13 +314,9 @@ char *bus_address_escape(const char *v) {
|
|||
int bus_maybe_reply_error(sd_bus_message *m, int r, sd_bus_error *error) {
|
||||
assert(m);
|
||||
|
||||
if (r < 0) {
|
||||
if (sd_bus_error_is_set(error) || r < 0) {
|
||||
if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL)
|
||||
sd_bus_reply_method_errno(m, r, error);
|
||||
|
||||
} else if (sd_bus_error_is_set(error)) {
|
||||
if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL)
|
||||
sd_bus_reply_method_error(m, error);
|
||||
} else
|
||||
return r;
|
||||
|
||||
|
|
Loading…
Reference in New Issue