diff options
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/acl-util.c | 4 | ||||
-rw-r--r-- | src/shared/acl-util.h | 2 | ||||
-rw-r--r-- | src/shared/bus-util.c | 46 | ||||
-rw-r--r-- | src/shared/bus-util.h | 35 | ||||
-rw-r--r-- | src/shared/install.h | 135 | ||||
-rw-r--r-- | src/shared/output-mode.h | 3 | ||||
-rw-r--r-- | src/shared/path-lookup.h | 3 |
7 files changed, 50 insertions, 178 deletions
diff --git a/src/shared/acl-util.c b/src/shared/acl-util.c index ad0e481b9..44076d04c 100644 --- a/src/shared/acl-util.c +++ b/src/shared/acl-util.c @@ -65,6 +65,8 @@ int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry) { return 0; } +/// UNNEEDED by elogind +#if 0 int calc_acl_mask_if_needed(acl_t *acl_p) { acl_entry_t i; int r; @@ -95,8 +97,6 @@ int calc_acl_mask_if_needed(acl_t *acl_p) { return 0; } -/// UNNEEDED by elogind -#if 0 int add_base_acls_if_needed(acl_t *acl_p, const char *path) { acl_entry_t i; int r; diff --git a/src/shared/acl-util.h b/src/shared/acl-util.h index 03358b46a..90178141e 100644 --- a/src/shared/acl-util.h +++ b/src/shared/acl-util.h @@ -30,7 +30,7 @@ #include "macro.h" int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry); -int calc_acl_mask_if_needed(acl_t *acl_p); +// UNNEEDED int calc_acl_mask_if_needed(acl_t *acl_p); // UNNEEDED int add_base_acls_if_needed(acl_t *acl_p, const char *path); // UNNEEDED int acl_search_groups(const char* path, char ***ret_groups); // UNNEEDED int parse_acl(const char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask); diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 0eb7034c9..b72bb8278 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -19,27 +19,29 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include <sys/socket.h> +// #include <sys/socket.h> -#include "sd-daemon.h" -#include "sd-event.h" -#include "util.h" +// #include "sd-daemon.h" +// #include "sd-event.h" +// #include "util.h" #include "strv.h" -#include "macro.h" -#include "def.h" -#include "path-util.h" -#include "missing.h" -#include "set.h" -#include "signal-util.h" +// #include "macro.h" +// #include "def.h" +// #include "path-util.h" +// #include "missing.h" +// #include "set.h" +// #include "signal-util.h" #include "unit-name.h" -#include "sd-bus.h" -#include "bus-error.h" -#include "bus-label.h" +// #include "sd-bus.h" +// #include "bus-error.h" +// #include "bus-label.h" #include "bus-message.h" #include "bus-util.h" #include "bus-internal.h" +/// UNNEEDED by elogind +#if 0 static int name_owner_change_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) { sd_event *e = userdata; @@ -93,8 +95,6 @@ int bus_async_unregister_and_exit(sd_event *e, sd_bus *bus, const char *name) { return 0; } -/// UNNEEDED by elogind -#if 0 int bus_event_loop_with_idle( sd_event *e, sd_bus *bus, @@ -551,6 +551,8 @@ void bus_verify_polkit_async_registry_free(Hashmap *registry) { #endif } +/// UNNEEDED by elogind +#if 0 int bus_check_peercred(sd_bus *c) { struct ucred ucred; socklen_t l; @@ -629,8 +631,6 @@ int bus_open_system_systemd(sd_bus **_bus) { return 0; } -/// UNNEEDED by elogind -#if 0 int bus_open_user_systemd(sd_bus **_bus) { _cleanup_bus_unref_ sd_bus *bus = NULL; _cleanup_free_ char *ee = NULL; @@ -1356,12 +1356,12 @@ int bus_log_parse_error(int r) { return log_error_errno(r, "Failed to parse bus message: %m"); } +/// UNNEEDED by elogind +#if 0 int bus_log_create_error(int r) { return log_error_errno(r, "Failed to create bus message: %m"); } -/// UNNEEDED by elogind -#if 0 int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) { assert(message); assert(u); @@ -1680,7 +1680,6 @@ static int match_job_removed(sd_bus_message *m, void *userdata, sd_bus_error *er return 0; } -#endif // 0 void bus_wait_for_jobs_free(BusWaitForJobs *d) { if (!d) @@ -1699,8 +1698,6 @@ void bus_wait_for_jobs_free(BusWaitForJobs *d) { free(d); } -/// UNNEEDED by elogind -#if 0 int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret) { _cleanup_(bus_wait_for_jobs_freep) BusWaitForJobs *d = NULL; int r; @@ -1750,7 +1747,6 @@ int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret) { return 0; } -#endif // 0 static int bus_process_wait(sd_bus *bus) { int r; @@ -1930,8 +1926,6 @@ int bus_wait_for_jobs_add(BusWaitForJobs *d, const char *path) { return set_put_strdup(d->jobs, path); } -/// UNNEEDED by elogind -#if 0 int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, UnitFileChange **changes, unsigned *n_changes) { const char *type, *path, *source; int r; @@ -1961,7 +1955,6 @@ int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, Un return 0; } -#endif // 0 /** * bus_path_encode_unique() - encode unique object path @@ -2089,6 +2082,7 @@ int bus_path_decode_unique(const char *path, const char *prefix, char **ret_send *ret_external = external; return 1; } +#endif // 0 bool is_kdbus_wanted(void) { _cleanup_free_ char *value = NULL; diff --git a/src/shared/bus-util.h b/src/shared/bus-util.h index a310087d8..0cd3a2316 100644 --- a/src/shared/bus-util.h +++ b/src/shared/bus-util.h @@ -21,11 +21,15 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "sd-event.h" +#include <sys/types.h> +#include <inttypes.h> +#include <stdbool.h> + +// #include "sd-event.h" #include "sd-bus.h" #include "hashmap.h" -#include "install.h" -#include "time-util.h" +// #include "install.h" +// #include "time-util.h" typedef enum BusTransport { BUS_TRANSPORT_LOCAL, @@ -50,7 +54,7 @@ int bus_message_map_all_properties(sd_bus_message *m, const struct bus_propertie // UNNEEDED int bus_message_map_properties_changed(sd_bus_message *m, const struct bus_properties_map *map, void *userdata); int bus_map_all_properties(sd_bus *bus, const char *destination, const char *path, const struct bus_properties_map *map, void *userdata); -int bus_async_unregister_and_exit(sd_event *e, sd_bus *bus, const char *name); +// UNNEEDED int bus_async_unregister_and_exit(sd_event *e, sd_bus *bus, const char *name); typedef bool (*check_idle_t)(void *userdata); @@ -58,14 +62,14 @@ typedef bool (*check_idle_t)(void *userdata); int bus_name_has_owner(sd_bus *c, const char *name, sd_bus_error *error); -int bus_check_peercred(sd_bus *c); +// UNNEEDED int bus_check_peercred(sd_bus *c); int bus_test_polkit(sd_bus_message *call, int capability, const char *action, const char **details, uid_t good_user, bool *_challenge, sd_bus_error *e); int bus_verify_polkit_async(sd_bus_message *call, int capability, const char *action, const char **details, bool interactive, uid_t good_user, Hashmap **registry, sd_bus_error *error); void bus_verify_polkit_async_registry_free(Hashmap *registry); -int bus_open_system_systemd(sd_bus **_bus); +// UNNEEDED int bus_open_system_systemd(sd_bus **_bus); // UNNEEDED int bus_open_user_systemd(sd_bus **_bus); int bus_open_transport(BusTransport transport, const char *host, bool user, sd_bus **bus); @@ -117,8 +121,10 @@ assert_cc(sizeof(mode_t) == sizeof(uint32_t)); #define bus_property_get_mode ((sd_bus_property_get_t) NULL) int bus_log_parse_error(int r); -int bus_log_create_error(int r); +// UNNEEDED int bus_log_create_error(int r); +/// UNNEEDED by elogind +#if 0 typedef struct UnitInfo { const char *machine; const char *id; @@ -132,6 +138,7 @@ typedef struct UnitInfo { const char *job_type; const char *job_path; } UnitInfo; +#endif // 0 // UNNEEDED int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u); @@ -183,20 +190,20 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus_track*, sd_bus_track_unref); // UNNEEDED int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignment); -typedef struct BusWaitForJobs BusWaitForJobs; +// UNNEEDED typedef struct BusWaitForJobs BusWaitForJobs; // UNNEEDED int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret); -void bus_wait_for_jobs_free(BusWaitForJobs *d); -int bus_wait_for_jobs_add(BusWaitForJobs *d, const char *path); -int bus_wait_for_jobs(BusWaitForJobs *d, bool quiet); +// UNNEEDED void bus_wait_for_jobs_free(BusWaitForJobs *d); +// UNNEEDED int bus_wait_for_jobs_add(BusWaitForJobs *d, const char *path); +// UNNEEDED int bus_wait_for_jobs(BusWaitForJobs *d, bool quiet); // UNNEEDED int bus_wait_for_jobs_one(BusWaitForJobs *d, const char *path, bool quiet); -DEFINE_TRIVIAL_CLEANUP_FUNC(BusWaitForJobs*, bus_wait_for_jobs_free); +// UNNEEDED DEFINE_TRIVIAL_CLEANUP_FUNC(BusWaitForJobs*, bus_wait_for_jobs_free); // UNNEEDED int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, UnitFileChange **changes, unsigned *n_changes); -int bus_path_encode_unique(sd_bus *b, const char *prefix, const char *sender_id, const char *external_id, char **ret_path); -int bus_path_decode_unique(const char *path, const char *prefix, char **ret_sender, char **ret_external); +// UNNEEDED int bus_path_encode_unique(sd_bus *b, const char *prefix, const char *sender_id, const char *external_id, char **ret_path); +// UNNEEDED int bus_path_decode_unique(const char *path, const char *prefix, char **ret_sender, char **ret_external); bool is_kdbus_wanted(void); bool is_kdbus_available(void); diff --git a/src/shared/install.h b/src/shared/install.h deleted file mode 100644 index a9d77dd91..000000000 --- a/src/shared/install.h +++ /dev/null @@ -1,135 +0,0 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - -#pragma once - -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see <http://www.gnu.org/licenses/>. -***/ - -typedef enum UnitFileScope UnitFileScope; -typedef enum UnitFileState UnitFileState; -typedef enum UnitFilePresetMode UnitFilePresetMode; -typedef enum UnitFileChangeType UnitFileChangeType; -typedef struct UnitFileChange UnitFileChange; -typedef struct UnitFileList UnitFileList; -typedef struct UnitFileInstallInfo UnitFileInstallInfo; - -#include "hashmap.h" -#include "unit-name.h" -#include "path-lookup.h" - -enum UnitFileScope { - UNIT_FILE_SYSTEM, - UNIT_FILE_GLOBAL, - UNIT_FILE_USER, - _UNIT_FILE_SCOPE_MAX, - _UNIT_FILE_SCOPE_INVALID = -1 -}; - -enum UnitFileState { - UNIT_FILE_ENABLED, - UNIT_FILE_ENABLED_RUNTIME, - UNIT_FILE_LINKED, - UNIT_FILE_LINKED_RUNTIME, - UNIT_FILE_MASKED, - UNIT_FILE_MASKED_RUNTIME, - UNIT_FILE_STATIC, - UNIT_FILE_DISABLED, - UNIT_FILE_INDIRECT, - UNIT_FILE_INVALID, - _UNIT_FILE_STATE_MAX, - _UNIT_FILE_STATE_INVALID = -1 -}; - -enum UnitFilePresetMode { - UNIT_FILE_PRESET_FULL, - UNIT_FILE_PRESET_ENABLE_ONLY, - UNIT_FILE_PRESET_DISABLE_ONLY, - _UNIT_FILE_PRESET_MAX, - _UNIT_FILE_PRESET_INVALID = -1 -}; - -enum UnitFileChangeType { - UNIT_FILE_SYMLINK, - UNIT_FILE_UNLINK, - _UNIT_FILE_CHANGE_TYPE_MAX, - _UNIT_FILE_CHANGE_TYPE_INVALID = -1 -}; - -struct UnitFileChange { - UnitFileChangeType type; - char *path; - char *source; -}; - -struct UnitFileList { - char *path; - UnitFileState state; -}; - -struct UnitFileInstallInfo { - char *name; - char *path; - char *user; - - char **aliases; - char **wanted_by; - char **required_by; - char **also; - - char *default_instance; -}; - -int unit_file_enable(UnitFileScope scope, bool runtime, const char *root_dir, char **files, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_disable(UnitFileScope scope, bool runtime, const char *root_dir, char **files, UnitFileChange **changes, unsigned *n_changes); -int unit_file_reenable(UnitFileScope scope, bool runtime, const char *root_dir, char **files, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_link(UnitFileScope scope, bool runtime, const char *root_dir, char **files, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_preset(UnitFileScope scope, bool runtime, const char *root_dir, char **files, UnitFilePresetMode mode, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_preset_all(UnitFileScope scope, bool runtime, const char *root_dir, UnitFilePresetMode mode, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_mask(UnitFileScope scope, bool runtime, const char *root_dir, char **files, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_unmask(UnitFileScope scope, bool runtime, const char *root_dir, char **files, UnitFileChange **changes, unsigned *n_changes); -int unit_file_set_default(UnitFileScope scope, const char *root_dir, const char *file, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_get_default(UnitFileScope scope, const char *root_dir, char **name); -int unit_file_add_dependency(UnitFileScope scope, bool runtime, const char *root_dir, char **files, char *target, UnitDependency dep, bool force, UnitFileChange **changes, unsigned *n_changes); - -UnitFileState unit_file_lookup_state( - UnitFileScope scope, - const char *root_dir, - const LookupPaths *paths, - const char *name); -UnitFileState unit_file_get_state( - UnitFileScope scope, - const char *root_dir, - const char *filename); - -int unit_file_get_list(UnitFileScope scope, const char *root_dir, Hashmap *h); - -void unit_file_list_free(Hashmap *h); -int unit_file_changes_add(UnitFileChange **changes, unsigned *n_changes, UnitFileChangeType type, const char *path, const char *source); -void unit_file_changes_free(UnitFileChange *changes, unsigned n_changes); - -int unit_file_query_preset(UnitFileScope scope, const char *root_dir, const char *name); - -const char *unit_file_state_to_string(UnitFileState s) _const_; -UnitFileState unit_file_state_from_string(const char *s) _pure_; - -const char *unit_file_change_type_to_string(UnitFileChangeType s) _const_; -UnitFileChangeType unit_file_change_type_from_string(const char *s) _pure_; - -const char *unit_file_preset_mode_to_string(UnitFilePresetMode m) _const_; -UnitFilePresetMode unit_file_preset_mode_from_string(const char *s) _pure_; diff --git a/src/shared/output-mode.h b/src/shared/output-mode.h index 81d7f05d9..6a61d3120 100644 --- a/src/shared/output-mode.h +++ b/src/shared/output-mode.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +/// UNNEEDED by elogind +#if 0 typedef enum OutputMode { OUTPUT_SHORT, OUTPUT_SHORT_ISO, @@ -35,6 +37,7 @@ typedef enum OutputMode { _OUTPUT_MODE_MAX, _OUTPUT_MODE_INVALID = -1 } OutputMode; +#endif // 0 typedef enum OutputFlags { OUTPUT_SHOW_ALL = 1 << 0, diff --git a/src/shared/path-lookup.h b/src/shared/path-lookup.h index f4f9895bb..9bccaf640 100644 --- a/src/shared/path-lookup.h +++ b/src/shared/path-lookup.h @@ -34,6 +34,8 @@ typedef enum ManagerRunningAs { _MANAGER_RUNNING_AS_INVALID = -1 } ManagerRunningAs; +/// UNNEEDED by elogind +#if 0 int user_config_home(char **config_home); int user_runtime_dir(char **runtime_dir); @@ -55,3 +57,4 @@ int lookup_paths_init_from_scope(LookupPaths *paths, void lookup_paths_free(LookupPaths *p); #define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free) +#endif // 0 |