]>
Commit | Line | Data |
---|---|---|
70a5db58 LP |
1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
2 | #pragma once | |
3 | ||
4 | #include "sd-bus.h" | |
5 | ||
6 | #include "user-record.h" | |
7 | #include "group-record.h" | |
8 | ||
9 | int user_record_synthesize(UserRecord *h, const char *user_name, const char *realm, const char *image_path, UserStorage storage, uid_t uid, gid_t gid); | |
10 | int group_record_synthesize(GroupRecord *g, UserRecord *u); | |
11 | ||
12 | typedef enum UserReconcileMode { | |
13 | USER_RECONCILE_ANY, | |
14 | USER_RECONCILE_REQUIRE_NEWER, /* host version must be newer than embedded version */ | |
15 | USER_RECONCILE_REQUIRE_NEWER_OR_EQUAL, /* similar, but may also be equal */ | |
16 | _USER_RECONCILE_MODE_MAX, | |
17 | _USER_RECONCILE_MODE_INVALID = -1, | |
18 | } UserReconcileMode; | |
19 | ||
20 | enum { /* return values */ | |
21 | USER_RECONCILE_HOST_WON, | |
22 | USER_RECONCILE_EMBEDDED_WON, | |
23 | USER_RECONCILE_IDENTICAL, | |
24 | }; | |
25 | ||
26 | int user_record_reconcile(UserRecord *host, UserRecord *embedded, UserReconcileMode mode, UserRecord **ret); | |
27 | int user_record_add_binding(UserRecord *h, UserStorage storage, const char *image_path, sd_id128_t partition_uuid, sd_id128_t luks_uuid, sd_id128_t fs_uuid, const char *luks_cipher, const char *luks_cipher_mode, uint64_t luks_volume_key_size, const char *file_system_type, const char *home_directory, uid_t uid, gid_t gid); | |
28 | ||
29 | /* Results of the two test functions below. */ | |
30 | enum { | |
31 | USER_TEST_UNDEFINED, /* Returned by user_record_test_image_path() if the storage type knows no image paths */ | |
32 | USER_TEST_ABSENT, | |
33 | USER_TEST_EXISTS, | |
34 | USER_TEST_MOUNTED, /* Only applies to user_record_test_home_directory(), when the home directory exists. */ | |
35 | USER_TEST_MAYBE, /* Only applies to LUKS devices: block device exists, but we don't know if it's the right one */ | |
36 | }; | |
37 | ||
38 | int user_record_test_home_directory(UserRecord *h); | |
39 | int user_record_test_home_directory_and_warn(UserRecord *h); | |
40 | int user_record_test_image_path(UserRecord *h); | |
41 | int user_record_test_image_path_and_warn(UserRecord *h); | |
42 | ||
87d7893c | 43 | int user_record_test_password(UserRecord *h, UserRecord *secret); |
aecbc87d | 44 | int user_record_test_recovery_key(UserRecord *h, UserRecord *secret); |
70a5db58 LP |
45 | |
46 | int user_record_update_last_changed(UserRecord *h, bool with_password); | |
47 | int user_record_set_disk_size(UserRecord *h, uint64_t disk_size); | |
48 | int user_record_set_password(UserRecord *h, char **password, bool prepend); | |
49 | int user_record_make_hashed_password(UserRecord *h, char **password, bool extend); | |
50 | int user_record_set_hashed_password(UserRecord *h, char **hashed_password); | |
c0bde0d2 | 51 | int user_record_set_token_pin(UserRecord *h, char **pin, bool prepend); |
70a5db58 | 52 | int user_record_set_pkcs11_protected_authentication_path_permitted(UserRecord *h, int b); |
7b78db28 | 53 | int user_record_set_fido2_user_presence_permitted(UserRecord *h, int b); |
70a5db58 LP |
54 | int user_record_set_password_change_now(UserRecord *h, int b); |
55 | int user_record_merge_secret(UserRecord *h, UserRecord *secret); | |
56 | int user_record_good_authentication(UserRecord *h); | |
57 | int user_record_bad_authentication(UserRecord *h); | |
58 | int user_record_ratelimit(UserRecord *h); | |
59 | ||
60 | int user_record_is_supported(UserRecord *hr, sd_bus_error *error); |