Compare commits

..

No commits in common. "279be556f8c047778fb743f42bfcd84cf9fd663e" and "9a1862bfa6cdd1352101b232a24f039b88ef4cee" have entirely different histories.

7 changed files with 10 additions and 13 deletions

View File

@ -496,9 +496,11 @@ int getgroups_alloc(gid_t** gids) {
free(allocated);
p = allocated = new(gid_t, ngroups);
allocated = new(gid_t, ngroups);
if (!allocated)
return -ENOMEM;
p = allocated;
}
*gids = TAKE_PTR(p);

View File

@ -314,7 +314,7 @@ static int manager_add_home_by_record(
const char *fname) {
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
_cleanup_(user_record_unrefp) UserRecord *hr = NULL;
_cleanup_(user_record_unrefp) UserRecord *hr;
unsigned line, column;
int r, is_signed;
Home *h;

View File

@ -17,6 +17,9 @@ int home_prepare_cifs(
bool already_activated,
HomeSetup *setup) {
char **pw;
int r;
assert(h);
assert(setup);
assert(user_record_storage(h) == USER_CIFS);
@ -25,8 +28,6 @@ int home_prepare_cifs(
setup->root_fd = open(user_record_home_directory(h), O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOFOLLOW);
else {
bool mounted = false;
char **pw;
int r;
r = home_unshare_and_mount(NULL, NULL, false);
if (r < 0)
@ -91,7 +92,7 @@ int home_prepare_cifs(
setup->root_fd = open("/run/systemd/user-home-mount", O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOFOLLOW);
}
if (setup->root_fd < 0)
return log_error_errno(errno, "Failed to open home directory: %m");
return log_error_errno(r, "Failed to open home directory: %m");
return 0;
}

View File

@ -737,8 +737,6 @@ int user_record_make_hashed_password(UserRecord *h, char **secret, bool extend)
return r;
r = json_variant_set_field(&priv, "hashedPassword", new_array);
if (r < 0)
return r;
}
r = json_variant_set_field(&h->json, "privileged", priv);

View File

@ -906,7 +906,7 @@ static int mount_inaccessible(const char *dest, CustomMount *m) {
r = mount_verbose(m->graceful ? LOG_DEBUG : LOG_ERR, NULL, where, NULL, MS_BIND|MS_RDONLY|MS_REMOUNT, NULL);
if (r < 0) {
(void) umount_verbose(where);
umount_verbose(where);
return m->graceful ? 0 : r;
}

View File

@ -310,19 +310,15 @@ static void test_gid_lists_ops(void) {
int nresult;
nresult = merge_gid_lists(l2, ELEMENTSOF(l2), l3, ELEMENTSOF(l3), &res1);
assert_se(nresult >= 0);
assert_se(memcmp_nn(res1, nresult, result1, ELEMENTSOF(result1)) == 0);
nresult = merge_gid_lists(NULL, 0, l2, ELEMENTSOF(l2), &res2);
assert_se(nresult >= 0);
assert_se(memcmp_nn(res2, nresult, l2, ELEMENTSOF(l2)) == 0);
nresult = merge_gid_lists(l1, ELEMENTSOF(l1), l1, ELEMENTSOF(l1), &res3);
assert_se(nresult >= 0);
assert_se(memcmp_nn(l1, ELEMENTSOF(l1), res3, nresult) == 0);
nresult = merge_gid_lists(l1, ELEMENTSOF(l1), l4, ELEMENTSOF(l4), &res4);
assert_se(nresult >= 0);
assert_se(memcmp_nn(result2, ELEMENTSOF(result2), res4, nresult) == 0);
nresult = getgroups_alloc(&gids);

View File

@ -77,7 +77,7 @@ static int on_sigusr2(sd_event_source *s, const struct signalfd_siginfo *si, voi
}
int manager_new(Manager **ret) {
_cleanup_(manager_freep) Manager *m = NULL;
Manager *m;
int r;
m = new(Manager, 1);