tree-wide: Fix declaration/definition parameter name mismatches

This commit is contained in:
Daan De Meyer
2025-11-26 19:02:31 +09:00
committed by Yu Watanabe
parent a8374a7607
commit 6a9f0641cd
227 changed files with 821 additions and 675 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ int parse_acl(
acl_t *ret_acl_access_exec,
acl_t *ret_acl_default,
bool want_mask);
int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *ret);
int acls_for_file(const char *path, acl_type_t type, acl_t acl, acl_t *ret);
int fd_add_uid_acl_permission(int fd, uid_t uid, unsigned mask);
int fd_acl_make_read_only(int fd);
+1 -1
View File
@@ -32,7 +32,7 @@ struct Barrier {
#define BARRIER_NULL {-EBADF, -EBADF, {-EBADF, -EBADF}, 0}
int barrier_create(Barrier *obj);
int barrier_create(Barrier *b);
Barrier* barrier_destroy(Barrier *b);
DEFINE_TRIVIAL_CLEANUP_FUNC(Barrier*, barrier_destroy);
+3 -3
View File
@@ -30,10 +30,10 @@ int block_get_whole_disk(dev_t d, dev_t *ret);
int block_get_originating(dev_t d, dev_t *ret);
int get_block_device_fd(int fd, dev_t *ret);
int get_block_device(const char *path, dev_t *dev);
int get_block_device(const char *path, dev_t *ret);
int get_block_device_harder_fd(int fd, dev_t *dev);
int get_block_device_harder(const char *path, dev_t *dev);
int get_block_device_harder_fd(int fd, dev_t *ret);
int get_block_device_harder(const char *path, dev_t *ret);
int lock_whole_block_device(dev_t devt, int open_flags, int operation);
+8 -8
View File
@@ -81,25 +81,25 @@ typedef enum BondPrimaryReselect {
} BondPrimaryReselect;
const char* bond_mode_to_string(BondMode d) _const_;
BondMode bond_mode_from_string(const char *d) _pure_;
BondMode bond_mode_from_string(const char *s) _pure_;
const char* bond_xmit_hash_policy_to_string(BondXmitHashPolicy d) _const_;
BondXmitHashPolicy bond_xmit_hash_policy_from_string(const char *d) _pure_;
BondXmitHashPolicy bond_xmit_hash_policy_from_string(const char *s) _pure_;
const char* bond_lacp_rate_to_string(BondLacpRate d) _const_;
BondLacpRate bond_lacp_rate_from_string(const char *d) _pure_;
BondLacpRate bond_lacp_rate_from_string(const char *s) _pure_;
const char* bond_fail_over_mac_to_string(BondFailOverMac d) _const_;
BondFailOverMac bond_fail_over_mac_from_string(const char *d) _pure_;
BondFailOverMac bond_fail_over_mac_from_string(const char *s) _pure_;
const char* bond_ad_select_to_string(BondAdSelect d) _const_;
BondAdSelect bond_ad_select_from_string(const char *d) _pure_;
BondAdSelect bond_ad_select_from_string(const char *s) _pure_;
const char* bond_arp_validate_to_string(BondArpValidate d) _const_;
BondArpValidate bond_arp_validate_from_string(const char *d) _pure_;
BondArpValidate bond_arp_validate_from_string(const char *s) _pure_;
const char* bond_arp_all_targets_to_string(BondArpAllTargets d) _const_;
BondArpAllTargets bond_arp_all_targets_from_string(const char *d) _pure_;
BondArpAllTargets bond_arp_all_targets_from_string(const char *s) _pure_;
const char* bond_primary_reselect_to_string(BondPrimaryReselect d) _const_;
BondPrimaryReselect bond_primary_reselect_from_string(const char *d) _pure_;
BondPrimaryReselect bond_primary_reselect_from_string(const char *s) _pure_;
+3 -3
View File
@@ -435,21 +435,21 @@ int boot_config_load_type1(
const char *root,
const BootEntrySource source,
const char *dir,
const char *fname) {
const char *filename) {
int r;
assert(config);
assert(f);
assert(root);
assert(dir);
assert(fname);
assert(filename);
if (!GREEDY_REALLOC(config->entries, config->n_entries + 1))
return log_oom();
BootEntry *entry = config->entries + config->n_entries;
r = boot_entry_load_type1(f, root, source, dir, fname, entry);
r = boot_entry_load_type1(f, root, source, dir, filename, entry);
if (r < 0)
return r;
config->n_entries++;
+2 -2
View File
@@ -125,12 +125,12 @@ int boot_config_load_type1(
const char *root,
BootEntrySource source,
const char *dir,
const char *id);
const char *filename);
int boot_config_finalize(BootConfig *config);
int boot_config_load(BootConfig *config, const char *esp_path, const char *xbootldr_path);
int boot_config_load_auto(BootConfig *config, const char *override_esp_path, const char *override_xbootldr_path);
int boot_config_augment_from_loader(BootConfig *config, char **list, bool auto_only);
int boot_config_augment_from_loader(BootConfig *config, char **found_by_loader, bool auto_only);
int boot_config_select_special_entries(BootConfig *config, bool skip_efivars);
+1 -1
View File
@@ -11,7 +11,7 @@ bool bpf_can_link_program(struct bpf_program *prog);
int bpf_serialize_link(FILE *f, FDSet *fds, const char *key, struct bpf_link *link);
struct bpf_link* bpf_link_free(struct bpf_link *p);
struct bpf_link* bpf_link_free(struct bpf_link *link);
DEFINE_TRIVIAL_CLEANUP_FUNC(struct bpf_link *, bpf_link_free);
struct ring_buffer* bpf_ring_buffer_free(struct ring_buffer *rb);
+1 -1
View File
@@ -30,7 +30,7 @@ int bpf_program_new(uint32_t prog_type, const char *prog_name, BPFProgram **ret)
int bpf_program_new_from_bpffs_path(const char *path, BPFProgram **ret);
BPFProgram *bpf_program_free(BPFProgram *p);
int bpf_program_add_instructions(BPFProgram *p, const struct bpf_insn *insn, size_t count);
int bpf_program_add_instructions(BPFProgram *p, const struct bpf_insn *instructions, size_t count);
int bpf_program_load_kernel(BPFProgram *p, char *log_buf, size_t log_size);
int bpf_program_load_from_bpf_fs(BPFProgram *p, const char *path);
+1 -1
View File
@@ -16,4 +16,4 @@ typedef enum BridgeState {
} BridgeState;
const char* bridge_state_to_string(BridgeState d) _const_;
BridgeState bridge_state_from_string(const char *d) _pure_;
BridgeState bridge_state_from_string(const char *s) _pure_;
+6 -6
View File
@@ -91,17 +91,17 @@ int btrfs_subvol_get_id(int fd, const char *subvolume, uint64_t *ret);
int btrfs_subvol_get_id_fd(int fd, uint64_t *ret);
int btrfs_subvol_get_parent(int fd, uint64_t subvol_id, uint64_t *ret);
int btrfs_subvol_get_info_fd(int fd, uint64_t subvol_id, BtrfsSubvolInfo *info);
int btrfs_subvol_get_info_fd(int fd, uint64_t subvol_id, BtrfsSubvolInfo *ret);
int btrfs_subvol_find_subtree_qgroup(int fd, uint64_t subvol_id, uint64_t *ret);
int btrfs_subvol_get_subtree_quota(const char *path, uint64_t subvol_id, BtrfsQuotaInfo *quota);
int btrfs_subvol_get_subtree_quota_fd(int fd, uint64_t subvol_id, BtrfsQuotaInfo *quota);
int btrfs_subvol_get_subtree_quota(const char *path, uint64_t subvol_id, BtrfsQuotaInfo *ret);
int btrfs_subvol_get_subtree_quota_fd(int fd, uint64_t subvol_id, BtrfsQuotaInfo *ret);
int btrfs_subvol_set_subtree_quota_limit(const char *path, uint64_t subvol_id, uint64_t referenced_max);
int btrfs_subvol_set_subtree_quota_limit_fd(int fd, uint64_t subvol_id, uint64_t referenced_max);
int btrfs_subvol_auto_qgroup_fd(int fd, uint64_t subvol_id, bool new_qgroup);
int btrfs_subvol_auto_qgroup_fd(int fd, uint64_t subvol_id, bool insert_intermediary_qgroup);
int btrfs_subvol_auto_qgroup(const char *path, uint64_t subvol_id, bool create_intermediary_qgroup);
int btrfs_subvol_make_default(const char *path);
@@ -123,8 +123,8 @@ int btrfs_qgroup_unassign(int fd, uint64_t child, uint64_t parent);
int btrfs_qgroup_find_parents(int fd, uint64_t qgroupid, uint64_t **ret);
int btrfs_qgroup_get_quota_fd(int fd, uint64_t qgroupid, BtrfsQuotaInfo *quota);
int btrfs_qgroup_get_quota(const char *path, uint64_t qgroupid, BtrfsQuotaInfo *quota);
int btrfs_qgroup_get_quota_fd(int fd, uint64_t qgroupid, BtrfsQuotaInfo *ret);
int btrfs_qgroup_get_quota(const char *path, uint64_t qgroupid, BtrfsQuotaInfo *ret);
int btrfs_log_dev_root(int level, int ret, const char *p);
+40 -5
View File
@@ -7,10 +7,45 @@ extern const BusObjectImplementation log_control_object;
int bus_log_control_api_register(sd_bus *bus);
int bus_property_get_log_level(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *reterr_error);
int bus_property_set_log_level(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *value, void *userdata, sd_bus_error *reterr_error);
int bus_property_get_log_level(
sd_bus *bus,
const char *path,
const char *interface,
const char *property,
sd_bus_message *reply,
void *userdata,
sd_bus_error *reterr_error);
int bus_property_set_log_level(
sd_bus *bus,
const char *path,
const char *interface,
const char *property,
sd_bus_message *value,
void *userdata,
sd_bus_error *reterr_error);
int bus_property_get_log_target(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *reterr_error);
int bus_property_set_log_target(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *reterr_error);
int bus_property_get_log_target(
sd_bus *bus,
const char *path,
const char *interface,
const char *property,
sd_bus_message *reply,
void *userdata,
sd_bus_error *reterr_error);
int bus_property_set_log_target(
sd_bus *bus,
const char *path,
const char *interface,
const char *property,
sd_bus_message *value,
void *userdata,
sd_bus_error *reterr_error);
int bus_property_get_syslog_identifier(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *reterr_error);
int bus_property_get_syslog_identifier(
sd_bus *bus,
const char *path,
const char *interface,
const char *property,
sd_bus_message *reply,
void *userdata,
sd_bus_error *reterr_error);
+2 -2
View File
@@ -35,8 +35,8 @@ int bus_connect_user_systemd(sd_bus **ret);
int bus_connect_capsule_systemd(const char *capsule, sd_bus **ret);
int bus_connect_capsule_bus(const char *capsule, sd_bus **ret);
int bus_connect_transport(BusTransport transport, const char *host, RuntimeScope runtime_scope, sd_bus **bus);
int bus_connect_transport_systemd(BusTransport transport, const char *host, RuntimeScope runtime_scope, sd_bus **bus);
int bus_connect_transport(BusTransport transport, const char *host, RuntimeScope runtime_scope, sd_bus **ret);
int bus_connect_transport_systemd(BusTransport transport, const char *host, RuntimeScope runtime_scope, sd_bus **ret);
int bus_log_address_error(int r, BusTransport transport);
int bus_log_connect_full(int log_level, int r, BusTransport transport, RuntimeScope scope);
+2 -2
View File
@@ -73,7 +73,7 @@ typedef struct Condition {
Condition* condition_new(ConditionType type, const char *parameter, bool trigger, bool negate);
Condition* condition_free(Condition *c);
Condition* condition_free_list_type(Condition *first, ConditionType type);
Condition* condition_free_list_type(Condition *head, ConditionType type);
static inline Condition* condition_free_list(Condition *first) {
return condition_free_list_type(first, _CONDITION_TYPE_INVALID);
}
@@ -85,7 +85,7 @@ typedef const char* (*condition_to_string_t)(ConditionType t) _const_;
bool condition_test_list(Condition *first, char **env, condition_to_string_t to_string, condition_test_logger_t logger, void *userdata);
void condition_dump(Condition *c, FILE *f, const char *prefix, condition_to_string_t to_string);
void condition_dump_list(Condition *c, FILE *f, const char *prefix, condition_to_string_t to_string);
void condition_dump_list(Condition *first, FILE *f, const char *prefix, condition_to_string_t to_string);
const char* condition_type_to_string(ConditionType t) _const_;
ConditionType condition_type_from_string(const char *s) _pure_;
+1 -1
View File
@@ -77,7 +77,7 @@ int config_parse_many(
ConfigParseFlags flags,
void *userdata,
Hashmap **ret_stats_by_path, /* possibly NULL */
char ***ret_drop_in_files); /* possibly NULL */
char ***ret_dropin_files); /* possibly NULL */
int config_parse_standard_file_with_dropins_full(
const char *root,
+7 -7
View File
@@ -47,15 +47,15 @@ typedef enum DenyType {
typedef int (*copy_progress_bytes_t)(uint64_t n_bytes, uint64_t bytes_per_second, void *userdata);
typedef int (*copy_progress_path_t)(const char *path, const struct stat *st, void *userdata);
int copy_file_fd_at_full(int dir_fdf, const char *from, int to, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata);
static inline int copy_file_fd_at(int dir_fdf, const char *from, int to, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata) {
return copy_file_fd_at_full(dir_fdf, from, to, copy_flags, progress, userdata);
int copy_file_fd_at_full(int dir_fdf, const char *from, int fdt, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata);
static inline int copy_file_fd_at(int dir_fdf, const char *from, int fdt, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata) {
return copy_file_fd_at_full(dir_fdf, from, fdt, copy_flags, progress, userdata);
}
static inline int copy_file_fd_full(const char *from, int to, CopyFlags copy_flags) {
return copy_file_fd_at_full(AT_FDCWD, from, to, copy_flags, NULL, NULL);
static inline int copy_file_fd_full(const char *from, int fdt, CopyFlags copy_flags) {
return copy_file_fd_at_full(AT_FDCWD, from, fdt, copy_flags, NULL, NULL);
}
static inline int copy_file_fd(const char *from, int to, CopyFlags copy_flags) {
return copy_file_fd_at(AT_FDCWD, from, to, copy_flags, NULL, NULL);
static inline int copy_file_fd(const char *from, int fdt, CopyFlags copy_flags) {
return copy_file_fd_at(AT_FDCWD, from, fdt, copy_flags, NULL, NULL);
}
int copy_file_at_full(int dir_fdf, const char *from, int dir_fdt, const char *to, int open_flags, mode_t mode, unsigned chattr_flags, unsigned chattr_mask, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata);
+8 -8
View File
@@ -4192,16 +4192,16 @@ finish:
return r;
}
Architecture dissected_image_architecture(DissectedImage *img) {
assert(img);
Architecture dissected_image_architecture(DissectedImage *m) {
assert(m);
if (img->partitions[PARTITION_ROOT].found &&
img->partitions[PARTITION_ROOT].architecture >= 0)
return img->partitions[PARTITION_ROOT].architecture;
if (m->partitions[PARTITION_ROOT].found &&
m->partitions[PARTITION_ROOT].architecture >= 0)
return m->partitions[PARTITION_ROOT].architecture;
if (img->partitions[PARTITION_USR].found &&
img->partitions[PARTITION_USR].architecture >= 0)
return img->partitions[PARTITION_USR].architecture;
if (m->partitions[PARTITION_USR].found &&
m->partitions[PARTITION_USR].architecture >= 0)
return m->partitions[PARTITION_USR].architecture;
return _ARCHITECTURE_INVALID;
}
+13 -2
View File
@@ -235,9 +235,20 @@ bool dissected_image_verity_candidate(const DissectedImage *image, PartitionDesi
bool dissected_image_verity_ready(const DissectedImage *image, PartitionDesignator d);
bool dissected_image_verity_sig_ready(const DissectedImage *image, PartitionDesignator d);
int mount_image_privately_interactively(const char *path, const ImagePolicy *image_policy, DissectImageFlags flags, char **ret_directory, int *ret_dir_fd, LoopDevice **ret_loop_device);
int mount_image_privately_interactively(const char *image, const ImagePolicy *image_policy, DissectImageFlags flags, char **ret_directory, int *ret_dir_fd, LoopDevice **ret_loop_device);
int verity_dissect_and_mount(int src_fd, const char *src, const char *dest, const MountOptions *options, const ImagePolicy *image_policy, const ImageFilter *image_filter, const ExtensionReleaseData *required_release_data, ImageClass required_class, VeritySettings *verity, RuntimeScope runtime_scope, DissectedImage **ret_image);
int verity_dissect_and_mount(
int src_fd,
const char *src,
const char *dest,
const MountOptions *options,
const ImagePolicy *image_policy,
const ImageFilter *image_filter,
const ExtensionReleaseData *extension_release_data,
ImageClass required_class,
VeritySettings *verity,
RuntimeScope runtime_scope,
DissectedImage **ret_image);
int dissect_fstype_ok(const char *fstype);
+5 -5
View File
@@ -756,12 +756,12 @@ int dns_name_reverse(int family, const union in_addr_union *a, char **ret) {
return 0;
}
int dns_name_address(const char *p, int *ret_family, union in_addr_union *ret_address) {
int dns_name_address(const char *p, int *ret_family, union in_addr_union *ret) {
int r;
assert(p);
assert(ret_family);
assert(ret_address);
assert(ret);
r = dns_name_endswith(p, "in-addr.arpa");
if (r < 0)
@@ -790,7 +790,7 @@ int dns_name_address(const char *p, int *ret_family, union in_addr_union *ret_ad
return r;
*ret_family = AF_INET;
ret_address->in.s_addr = htobe32(((uint32_t) a[3] << 24) |
ret->in.s_addr = htobe32(((uint32_t) a[3] << 24) |
((uint32_t) a[2] << 16) |
((uint32_t) a[1] << 8) |
(uint32_t) a[0]);
@@ -834,12 +834,12 @@ int dns_name_address(const char *p, int *ret_family, union in_addr_union *ret_ad
return r;
*ret_family = AF_INET6;
ret_address->in6 = a;
ret->in6 = a;
return 1;
}
*ret_family = AF_UNSPEC;
*ret_address = IN_ADDR_NULL;
*ret = IN_ADDR_NULL;
return 0;
}
+3 -3
View File
@@ -10,7 +10,7 @@ typedef enum DNSLabelFlags {
} DNSLabelFlags;
int dns_label_unescape(const char **name, char *dest, size_t sz, DNSLabelFlags flags);
int dns_label_unescape_suffix(const char *name, const char **label_end, char *dest, size_t sz);
int dns_label_unescape_suffix(const char *name, const char **label_terminal, char *dest, size_t sz);
int dns_label_escape(const char *p, size_t l, char *dest, size_t sz);
int dns_label_escape_new(const char *p, size_t l, char **ret);
@@ -51,7 +51,7 @@ static inline int dns_name_is_valid_ldh(const char *s) {
return 1;
}
void dns_name_hash_func(const char *s, struct siphash *state);
void dns_name_hash_func(const char *name, struct siphash *state);
int dns_name_compare_func(const char *a, const char *b);
extern const struct hash_ops dns_name_hash_ops;
extern const struct hash_ops dns_name_hash_ops_free;
@@ -64,7 +64,7 @@ int dns_name_startswith(const char *name, const char *prefix);
int dns_name_change_suffix(const char *name, const char *old_suffix, const char *new_suffix, char **ret);
int dns_name_reverse(int family, const union in_addr_union *a, char **ret);
int dns_name_address(const char *p, int *family, union in_addr_union *a);
int dns_name_address(const char *p, int *family, union in_addr_union *ret);
bool dns_name_is_root(const char *name);
bool dns_name_is_single_label(const char *name);
+4 -4
View File
@@ -148,8 +148,8 @@ static inline unsigned DNS_PACKET_RRCOUNT(DnsPacket *p) {
(unsigned) DNS_PACKET_ARCOUNT(p);
}
int dns_packet_new(DnsPacket **p, DnsProtocol protocol, size_t min_alloc_dsize, size_t max_size);
int dns_packet_new_query(DnsPacket **p, DnsProtocol protocol, size_t min_alloc_dsize, bool dnssec_checking_disabled);
int dns_packet_new(DnsPacket **ret, DnsProtocol protocol, size_t min_alloc_dsize, size_t max_size);
int dns_packet_new_query(DnsPacket **ret, DnsProtocol protocol, size_t min_alloc_dsize, bool dnssec_checking_disabled);
int dns_packet_dup(DnsPacket **ret, DnsPacket *p);
@@ -174,13 +174,13 @@ int dns_packet_validate_query(DnsPacket *p);
int dns_packet_is_reply_for(DnsPacket *p, const DnsResourceKey *key);
int dns_packet_append_blob(DnsPacket *p, const void *d, size_t sz, size_t *start);
int dns_packet_append_blob(DnsPacket *p, const void *d, size_t l, size_t *start);
int dns_packet_append_uint8(DnsPacket *p, uint8_t v, size_t *start);
int dns_packet_append_uint16(DnsPacket *p, uint16_t v, size_t *start);
int dns_packet_append_uint32(DnsPacket *p, uint32_t v, size_t *start);
int dns_packet_append_string(DnsPacket *p, const char *s, size_t *start);
int dns_packet_append_raw_string(DnsPacket *p, const void *s, size_t size, size_t *start);
int dns_packet_append_label(DnsPacket *p, const char *s, size_t l, bool canonical_candidate, size_t *start);
int dns_packet_append_label(DnsPacket *p, const char *d, size_t l, bool canonical_candidate, size_t *start);
int dns_packet_append_name(DnsPacket *p, const char *name, bool allow_compression, bool canonical_candidate, size_t *start);
int dns_packet_append_key(DnsPacket *p, const DnsResourceKey *key, DnsAnswerFlags flags, size_t *start);
int dns_packet_append_rr(DnsPacket *p, const DnsResourceRecord *rr, DnsAnswerFlags flags, size_t *start, size_t *rdata_start);
+4 -4
View File
@@ -407,12 +407,12 @@ bool dns_resource_record_is_link_local_address(DnsResourceRecord *rr);
int dns_resource_record_get_cname_target(DnsResourceKey *key, DnsResourceRecord *cname, char **ret);
DnsTxtItem *dns_txt_item_free_all(DnsTxtItem *i);
DnsTxtItem *dns_txt_item_free_all(DnsTxtItem *first);
bool dns_txt_item_equal(DnsTxtItem *a, DnsTxtItem *b);
DnsTxtItem *dns_txt_item_copy(DnsTxtItem *i);
DnsTxtItem *dns_txt_item_copy(DnsTxtItem *first);
int dns_txt_item_new_empty(DnsTxtItem **ret);
DnsSvcParam *dns_svc_param_free_all(DnsSvcParam *i);
DnsSvcParam *dns_svc_param_free_all(DnsSvcParam *first);
bool dns_svc_params_equal(DnsSvcParam *a, DnsSvcParam *b);
DnsSvcParam *dns_svc_params_copy(DnsSvcParam *first);
@@ -424,7 +424,7 @@ int dns_resource_record_to_json(DnsResourceRecord *rr, sd_json_variant **ret);
void dns_resource_key_hash_func(const DnsResourceKey *k, struct siphash *state);
int dns_resource_key_compare_func(const DnsResourceKey *x, const DnsResourceKey *y);
void dns_resource_record_hash_func(const DnsResourceRecord *i, struct siphash *state);
void dns_resource_record_hash_func(const DnsResourceRecord *rr, struct siphash *state);
int dns_resource_record_compare_func(const DnsResourceRecord *x, const DnsResourceRecord *y);
uint16_t dnssec_keytag(DnsResourceRecord *dnskey, bool mask_revoke);
+1 -1
View File
@@ -147,7 +147,7 @@ const char* dns_type_to_string(int type);
int dns_type_from_string(const char *s);
const char* dns_class_to_string(uint16_t class);
int dns_class_from_string(const char *name);
int dns_class_from_string(const char *s);
/* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.2 */
const char* tlsa_cert_usage_to_string(uint8_t cert_usage);
+1 -1
View File
@@ -32,4 +32,4 @@ int unit_file_find_dropin_paths(
const char *file_suffix,
const char *name,
const Set *aliases,
char ***paths);
char ***ret);
+1 -1
View File
@@ -11,7 +11,7 @@ int efi_reboot_to_firmware_supported(void);
int efi_get_reboot_to_firmware(void);
int efi_set_reboot_to_firmware(bool value);
int efi_get_boot_option(uint16_t nr, char **ret_title, sd_id128_t *ret_part_uuid, char **ret_path, bool *ret_active);
int efi_get_boot_option(uint16_t id, char **ret_title, sd_id128_t *ret_part_uuid, char **ret_path, bool *ret_active);
int efi_add_boot_option(uint16_t id, const char *title, uint32_t part, uint64_t pstart, uint64_t psize, sd_id128_t part_uuid, const char *path);
int efi_remove_boot_option(uint16_t id);
int efi_get_boot_order(uint16_t **ret_order);
+2 -2
View File
@@ -173,12 +173,12 @@ int ethtool_set_eee_settings(
uint32_t advertise);
const char* duplex_to_string(Duplex d) _const_;
Duplex duplex_from_string(const char *d) _pure_;
Duplex duplex_from_string(const char *s) _pure_;
int wol_options_to_string_alloc(uint32_t opts, char **ret);
const char* port_to_string(NetDevPort port) _const_;
NetDevPort port_from_string(const char *port) _pure_;
NetDevPort port_from_string(const char *s) _pure_;
const char* mdi_to_string(int mdi) _const_;
+1 -1
View File
@@ -3,7 +3,7 @@
#include "shared-forward.h"
int fork_notify(char * const *cmdline, PidRef *ret_pidref);
int fork_notify(char * const *argv, PidRef *ret_pidref);
void fork_notify_terminate(PidRef *pidref);
+7 -7
View File
@@ -457,7 +457,7 @@ static TableData *table_data_new(
int table_add_cell_full(
Table *t,
TableCell **ret_cell,
TableDataType type,
TableDataType dt,
const void *data,
size_t minimum_width,
size_t maximum_width,
@@ -470,12 +470,12 @@ int table_add_cell_full(
TableData *p;
assert(t);
assert(type >= 0);
assert(type < _TABLE_DATA_TYPE_MAX);
assert(dt >= 0);
assert(dt < _TABLE_DATA_TYPE_MAX);
/* Special rule: patch NULL data fields to the empty field */
if (!data)
type = TABLE_EMPTY;
dt = TABLE_EMPTY;
/* Determine the cell adjacent to the current one, but one row up */
if (t->n_cells >= t->n_columns)
@@ -499,15 +499,15 @@ int table_add_cell_full(
assert(align_percent <= 100);
assert(ellipsize_percent <= 100);
uppercase = type == TABLE_HEADER;
uppercase = dt == TABLE_HEADER;
/* Small optimization: Pretty often adjacent cells in two subsequent lines have the same data and
* formatting. Let's see if we can reuse the cell data and ref it once more. */
if (p && table_data_matches(p, type, data, minimum_width, maximum_width, weight, align_percent, ellipsize_percent, uppercase))
if (p && table_data_matches(p, dt, data, minimum_width, maximum_width, weight, align_percent, ellipsize_percent, uppercase))
d = table_data_ref(p);
else {
d = table_data_new(type, data, minimum_width, maximum_width, weight, align_percent, ellipsize_percent, uppercase);
d = table_data_new(dt, data, minimum_width, maximum_width, weight, align_percent, ellipsize_percent, uppercase);
if (!d)
return -ENOMEM;
}
+4 -4
View File
@@ -99,11 +99,11 @@ Table *table_unref(Table *t);
DEFINE_TRIVIAL_CLEANUP_FUNC(Table*, table_unref);
int table_add_cell_full(Table *t, TableCell **ret_cell, TableDataType type, const void *data, size_t minimum_width, size_t maximum_width, unsigned weight, unsigned align_percent, unsigned ellipsize_percent);
static inline int table_add_cell(Table *t, TableCell **ret_cell, TableDataType type, const void *data) {
return table_add_cell_full(t, ret_cell, type, data, SIZE_MAX, SIZE_MAX, UINT_MAX, UINT_MAX, UINT_MAX);
int table_add_cell_full(Table *t, TableCell **ret_cell, TableDataType dt, const void *data, size_t minimum_width, size_t maximum_width, unsigned weight, unsigned align_percent, unsigned ellipsize_percent);
static inline int table_add_cell(Table *t, TableCell **ret_cell, TableDataType dt, const void *data) {
return table_add_cell_full(t, ret_cell, dt, data, SIZE_MAX, SIZE_MAX, UINT_MAX, UINT_MAX, UINT_MAX);
}
int table_add_cell_stringf_full(Table *t, TableCell **ret_cell, TableDataType type, const char *format, ...) _printf_(4, 5);
int table_add_cell_stringf_full(Table *t, TableCell **ret_cell, TableDataType dt, const char *format, ...) _printf_(4, 5);
#define table_add_cell_stringf(t, ret_cell, format, ...) table_add_cell_stringf_full(t, ret_cell, TABLE_STRING, format, __VA_ARGS__)
int table_fill_empty(Table *t, size_t until_column);
+3 -3
View File
@@ -36,7 +36,7 @@ static int symlink_unless_exists(const char *target, const char *linkpath) {
int generator_open_unit_file_full(
const char *dir,
const char *source,
const char *fn,
const char *filename,
FILE **ret_file,
char **ret_final_path,
char **ret_temp_path) {
@@ -60,9 +60,9 @@ int generator_open_unit_file_full(
*ret_temp_path = TAKE_PTR(p);
} else {
assert(fn);
assert(filename);
p = path_join(dir, fn);
p = path_join(dir, filename);
if (!p)
return log_oom();
+3 -3
View File
@@ -4,9 +4,9 @@
#include "shared-forward.h"
#include "main-func.h"
int generator_open_unit_file_full(const char *dest, const char *source, const char *name, FILE **ret_file, char **ret_final_path, char **ret_temp_path);
static inline int generator_open_unit_file(const char *dest, const char *source, const char *name, FILE **ret_file) {
return generator_open_unit_file_full(dest, source, name, ret_file, NULL, NULL);
int generator_open_unit_file_full(const char *dir, const char *source, const char *filename, FILE **ret_file, char **ret_final_path, char **ret_temp_path);
static inline int generator_open_unit_file(const char *dir, const char *source, const char *filename, FILE **ret_file) {
return generator_open_unit_file_full(dir, source, filename, ret_file, NULL, NULL);
}
int generator_add_symlink_full(const char *dir, const char *dst, const char *dep_type, const char *src, const char *instance);
+1 -1
View File
@@ -14,4 +14,4 @@ typedef enum GeneveDF {
} GeneveDF;
const char* geneve_df_to_string(GeneveDF d) _const_;
GeneveDF geneve_df_from_string(const char *d) _pure_;
GeneveDF geneve_df_from_string(const char *s) _pure_;
+1 -1
View File
@@ -50,7 +50,7 @@ static inline bool partition_designator_is_verity(PartitionDesignator d) {
}
const char* partition_designator_to_string(PartitionDesignator d) _const_;
PartitionDesignator partition_designator_from_string(const char *name) _pure_;
PartitionDesignator partition_designator_from_string(const char *s) _pure_;
const char* partition_mountpoint_to_string(PartitionDesignator d) _const_;
+1 -1
View File
@@ -43,7 +43,7 @@ int group_record_load(GroupRecord *h, sd_json_variant *v, UserRecordLoadFlags fl
int group_record_build(GroupRecord **ret, ...);
#define group_record_buildo(ret, ...) \
group_record_build((ret), SD_JSON_BUILD_OBJECT(__VA_ARGS__))
int group_record_clone(GroupRecord *g, UserRecordLoadFlags flags, GroupRecord **ret);
int group_record_clone(GroupRecord *h, UserRecordLoadFlags flags, GroupRecord **ret);
bool group_record_match(GroupRecord *h, const UserDBMatch *match);
+2 -2
View File
@@ -166,7 +166,7 @@ int tar_strip_suffixes(const char *name, char **ret) {
return 0;
}
int raw_strip_suffixes(const char *p, char **ret) {
int raw_strip_suffixes(const char *name, char **ret) {
static const char suffixes[] =
".xz\0"
@@ -182,7 +182,7 @@ int raw_strip_suffixes(const char *p, char **ret) {
_cleanup_free_ char *q = NULL;
q = strdup(p);
q = strdup(name);
if (!q)
return -ENOMEM;
+5 -5
View File
@@ -100,7 +100,7 @@ int unit_file_disable(
RuntimeScope scope,
UnitFileFlags flags,
const char *root_dir,
char * const *names,
char * const *files,
InstallChange **changes,
size_t *n_changes);
int unit_file_reenable(
@@ -175,15 +175,15 @@ int unit_file_add_dependency(
int unit_file_lookup_state(
RuntimeScope scope,
const LookupPaths *paths,
const LookupPaths *lp,
const char *name,
UnitFileState *ret);
int unit_file_get_state(RuntimeScope scope, const char *root_dir, const char *filename, UnitFileState *ret);
int unit_file_exists_full(RuntimeScope scope, const LookupPaths *paths, const char *name, char **ret_path);
static inline int unit_file_exists(RuntimeScope scope, const LookupPaths *paths, const char *name) {
return unit_file_exists_full(scope, paths, name, NULL);
int unit_file_exists_full(RuntimeScope scope, const LookupPaths *lp, const char *name, char **ret_path);
static inline int unit_file_exists(RuntimeScope scope, const LookupPaths *lp, const char *name) {
return unit_file_exists_full(scope, lp, name, NULL);
}
int unit_file_get_list(RuntimeScope scope, const char *root_dir, char * const *states, char * const *patterns, Hashmap **ret);
+1 -1
View File
@@ -17,7 +17,7 @@ static inline int ioprio_prio_value(int class, int data) {
return IOPRIO_PRIO_VALUE_HINT(class, IOPRIO_PRIO_LEVEL(data), IOPRIO_PRIO_HINT(data));
}
int ioprio_class_to_string_alloc(int i, char **s);
int ioprio_class_to_string_alloc(int i, char **ret);
int ioprio_class_from_string(const char *s);
static inline bool ioprio_class_is_valid(int i) {
+2 -2
View File
@@ -22,7 +22,7 @@ typedef enum IPVlanFlags {
} IPVlanFlags;
const char* ipvlan_mode_to_string(IPVlanMode d) _const_;
IPVlanMode ipvlan_mode_from_string(const char *d) _pure_;
IPVlanMode ipvlan_mode_from_string(const char *s) _pure_;
const char* ipvlan_flags_to_string(IPVlanFlags d) _const_;
IPVlanFlags ipvlan_flags_from_string(const char *d) _pure_;
IPVlanFlags ipvlan_flags_from_string(const char *s) _pure_;
+3 -3
View File
@@ -18,8 +18,8 @@ bool has_local_address(const struct local_address *addresses, size_t n_addresses
int add_local_address(struct local_address **list, size_t *n_list, int ifindex, unsigned char scope, int family, const union in_addr_union *address);
int local_addresses(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret);
int local_addresses(sd_netlink *context, int ifindex, int af, struct local_address **ret);
int local_gateways(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret);
int local_gateways(sd_netlink *context, int ifindex, int af, struct local_address **ret);
int local_outbounds(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret);
int local_outbounds(sd_netlink *context, int ifindex, int af, struct local_address **ret);
+1 -1
View File
@@ -16,4 +16,4 @@ typedef enum MacVlanMode {
} MacVlanMode;
const char* macvlan_mode_to_string(MacVlanMode d) _const_;
MacVlanMode macvlan_mode_from_string(const char *d) _pure_;
MacVlanMode macvlan_mode_from_string(const char *s) _pure_;
+12 -6
View File
@@ -17,9 +17,9 @@ int bind_mount_submounts(
int repeat_unmount(const char *path, int flags);
int umount_recursive_full(const char *target, int flags, char **keep);
static inline int umount_recursive(const char *target, int flags) {
return umount_recursive_full(target, flags, NULL);
int umount_recursive_full(const char *prefix, int flags, char **keep);
static inline int umount_recursive(const char *prefix, int flags) {
return umount_recursive_full(prefix, flags, NULL);
}
int bind_remount_recursive_with_mountinfo(const char *prefix, unsigned long new_flags, unsigned long flags_mask, char **deny_list, FILE *proc_self_mountinfo);
@@ -80,7 +80,7 @@ int mount_option_mangle(
unsigned long *ret_mount_flags,
char **ret_remaining_options);
int mode_to_inaccessible_node(const char *runtime_dir, mode_t mode, char **dest);
int mode_to_inaccessible_node(const char *runtime_dir, mode_t mode, char **ret);
int mount_flags_to_string(unsigned long flags, char **ret);
/* Useful for usage with _cleanup_(), unmounts, removes a directory and frees the pointer */
@@ -148,9 +148,15 @@ typedef enum RemountIdmapping {
int open_tree_attr_with_fallback(int dir_fd, const char *path, unsigned flags, struct mount_attr *attr);
int open_tree_try_drop_idmap(int dir_fd, const char *path, unsigned flags);
int make_userns(uid_t uid_shift, uid_t uid_range, uid_t host_owner, uid_t dest_owner, RemountIdmapping idmapping);
int make_userns(uid_t uid_shift, uid_t uid_range, uid_t source_owner, uid_t dest_owner, RemountIdmapping idmapping);
int remount_idmap_fd(char **p, int userns_fd, uint64_t extra_mount_attr_set);
int remount_idmap(char **p, uid_t uid_shift, uid_t uid_range, uid_t host_owner, uid_t dest_owner, RemountIdmapping idmapping);
int remount_idmap(
char **p,
uid_t uid_shift,
uid_t uid_range,
uid_t source_owner,
uid_t dest_owner,
RemountIdmapping idmapping);
/* Creates a mount point (without any parents) based on the source path or mode - i.e., a file or a directory */
int make_mount_point_inode_from_mode(int dir_fd, const char *dest, mode_t source_mode, mode_t target_mode);
+2 -2
View File
@@ -96,10 +96,10 @@ typedef enum NamePolicy {
} NamePolicy;
const char* name_policy_to_string(NamePolicy p) _const_;
NamePolicy name_policy_from_string(const char *p) _pure_;
NamePolicy name_policy_from_string(const char *s) _pure_;
const char* alternative_names_policy_to_string(NamePolicy p) _const_;
NamePolicy alternative_names_policy_from_string(const char *p) _pure_;
NamePolicy alternative_names_policy_from_string(const char *s) _pure_;
int device_get_sysattr_int_filtered(sd_device *device, const char *sysattr, int *ret_value);
int device_get_sysattr_unsigned_filtered(sd_device *device, const char *sysattr, unsigned *ret_value);
+1 -1
View File
@@ -29,7 +29,7 @@ static inline void numa_policy_reset(NUMAPolicy *p) {
}
int apply_numa_policy(const NUMAPolicy *policy);
int numa_to_cpu_set(const NUMAPolicy *policy, CPUSet *set);
int numa_to_cpu_set(const NUMAPolicy *policy, CPUSet *ret);
int numa_mask_add_all(CPUSet *mask);
+1 -1
View File
@@ -35,4 +35,4 @@ static inline void open_file_free_many(OpenFile **head) {
}
const char* open_file_flags_to_string(OpenFileFlag t) _const_;
OpenFileFlag open_file_flags_from_string(const char *t) _pure_;
OpenFileFlag open_file_flags_from_string(const char *s) _pure_;
+1 -1
View File
@@ -12,4 +12,4 @@ void pager_open(PagerFlags flags);
void pager_close(void);
bool pager_have(void) _pure_;
int show_man_page(const char *page, bool null_stdio);
int show_man_page(const char *desc, bool null_stdio);
+6 -1
View File
@@ -73,7 +73,12 @@ void pam_bus_data_disconnectp(PamBusData **d);
/* Use a different module name per different PAM module. They are all loaded in the same namespace, and this
* helps avoid a clash in the internal data structures of sd-bus. It will be used as key for cache items. */
int pam_acquire_bus_connection(pam_handle_t *handle, const char *module_name, bool debug, sd_bus **ret_bus, PamBusData **ret_bus_data);
int pam_acquire_bus_connection(
pam_handle_t *handle,
const char *module_name,
bool debug,
sd_bus **ret_bus,
PamBusData **ret_pam_bus_data);
int pam_get_bus_data(pam_handle_t *handle, const char *module_name, PamBusData **ret);
void pam_cleanup_free(pam_handle_t *handle, void *data, int error_status);
+9 -9
View File
@@ -265,11 +265,11 @@ int pkcs11_token_login(
CK_SLOT_ID slotid,
const CK_TOKEN_INFO *token_info,
const char *friendly_name,
const char *askpw_icon,
const char *askpw_keyring,
const char *askpw_credential,
const char *ask_password_icon,
const char *ask_password_keyring,
const char *ask_password_credential,
usec_t until,
AskPasswordFlags askpw_flags,
AskPasswordFlags ask_password_flags,
char **ret_used_pin) {
_cleanup_free_ char *token_uri_string = NULL, *token_uri_escaped = NULL, *id = NULL, *token_label = NULL;
@@ -324,7 +324,7 @@ int pkcs11_token_login(
if (!passwords)
return log_oom();
} else if (FLAGS_SET(askpw_flags, ASK_PASSWORD_HEADLESS))
} else if (FLAGS_SET(ask_password_flags, ASK_PASSWORD_HEADLESS))
return log_error_errno(SYNTHETIC_ERRNO(ENOPKG), "PIN querying disabled via 'headless' option. Use the 'PIN' environment variable.");
else {
_cleanup_free_ char *text = NULL;
@@ -351,16 +351,16 @@ int pkcs11_token_login(
AskPasswordRequest req = {
.tty_fd = -EBADF,
.message = text,
.icon = askpw_icon,
.icon = ask_password_icon,
.id = id,
.keyring = askpw_keyring,
.credential = askpw_credential,
.keyring = ask_password_keyring,
.credential = ask_password_credential,
.until = until,
.hup_fd = -EBADF,
};
/* We never cache PINs, simply because it's fatal if we use wrong PINs, since usually there are only 3 tries */
r = ask_password_auto(&req, askpw_flags, &passwords);
r = ask_password_auto(&req, ask_password_flags, &passwords);
if (r < 0)
return log_error_errno(r, "Failed to query PIN for security token '%s': %m", token_label);
}
+12 -1
View File
@@ -50,7 +50,18 @@ char* pkcs11_token_manufacturer_id(const CK_TOKEN_INFO *token_info);
char* pkcs11_token_model(const CK_TOKEN_INFO *token_info);
int pkcs11_token_login_by_pin(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, const CK_TOKEN_INFO *token_info, const char *token_label, const void *pin, size_t pin_size);
int pkcs11_token_login(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, CK_SLOT_ID slotid, const CK_TOKEN_INFO *token_info, const char *friendly_name, const char *icon_name, const char *key_name, const char *credential_name, usec_t until, AskPasswordFlags ask_password_flags, char **ret_used_pin);
int pkcs11_token_login(
CK_FUNCTION_LIST *m,
CK_SESSION_HANDLE session,
CK_SLOT_ID slotid,
const CK_TOKEN_INFO *token_info,
const char *friendly_name,
const char *ask_password_icon,
const char *ask_password_key,
const char *ask_password_credential,
usec_t until,
AskPasswordFlags ask_password_flags,
char **ret_used_pin);
int pkcs11_token_find_related_object(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE prototype, CK_OBJECT_CLASS class, CK_OBJECT_HANDLE *ret_object);
#if HAVE_OPENSSL
+2 -2
View File
@@ -31,8 +31,8 @@ PTYForward* pty_forward_free(PTYForward *f);
int pty_forward_honor_vhangup(PTYForward *f);
bool pty_forward_vhangup_honored(const PTYForward *f);
void pty_forward_set_hangup_handler(PTYForward *f, PTYForwardHangupHandler handler, void *userdata);
void pty_forward_set_hotkey_handler(PTYForward *f, PTYForwardHotkeyHandler handler, void *userdata);
void pty_forward_set_hangup_handler(PTYForward *f, PTYForwardHangupHandler cb, void *userdata);
void pty_forward_set_hotkey_handler(PTYForward *f, PTYForwardHotkeyHandler cb, void *userdata);
int pty_forward_drain(PTYForward *f);
+1 -1
View File
@@ -11,6 +11,6 @@ int resize_fs(int fd, uint64_t sz, uint64_t *ret_size);
#define EXT4_MINIMAL_SIZE (32U*U64_MB)
uint64_t minimal_size_by_fs_magic(statfs_f_type_t magic);
uint64_t minimal_size_by_fs_name(const char *str);
uint64_t minimal_size_by_fs_name(const char *name);
bool fs_can_online_shrink_and_grow(statfs_f_type_t magic);
+1 -1
View File
@@ -84,7 +84,7 @@ int seccomp_filter_set_add_by_name(Hashmap *filter, bool add, const char *name);
int seccomp_filter_set_add(Hashmap *filter, bool add, const SyscallFilterSet *set);
int seccomp_add_syscall_filter_item(
scmp_filter_ctx *ctx,
scmp_filter_ctx *seccomp,
const char *name,
uint32_t action,
char **exclude,
+1 -1
View File
@@ -101,7 +101,7 @@ int mac_selinux_get_our_label(char **ret_label);
int mac_selinux_get_peer_label(int socket_fd, char **ret_label);
int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *exec_label, char **ret_label);
int mac_selinux_create_file_prepare_at(int dirfd, const char *path, mode_t mode);
int mac_selinux_create_file_prepare_at(int dir_fd, const char *path, mode_t mode);
static inline int mac_selinux_create_file_prepare(const char *path, mode_t mode) {
return mac_selinux_create_file_prepare_at(AT_FDCWD, path, mode);
}
+3 -3
View File
@@ -162,15 +162,15 @@ int serialize_usec(FILE *f, const char *key, usec_t usec) {
return serialize_item_format(f, key, USEC_FMT, usec);
}
int serialize_dual_timestamp(FILE *f, const char *name, const dual_timestamp *t) {
int serialize_dual_timestamp(FILE *f, const char *key, const dual_timestamp *t) {
assert(f);
assert(name);
assert(key);
assert(t);
if (!dual_timestamp_is_set(t))
return 0;
return serialize_item_format(f, name, USEC_FMT " " USEC_FMT, t->realtime, t->monotonic);
return serialize_item_format(f, key, USEC_FMT " " USEC_FMT, t->realtime, t->monotonic);
}
int serialize_strv(FILE *f, const char *key, char * const *l) {
+2 -2
View File
@@ -5,7 +5,7 @@
int serialize_item(FILE *f, const char *key, const char *value);
int serialize_item_escaped(FILE *f, const char *key, const char *value);
int serialize_item_format(FILE *f, const char *key, const char *value, ...) _printf_(3,4);
int serialize_item_format(FILE *f, const char *key, const char *format, ...) _printf_(3,4);
int serialize_item_hexmem(FILE *f, const char *key, const void *p, size_t l);
int serialize_item_base64mem(FILE *f, const char *key, const void *p, size_t l);
int serialize_fd(FILE *f, FDSet *fds, const char *key, int fd);
@@ -31,7 +31,7 @@ int deserialize_fd(FDSet *fds, const char *value);
int deserialize_fd_many(FDSet *fds, const char *value, size_t n, int *ret);
int deserialize_usec(const char *value, usec_t *ret);
int deserialize_dual_timestamp(const char *value, dual_timestamp *ret);
int deserialize_environment(const char *value, char ***environment);
int deserialize_environment(const char *value, char ***list);
int deserialize_strv(const char *value, char ***l);
int deserialize_pidref(FDSet *fds, const char *value, PidRef *ret);
void deserialize_ratelimit(RateLimit *rl, const char *name, const char *value);
+1 -1
View File
@@ -39,7 +39,7 @@ typedef struct SleepConfig {
SleepConfig* sleep_config_free(SleepConfig *sc);
DEFINE_TRIVIAL_CLEANUP_FUNC(SleepConfig*, sleep_config_free);
int parse_sleep_config(SleepConfig **sleep_config);
int parse_sleep_config(SleepConfig **ret);
bool sleep_needs_mem_sleep(const SleepConfig *sc, SleepOperation operation) _pure_;
+3 -3
View File
@@ -24,16 +24,16 @@ static const char* const socket_address_bind_ipv6_only_table[_SOCKET_ADDRESS_BIN
DEFINE_STRING_TABLE_LOOKUP(socket_address_bind_ipv6_only, SocketAddressBindIPv6Only);
SocketAddressBindIPv6Only socket_address_bind_ipv6_only_or_bool_from_string(const char *n) {
SocketAddressBindIPv6Only socket_address_bind_ipv6_only_or_bool_from_string(const char *s) {
int r;
r = parse_boolean(n);
r = parse_boolean(s);
if (r > 0)
return SOCKET_ADDRESS_IPV6_ONLY;
if (r == 0)
return SOCKET_ADDRESS_BOTH;
return socket_address_bind_ipv6_only_from_string(n);
return socket_address_bind_ipv6_only_from_string(s);
}
int socket_address_listen(
+1 -1
View File
@@ -596,7 +596,7 @@ enum {
ASSERT_SIGNAL_FORK_PARENT = 1, /* We are in the parent process */
};
int assert_signal_internal(int *ret_status);
int assert_signal_internal(int *ret_signal);
#ifdef __COVERITY__
# define ASSERT_SIGNAL(expr, signal) __coverity_check__(((expr), false))
+3 -3
View File
@@ -9145,7 +9145,7 @@ int tpm2_util_pbkdf2_hmac_sha256(const void *pass,
size_t passlen,
const void *salt,
size_t saltlen,
uint8_t ret_key[static SHA256_DIGEST_SIZE]) {
uint8_t ret[static SHA256_DIGEST_SIZE]) {
_cleanup_(erase_and_freep) uint8_t *buffer = NULL;
uint8_t u[SHA256_DIGEST_SIZE];
@@ -9176,8 +9176,8 @@ int tpm2_util_pbkdf2_hmac_sha256(const void *pass,
hmac_sha256(pass, passlen, buffer, saltlen + sizeof(block_cnt), u);
/* dk needs to be an unmodified u as u gets modified in the loop */
memcpy(ret_key, u, SHA256_DIGEST_SIZE);
uint8_t *dk = ret_key;
memcpy(ret, u, SHA256_DIGEST_SIZE);
uint8_t *dk = ret;
for (size_t i = 1; i < PBKDF2_HMAC_SHA256_ITERATIONS; i++) {
hmac_sha256(pass, passlen, u, sizeof(u), u);
+3 -3
View File
@@ -184,11 +184,11 @@ char* tpm2_tpml_pcr_selection_to_string(const TPML_PCR_SELECTION *l);
size_t tpm2_tpml_pcr_selection_weight(const TPML_PCR_SELECTION *l);
#define tpm2_tpml_pcr_selection_is_empty(l) (tpm2_tpml_pcr_selection_weight(l) == 0)
int tpm2_digest_many(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const struct iovec data[], size_t count, bool extend);
int tpm2_digest_many(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const struct iovec data[], size_t n_data, bool extend);
static inline int tpm2_digest_buffer(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const void *data, size_t len, bool extend) {
return tpm2_digest_many(alg, digest, &IOVEC_MAKE((void*) data, len), 1, extend);
}
int tpm2_digest_many_digests(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const TPM2B_DIGEST data[], size_t count, bool extend);
int tpm2_digest_many_digests(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const TPM2B_DIGEST data[], size_t n_data, bool extend);
static inline int tpm2_digest_rehash(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest) {
return tpm2_digest_many(alg, digest, NULL, 0, true);
}
@@ -501,7 +501,7 @@ int tpm2_util_pbkdf2_hmac_sha256(const void *pass,
size_t passlen,
const void *salt,
size_t saltlen,
uint8_t res[static SHA256_DIGEST_SIZE]);
uint8_t ret[static SHA256_DIGEST_SIZE]);
enum {
/* Additional defines for the PCR index naming enum from "fundamental/tpm2-pcr.h" */
+1 -1
View File
@@ -8,7 +8,7 @@ int udev_parse_config_full(const ConfigTableItem config_table[]);
int udev_parse_config(void);
int device_wait_for_initialization(sd_device *device, const char *subsystem, usec_t timeout_usec, sd_device **ret);
int device_wait_for_devlink(const char *path, const char *subsystem, usec_t timeout_usec, sd_device **ret);
int device_wait_for_devlink(const char *devlink, const char *subsystem, usec_t timeout_usec, sd_device **ret);
int device_is_renaming(sd_device *dev);
int device_is_processed(sd_device *dev);
+1 -1
View File
@@ -77,4 +77,4 @@ int unit_file_find_fragment(
const char **ret_fragment_path,
Set **ret_names);
const char* runlevel_to_target(const char *rl);
const char* runlevel_to_target(const char *word);
+1 -1
View File
@@ -469,7 +469,7 @@ uint32_t user_record_dev_shm_limit_scale(UserRecord *h);
const char **user_record_self_modifiable_fields(UserRecord *h);
const char **user_record_self_modifiable_blobs(UserRecord *h);
const char **user_record_self_modifiable_privileged(UserRecord *h);
int user_record_self_changes_allowed(UserRecord *current, UserRecord *new);
int user_record_self_changes_allowed(UserRecord *current, UserRecord *incoming);
int user_record_build_image_path(UserStorage storage, const char *user_name_and_realm, char **ret);
+1 -1
View File
@@ -39,4 +39,4 @@ typedef int (*X11VerifyCallback)(const X11Context *xc);
int vconsole_convert_to_x11(const VCContext *vc, X11VerifyCallback verify, X11Context *ret);
int x11_convert_to_vconsole(const X11Context *xc, VCContext *ret);
int vconsole_serialize(const VCContext *vc, const X11Context *xc, char ***ret);
int vconsole_serialize(const VCContext *vc, const X11Context *xc, char ***env);
+1 -1
View File
@@ -9,7 +9,7 @@ dual_timestamp* watchdog_get_last_ping_as_dual_timestamp(dual_timestamp *ret);
int watchdog_set_device(const char *path);
int watchdog_setup(usec_t timeout);
int watchdog_setup_pretimeout(usec_t usec);
int watchdog_setup_pretimeout(usec_t timeout);
int watchdog_setup_pretimeout_governor(const char *governor);
int watchdog_ping(void);
void watchdog_report_if_missing(void);