#include "blockdev-util.h"
#include "btrfs-util.h"
#include "bus-common-errors.h"
+#include "bus-locator.h"
#include "data-fd-util.h"
#include "env-util.h"
#include "errno-list.h"
#include "home-util.h"
#include "homed-home-bus.h"
#include "homed-home.h"
+#include "memfd-util.h"
#include "missing_magic.h"
+#include "missing_mman.h"
#include "missing_syscall.h"
#include "mkdir.h"
#include "path-util.h"
#include "process-util.h"
-#include "pwquality-util.h"
#include "quota-util.h"
#include "resize-fs.h"
#include "set.h"
#include "string-table.h"
#include "strv.h"
#include "uid-alloc-range.h"
-#include "user-record-pwquality.h"
+#include "user-record-password-quality.h"
#include "user-record-sign.h"
#include "user-record-util.h"
#include "user-record.h"
return 0;
}
- if (lseek(fd, SEEK_SET, 0) == (off_t) -1)
+ if (lseek(fd, SEEK_SET, 0) < 0)
return log_error_errno(errno, "Failed to seek to beginning of memfd: %m");
f = take_fdopen(&fd, "r");
log_debug("Sending to worker: %s", formatted);
- stdout_fd = memfd_create("homework-stdout", MFD_CLOEXEC);
+ stdout_fd = memfd_create_wrapper("homework-stdout", MFD_CLOEXEC | MFD_NOEXEC_SEAL);
if (stdout_fd < 0)
- return -errno;
+ return stdout_fd;
r = safe_fork_full("(sd-homework)",
(int[]) { stdin_fd, stdout_fd, STDERR_FILENO },
if (h->record->enforce_password_policy == false)
log_debug("Password quality check turned off for account, skipping.");
else {
- r = user_record_quality_check_password(h->record, secret, error);
+ r = user_record_check_password_quality(h->record, secret, error);
if (r < 0)
return r;
}
if (c->enforce_password_policy == false)
log_debug("Password quality check turned off for account, skipping.");
else {
- r = user_record_quality_check_password(c, merged_secret, error);
+ r = user_record_check_password_quality(c, merged_secret, error);
if (r < 0)
return r;
}
if (asprintf(&unit, "user-" UID_FMT ".slice", h->uid) < 0)
return log_oom();
- r = sd_bus_call_method(
- h->manager->bus,
- "org.freedesktop.systemd1",
- "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager",
- "KillUnit",
- &error,
- NULL,
- "ssi", unit, "all", SIGKILL);
+ r = bus_call_method(h->manager->bus, bus_systemd_mgr, "KillUnit", &error, NULL, "ssi", unit, "all", SIGKILL);
if (r < 0)
log_full_errno(sd_bus_error_has_name(&error, BUS_ERROR_NO_SUCH_UNIT) ? LOG_DEBUG : LOG_WARNING,
r, "Failed to kill login processes of user, ignoring: %s", bus_error_message(&error, r));
if (r < 0)
return r;
- r = json_variant_merge(&m, status);
+ r = json_variant_merge_object(&m, status);
if (r < 0)
return r;
assert(o);
assert(o->type == OPERATION_ACQUIRE);
- assert(!h->current_operation);
-
switch (home_get_state(h)) {
case HOME_UNFIXATED:
return 0;
}
+ assert(!h->current_operation);
+
r = home_ratelimit(h, &error);
if (r >= 0)
r = call(h, o->secret, for_state, &error);