]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/home/homed-home.c
tree-wide: check if return value of lseek() and friends is negative
[thirdparty/systemd.git] / src / home / homed-home.c
index d16509d57437cc73b3a18b47e26885ad049a0d93..749670f94bea17b626224b9edcccca1d0fdbab42 100644 (file)
@@ -31,7 +31,6 @@
 #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"
@@ -40,7 +39,7 @@
 #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"
@@ -520,7 +519,7 @@ static int home_parse_worker_stdout(int _fd, UserRecord **ret) {
                 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");
@@ -1513,7 +1512,7 @@ int home_create(Home *h, UserRecord *secret, sd_bus_error *error) {
         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;
         }
@@ -1888,7 +1887,7 @@ int home_passwd(Home *h,
         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;
         }
@@ -2563,7 +2562,7 @@ int home_augment_status(
         if (r < 0)
                 return r;
 
-        r = json_variant_merge(&m, status);
+        r = json_variant_merge_object(&m, status);
         if (r < 0)
                 return r;
 
@@ -2681,8 +2680,6 @@ static int home_dispatch_acquire(Home *h, Operation *o) {
         assert(o);
         assert(o->type == OPERATION_ACQUIRE);
 
-        assert(!h->current_operation);
-
         switch (home_get_state(h)) {
 
         case HOME_UNFIXATED:
@@ -2718,6 +2715,8 @@ static int home_dispatch_acquire(Home *h, Operation *o) {
                 return 0;
         }
 
+        assert(!h->current_operation);
+
         r = home_ratelimit(h, &error);
         if (r >= 0)
                 r = call(h, o->secret, for_state, &error);