1
0
mirror of https://github.com/systemd/systemd synced 2025-10-07 12:44:45 +02:00

Compare commits

..

No commits in common. "f6c81cc80537c207709edd853777c1ba92284bb5" and "5b94f463f020856c37e8dfb456626b7dd6d1255e" have entirely different histories.

11 changed files with 38 additions and 49 deletions

View File

@ -143,7 +143,7 @@ strategies to avoid these issues:
the sticky bit has a different meaning for them.
6. Don't use `/tmp/` or `/var/tmp/`, but use your own sub-directory under
`/run/` or `$XDG_RUNTIME_DIR` (the former if privileged, the latter if
`/run/` or `$XDG_RUNTIME_DIRECTORY` (the former if privileged, the latter if
unprivileged), or `/var/lib/` and `~/.config/` (similar, but with
persistency and suitable for larger data). The two temporary directories
`/tmp/` and `/var/tmp/` come with the implicit clean-up semantics described

View File

@ -13,7 +13,6 @@
#include "log.h"
#include "missing-network.h"
#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "string-util.h"
#include "strv.h"
@ -370,29 +369,6 @@ int parse_fd(const char *t) {
return fd;
}
int parse_user_shell(const char *s, char **ret_sh, bool *ret_copy) {
char *sh;
int r;
if (path_is_absolute(s) && path_is_normalized(s)) {
sh = strdup(s);
if (!sh)
return -ENOMEM;
*ret_sh = sh;
*ret_copy = false;
} else {
r = parse_boolean(s);
if (r < 0)
return r;
*ret_sh = NULL;
*ret_copy = r;
}
return 0;
}
static const char *mangle_base(const char *s, unsigned *base) {
const char *k;

View File

@ -20,7 +20,6 @@ int parse_sector_size(const char *t, uint64_t *ret);
int parse_range(const char *t, unsigned *lower, unsigned *upper);
int parse_errno(const char *t);
int parse_fd(const char *t);
int parse_user_shell(const char *s, char **ret_sh, bool *ret_copy);
#define SAFE_ATO_REFUSE_PLUS_MINUS (1U << 30)
#define SAFE_ATO_REFUSE_LEADING_ZERO (1U << 29)

View File

@ -33,11 +33,6 @@ UKI_DIR="$BOOT_ROOT/EFI/Linux"
case "$COMMAND" in
remove)
if [ "$KERNEL_INSTALL_BOOT_ENTRY_TYPE" = "type1" ]; then
[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
echo "BOOT_ENTRY_TYPE=type1, not removing UKI related."
exit 0
fi
[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
echo "Removing $UKI_DIR/$ENTRY_TOKEN-$KERNEL_VERSION*.efi and extras"
exec rm -rf \

View File

@ -1569,7 +1569,7 @@ static int setup_environment(
/* Also create a per-area subdirectory for $XDG_RUNTIME_DIR, so that each area has their own
* set of runtime services. We follow the same directory structure as for $HOME. Note that we
* do not define any form of automatic clean-up for the per-aera subdirs beyond the regular
* clean-up of the whole $XDG_RUNTIME_DIR hierarchy when the user finally logs out. */
* clean-up of the whole $XDG_RUNTIME_DIRECTORY hierarchy when the user finally logs out. */
r = make_area_runtime_directory(handle, ur, runtime_directory, area, &per_area_runtime_directory);
if (r != PAM_SUCCESS)

View File

@ -198,13 +198,15 @@ static int manager_enumerate_machines(Manager *m) {
k = manager_add_machine(m, de->d_name, &machine);
if (k < 0) {
RET_GATHER(r, log_error_errno(k, "Failed to add machine by file name %s: %m", de->d_name));
r = log_error_errno(k, "Failed to add machine by file name %s: %m", de->d_name);
continue;
}
machine_add_to_gc_queue(machine);
RET_GATHER(r, machine_load(machine));
k = machine_load(machine);
if (k < 0)
r = k;
}
return r;

View File

@ -1003,6 +1003,29 @@ int config_parse_bind_user(
return 0;
}
int parse_bind_user_shell(const char *s, char **ret_sh, bool *ret_copy) {
char *sh;
int r;
if (path_is_absolute(s) && path_is_normalized(s)) {
sh = strdup(s);
if (!sh)
return -ENOMEM;
*ret_sh = sh;
*ret_copy = false;
} else {
r = parse_boolean(s);
if (r < 0)
return r;
*ret_sh = NULL;
*ret_copy = r;
}
return 0;
}
int config_parse_bind_user_shell(
const char *unit,
const char *filename,
@ -1030,7 +1053,7 @@ int config_parse_bind_user_shell(
return 0;
}
r = parse_user_shell(rvalue, &sh, &copy);
r = parse_bind_user_shell(rvalue, &sh, &copy);
if (r == -ENOMEM)
return log_oom();
if (r < 0) {

View File

@ -276,6 +276,8 @@ CONFIG_PARSER_PROTOTYPE(config_parse_userns_ownership);
CONFIG_PARSER_PROTOTYPE(config_parse_bind_user);
CONFIG_PARSER_PROTOTYPE(config_parse_bind_user_shell);
int parse_bind_user_shell(const char *s, char **ret_sh, bool *ret_copy);
const char* resolv_conf_mode_to_string(ResolvConfMode a) _const_;
ResolvConfMode resolv_conf_mode_from_string(const char *s) _pure_;

View File

@ -1542,7 +1542,7 @@ static int parse_argv(int argc, char *argv[]) {
case ARG_BIND_USER_SHELL: {
bool copy = false;
char *sh = NULL;
r = parse_user_shell(optarg, &sh, &copy);
r = parse_bind_user_shell(optarg, &sh, &copy);
if (r == -ENOMEM)
return log_oom();
if (r < 0)

View File

@ -955,7 +955,7 @@ static uint64_t partition_fstype_min_size(const Context *c, const Partition *p)
}
static uint64_t partition_min_size(const Context *context, const Partition *p) {
uint64_t sz;
uint64_t sz, override_min;
assert(context);
assert(p);
@ -997,17 +997,9 @@ static uint64_t partition_min_size(const Context *context, const Partition *p) {
sz = d;
}
uint64_t min_size = p->size_min;
if (p->suppressing && (min_size == UINT64_MAX || p->suppressing->size_min > min_size))
min_size = p->suppressing->size_min;
override_min = p->suppressing ? MAX(p->size_min, p->suppressing->size_min) : p->size_min;
/* Default to 10M min size, except if the file system is read-only, in which case let's not enforce a
* minimum size, because even if we wanted to we couldn't take possession of the extra space
* allocated. */
if (min_size == UINT64_MAX)
min_size = (p->format && fstype_is_ro(p->format)) || p->verity != VERITY_OFF ? 1 : DEFAULT_MIN_SIZE;
return MAX(round_up_size(min_size, context->grain_size), sz);
return MAX(round_up_size(override_min != UINT64_MAX ? override_min : DEFAULT_MIN_SIZE, context->grain_size), sz);
}
static uint64_t partition_max_size(const Context *context, const Partition *p) {