Compare commits
No commits in common. "279be556f8c047778fb743f42bfcd84cf9fd663e" and "9a1862bfa6cdd1352101b232a24f039b88ef4cee" have entirely different histories.
279be556f8
...
9a1862bfa6
|
@ -496,9 +496,11 @@ int getgroups_alloc(gid_t** gids) {
|
||||||
|
|
||||||
free(allocated);
|
free(allocated);
|
||||||
|
|
||||||
p = allocated = new(gid_t, ngroups);
|
allocated = new(gid_t, ngroups);
|
||||||
if (!allocated)
|
if (!allocated)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
p = allocated;
|
||||||
}
|
}
|
||||||
|
|
||||||
*gids = TAKE_PTR(p);
|
*gids = TAKE_PTR(p);
|
||||||
|
|
|
@ -314,7 +314,7 @@ static int manager_add_home_by_record(
|
||||||
const char *fname) {
|
const char *fname) {
|
||||||
|
|
||||||
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
|
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
|
||||||
_cleanup_(user_record_unrefp) UserRecord *hr = NULL;
|
_cleanup_(user_record_unrefp) UserRecord *hr;
|
||||||
unsigned line, column;
|
unsigned line, column;
|
||||||
int r, is_signed;
|
int r, is_signed;
|
||||||
Home *h;
|
Home *h;
|
||||||
|
|
|
@ -17,6 +17,9 @@ int home_prepare_cifs(
|
||||||
bool already_activated,
|
bool already_activated,
|
||||||
HomeSetup *setup) {
|
HomeSetup *setup) {
|
||||||
|
|
||||||
|
char **pw;
|
||||||
|
int r;
|
||||||
|
|
||||||
assert(h);
|
assert(h);
|
||||||
assert(setup);
|
assert(setup);
|
||||||
assert(user_record_storage(h) == USER_CIFS);
|
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);
|
setup->root_fd = open(user_record_home_directory(h), O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOFOLLOW);
|
||||||
else {
|
else {
|
||||||
bool mounted = false;
|
bool mounted = false;
|
||||||
char **pw;
|
|
||||||
int r;
|
|
||||||
|
|
||||||
r = home_unshare_and_mount(NULL, NULL, false);
|
r = home_unshare_and_mount(NULL, NULL, false);
|
||||||
if (r < 0)
|
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);
|
setup->root_fd = open("/run/systemd/user-home-mount", O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOFOLLOW);
|
||||||
}
|
}
|
||||||
if (setup->root_fd < 0)
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -737,8 +737,6 @@ int user_record_make_hashed_password(UserRecord *h, char **secret, bool extend)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
r = json_variant_set_field(&priv, "hashedPassword", new_array);
|
r = json_variant_set_field(&priv, "hashedPassword", new_array);
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
r = json_variant_set_field(&h->json, "privileged", priv);
|
r = json_variant_set_field(&h->json, "privileged", priv);
|
||||||
|
|
|
@ -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);
|
r = mount_verbose(m->graceful ? LOG_DEBUG : LOG_ERR, NULL, where, NULL, MS_BIND|MS_RDONLY|MS_REMOUNT, NULL);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
(void) umount_verbose(where);
|
umount_verbose(where);
|
||||||
return m->graceful ? 0 : r;
|
return m->graceful ? 0 : r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -310,19 +310,15 @@ static void test_gid_lists_ops(void) {
|
||||||
int nresult;
|
int nresult;
|
||||||
|
|
||||||
nresult = merge_gid_lists(l2, ELEMENTSOF(l2), l3, ELEMENTSOF(l3), &res1);
|
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);
|
assert_se(memcmp_nn(res1, nresult, result1, ELEMENTSOF(result1)) == 0);
|
||||||
|
|
||||||
nresult = merge_gid_lists(NULL, 0, l2, ELEMENTSOF(l2), &res2);
|
nresult = merge_gid_lists(NULL, 0, l2, ELEMENTSOF(l2), &res2);
|
||||||
assert_se(nresult >= 0);
|
|
||||||
assert_se(memcmp_nn(res2, nresult, l2, ELEMENTSOF(l2)) == 0);
|
assert_se(memcmp_nn(res2, nresult, l2, ELEMENTSOF(l2)) == 0);
|
||||||
|
|
||||||
nresult = merge_gid_lists(l1, ELEMENTSOF(l1), l1, ELEMENTSOF(l1), &res3);
|
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);
|
assert_se(memcmp_nn(l1, ELEMENTSOF(l1), res3, nresult) == 0);
|
||||||
|
|
||||||
nresult = merge_gid_lists(l1, ELEMENTSOF(l1), l4, ELEMENTSOF(l4), &res4);
|
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);
|
assert_se(memcmp_nn(result2, ELEMENTSOF(result2), res4, nresult) == 0);
|
||||||
|
|
||||||
nresult = getgroups_alloc(&gids);
|
nresult = getgroups_alloc(&gids);
|
||||||
|
|
|
@ -77,7 +77,7 @@ static int on_sigusr2(sd_event_source *s, const struct signalfd_siginfo *si, voi
|
||||||
}
|
}
|
||||||
|
|
||||||
int manager_new(Manager **ret) {
|
int manager_new(Manager **ret) {
|
||||||
_cleanup_(manager_freep) Manager *m = NULL;
|
Manager *m;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
m = new(Manager, 1);
|
m = new(Manager, 1);
|
||||||
|
|
Loading…
Reference in New Issue