]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/home/home-util.h
425ad7be631f2f7caf1869d1e05022139be27eeb
[thirdparty/systemd.git] / src / home / home-util.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3
4 #include "forward.h"
5
6 /* Flags supported by UpdateEx() */
7 #define SD_HOMED_UPDATE_OFFLINE (UINT64_C(1) << 0)
8 #define SD_HOMED_UPDATE_FLAGS_ALL (SD_HOMED_UPDATE_OFFLINE)
9
10 /* Flags supported by CreateHomeEx() */
11 #define SD_HOMED_CREATE_FLAGS_ALL (0)
12
13 /* Put some limits on disk sizes: not less than 5M, not more than 5T */
14 #define USER_DISK_SIZE_MIN (UINT64_C(5)*1024*1024)
15 #define USER_DISK_SIZE_MAX (UINT64_C(5)*1024*1024*1024*1024)
16
17 /* The default disk size to use when nothing else is specified, relative to free disk space. We calculate
18 * this from the default rebalancing weights, so that what we create initially doesn't immediately require
19 * rebalancing. */
20 #define USER_DISK_SIZE_DEFAULT_PERCENT ((unsigned) ((100 * REBALANCE_WEIGHT_DEFAULT) / (REBALANCE_WEIGHT_DEFAULT + REBALANCE_WEIGHT_BACKING)))
21
22 extern const struct hash_ops blob_fd_hash_ops;
23
24 bool suitable_user_name(const char *name);
25 int suitable_realm(const char *realm);
26 int suitable_image_path(const char *path);
27
28 bool supported_fstype(const char *fstype);
29
30 int split_user_name_realm(const char *t, char **ret_user_name, char **ret_realm);
31
32 int bus_message_append_secret(sd_bus_message *m, UserRecord *secret);
33
34 /* Many of our operations might be slow due to crypto, fsck, recursive chown() and so on. For these
35 * operations permit a *very* long timeout */
36 #define HOME_SLOW_BUS_CALL_TIMEOUT_USEC (2*USEC_PER_MINUTE)
37
38 const char* home_record_dir(void);
39 const char* home_system_blob_dir(void);