build-sys: use #if Y instead of #ifdef Y everywhere
The advantage is that is the name is mispellt, cpp will warn us.
$ git grep -Ee "conf.set\('(HAVE|ENABLE)_" -l|xargs sed -r -i "s/conf.set\('(HAVE|ENABLE)_/conf.set10('\1_/"
$ git grep -Ee '#ifn?def (HAVE|ENABLE)' -l|xargs sed -r -i 's/#ifdef (HAVE|ENABLE)/#if \1/; s/#ifndef (HAVE|ENABLE)/#if ! \1/;'
$ git grep -Ee 'if.*defined\(HAVE' -l|xargs sed -i -r 's/defined\((HAVE_[A-Z0-9_]*)\)/\1/g'
$ git grep -Ee 'if.*defined\(ENABLE' -l|xargs sed -i -r 's/defined\((ENABLE_[A-Z0-9_]*)\)/\1/g'
+ manual changes to meson.build
squash! build-sys: use #if Y instead of #ifdef Y everywhere
v2:
- fix incorrect setting of HAVE_LIBIDN2
This commit is contained in:
@@ -19,13 +19,13 @@
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#ifdef HAVE_BLKID
|
||||
#if HAVE_BLKID
|
||||
#include <blkid.h>
|
||||
#endif
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#ifdef HAVE_BLKID
|
||||
#if HAVE_BLKID
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(blkid_probe, blkid_free_probe);
|
||||
#define _cleanup_blkid_free_probe_ _cleanup_(blkid_free_probep)
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <sys/sysmacros.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef HAVE_LINUX_BTRFS_H
|
||||
#if HAVE_LINUX_BTRFS_H
|
||||
#include <linux/btrfs.h>
|
||||
#endif
|
||||
|
||||
|
||||
+20
-20
@@ -19,121 +19,121 @@
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#ifdef HAVE_PAM
|
||||
#if HAVE_PAM
|
||||
#define _PAM_FEATURE_ "+PAM"
|
||||
#else
|
||||
#define _PAM_FEATURE_ "-PAM"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AUDIT
|
||||
#if HAVE_AUDIT
|
||||
#define _AUDIT_FEATURE_ "+AUDIT"
|
||||
#else
|
||||
#define _AUDIT_FEATURE_ "-AUDIT"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
#define _SELINUX_FEATURE_ "+SELINUX"
|
||||
#else
|
||||
#define _SELINUX_FEATURE_ "-SELINUX"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_APPARMOR
|
||||
#if HAVE_APPARMOR
|
||||
#define _APPARMOR_FEATURE_ "+APPARMOR"
|
||||
#else
|
||||
#define _APPARMOR_FEATURE_ "-APPARMOR"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IMA
|
||||
#if HAVE_IMA
|
||||
#define _IMA_FEATURE_ "+IMA"
|
||||
#else
|
||||
#define _IMA_FEATURE_ "-IMA"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SMACK
|
||||
#if HAVE_SMACK
|
||||
#define _SMACK_FEATURE_ "+SMACK"
|
||||
#else
|
||||
#define _SMACK_FEATURE_ "-SMACK"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYSV_COMPAT
|
||||
#if HAVE_SYSV_COMPAT
|
||||
#define _SYSVINIT_FEATURE_ "+SYSVINIT"
|
||||
#else
|
||||
#define _SYSVINIT_FEATURE_ "-SYSVINIT"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UTMP
|
||||
#if HAVE_UTMP
|
||||
#define _UTMP_FEATURE_ "+UTMP"
|
||||
#else
|
||||
#define _UTMP_FEATURE_ "-UTMP"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBCRYPTSETUP
|
||||
#if HAVE_LIBCRYPTSETUP
|
||||
#define _LIBCRYPTSETUP_FEATURE_ "+LIBCRYPTSETUP"
|
||||
#else
|
||||
#define _LIBCRYPTSETUP_FEATURE_ "-LIBCRYPTSETUP"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GCRYPT
|
||||
#if HAVE_GCRYPT
|
||||
#define _GCRYPT_FEATURE_ "+GCRYPT"
|
||||
#else
|
||||
#define _GCRYPT_FEATURE_ "-GCRYPT"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
#if HAVE_GNUTLS
|
||||
#define _GNUTLS_FEATURE_ "+GNUTLS"
|
||||
#else
|
||||
#define _GNUTLS_FEATURE_ "-GNUTLS"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ACL
|
||||
#if HAVE_ACL
|
||||
#define _ACL_FEATURE_ "+ACL"
|
||||
#else
|
||||
#define _ACL_FEATURE_ "-ACL"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XZ
|
||||
#if HAVE_XZ
|
||||
#define _XZ_FEATURE_ "+XZ"
|
||||
#else
|
||||
#define _XZ_FEATURE_ "-XZ"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LZ4
|
||||
#if HAVE_LZ4
|
||||
#define _LZ4_FEATURE_ "+LZ4"
|
||||
#else
|
||||
#define _LZ4_FEATURE_ "-LZ4"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SECCOMP
|
||||
#if HAVE_SECCOMP
|
||||
#define _SECCOMP_FEATURE_ "+SECCOMP"
|
||||
#else
|
||||
#define _SECCOMP_FEATURE_ "-SECCOMP"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BLKID
|
||||
#if HAVE_BLKID
|
||||
#define _BLKID_FEATURE_ "+BLKID"
|
||||
#else
|
||||
#define _BLKID_FEATURE_ "-BLKID"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ELFUTILS
|
||||
#if HAVE_ELFUTILS
|
||||
#define _ELFUTILS_FEATURE_ "+ELFUTILS"
|
||||
#else
|
||||
#define _ELFUTILS_FEATURE_ "-ELFUTILS"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_KMOD
|
||||
#if HAVE_KMOD
|
||||
#define _KMOD_FEATURE_ "+KMOD"
|
||||
#else
|
||||
#define _KMOD_FEATURE_ "-KMOD"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBIDN2
|
||||
#if HAVE_LIBIDN2
|
||||
#define _IDN2_FEATURE_ "+IDN2"
|
||||
#else
|
||||
#define _IDN2_FEATURE_ "-IDN2"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBIDN
|
||||
#if HAVE_LIBIDN
|
||||
#define _IDN_FEATURE_ "+IDN"
|
||||
#else
|
||||
#define _IDN_FEATURE_ "-IDN"
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@
|
||||
#define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
|
||||
#define SIGNALS_IGNORE SIGPIPE
|
||||
|
||||
#ifdef HAVE_SPLIT_USR
|
||||
#if HAVE_SPLIT_USR
|
||||
#define KBD_KEYMAP_DIRS \
|
||||
"/usr/share/keymaps/\0" \
|
||||
"/usr/share/kbd/keymaps/\0" \
|
||||
@@ -68,7 +68,7 @@
|
||||
#define NOTIFY_FD_MAX 768
|
||||
#define NOTIFY_BUFFER_MAX PIPE_BUF
|
||||
|
||||
#ifdef HAVE_SPLIT_USR
|
||||
#if HAVE_SPLIT_USR
|
||||
# define _CONF_PATHS_SPLIT_USR(n) "/lib/" n "\0"
|
||||
#else
|
||||
# define _CONF_PATHS_SPLIT_USR(n)
|
||||
|
||||
+11
-11
@@ -34,7 +34,7 @@
|
||||
#include "strv.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifdef ENABLE_DEBUG_HASHMAP
|
||||
#if ENABLE_DEBUG_HASHMAP
|
||||
#include <pthread.h>
|
||||
#include "list.h"
|
||||
#endif
|
||||
@@ -142,7 +142,7 @@ typedef uint8_t dib_raw_t;
|
||||
|
||||
#define DIB_FREE UINT_MAX
|
||||
|
||||
#ifdef ENABLE_DEBUG_HASHMAP
|
||||
#if ENABLE_DEBUG_HASHMAP
|
||||
struct hashmap_debug_info {
|
||||
LIST_FIELDS(struct hashmap_debug_info, debug_list);
|
||||
unsigned max_entries; /* high watermark of n_entries */
|
||||
@@ -499,7 +499,7 @@ static void base_remove_entry(HashmapBase *h, unsigned idx) {
|
||||
dibs = dib_raw_ptr(h);
|
||||
assert(dibs[idx] != DIB_RAW_FREE);
|
||||
|
||||
#ifdef ENABLE_DEBUG_HASHMAP
|
||||
#if ENABLE_DEBUG_HASHMAP
|
||||
h->debug.rem_count++;
|
||||
h->debug.last_rem_idx = idx;
|
||||
#endif
|
||||
@@ -578,7 +578,7 @@ static unsigned hashmap_iterate_in_insertion_order(OrderedHashmap *h, Iterator *
|
||||
assert(e->p.b.key == i->next_key);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DEBUG_HASHMAP
|
||||
#if ENABLE_DEBUG_HASHMAP
|
||||
i->prev_idx = idx;
|
||||
#endif
|
||||
|
||||
@@ -635,7 +635,7 @@ static unsigned hashmap_iterate_in_internal_order(HashmapBase *h, Iterator *i) {
|
||||
}
|
||||
|
||||
idx = i->idx;
|
||||
#ifdef ENABLE_DEBUG_HASHMAP
|
||||
#if ENABLE_DEBUG_HASHMAP
|
||||
i->prev_idx = idx;
|
||||
#endif
|
||||
|
||||
@@ -658,7 +658,7 @@ static unsigned hashmap_iterate_entry(HashmapBase *h, Iterator *i) {
|
||||
return IDX_NIL;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DEBUG_HASHMAP
|
||||
#if ENABLE_DEBUG_HASHMAP
|
||||
if (i->idx == IDX_FIRST) {
|
||||
i->put_count = h->debug.put_count;
|
||||
i->rem_count = h->debug.rem_count;
|
||||
@@ -750,7 +750,7 @@ static struct HashmapBase *hashmap_base_new(const struct hash_ops *hash_ops, enu
|
||||
shared_hash_key_initialized= true;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DEBUG_HASHMAP
|
||||
#if ENABLE_DEBUG_HASHMAP
|
||||
h->debug.func = func;
|
||||
h->debug.file = file;
|
||||
h->debug.line = line;
|
||||
@@ -807,7 +807,7 @@ static void hashmap_free_no_clear(HashmapBase *h) {
|
||||
assert(!h->has_indirect);
|
||||
assert(!h->n_direct_entries);
|
||||
|
||||
#ifdef ENABLE_DEBUG_HASHMAP
|
||||
#if ENABLE_DEBUG_HASHMAP
|
||||
assert_se(pthread_mutex_lock(&hashmap_debug_list_mutex) == 0);
|
||||
LIST_REMOVE(debug_list, hashmap_debug_list, &h->debug);
|
||||
assert_se(pthread_mutex_unlock(&hashmap_debug_list_mutex) == 0);
|
||||
@@ -919,7 +919,7 @@ static bool hashmap_put_robin_hood(HashmapBase *h, unsigned idx,
|
||||
dib_raw_t raw_dib, *dibs;
|
||||
unsigned dib, distance;
|
||||
|
||||
#ifdef ENABLE_DEBUG_HASHMAP
|
||||
#if ENABLE_DEBUG_HASHMAP
|
||||
h->debug.put_count++;
|
||||
#endif
|
||||
|
||||
@@ -1012,7 +1012,7 @@ static int hashmap_base_put_boldly(HashmapBase *h, unsigned idx,
|
||||
assert_se(hashmap_put_robin_hood(h, idx, swap) == false);
|
||||
|
||||
n_entries_inc(h);
|
||||
#ifdef ENABLE_DEBUG_HASHMAP
|
||||
#if ENABLE_DEBUG_HASHMAP
|
||||
h->debug.max_entries = MAX(h->debug.max_entries, n_entries(h));
|
||||
#endif
|
||||
|
||||
@@ -1240,7 +1240,7 @@ int hashmap_replace(Hashmap *h, const void *key, void *value) {
|
||||
idx = bucket_scan(h, hash, key);
|
||||
if (idx != IDX_NIL) {
|
||||
e = plain_bucket_at(h, idx);
|
||||
#ifdef ENABLE_DEBUG_HASHMAP
|
||||
#if ENABLE_DEBUG_HASHMAP
|
||||
/* Although the key is equal, the key pointer may have changed,
|
||||
* and this would break our assumption for iterating. So count
|
||||
* this operation as incompatible with iteration. */
|
||||
|
||||
+2
-2
@@ -58,7 +58,7 @@ typedef struct Set Set; /* Stores just keys */
|
||||
typedef struct {
|
||||
unsigned idx; /* index of an entry to be iterated next */
|
||||
const void *next_key; /* expected value of that entry's key pointer */
|
||||
#ifdef ENABLE_DEBUG_HASHMAP
|
||||
#if ENABLE_DEBUG_HASHMAP
|
||||
unsigned put_count; /* hashmap's put_count recorded at start of iteration */
|
||||
unsigned rem_count; /* hashmap's rem_count in previous iteration */
|
||||
unsigned prev_idx; /* idx in previous iteration */
|
||||
@@ -89,7 +89,7 @@ typedef struct {
|
||||
(Hashmap*)(h), \
|
||||
(void)0)
|
||||
|
||||
#ifdef ENABLE_DEBUG_HASHMAP
|
||||
#if ENABLE_DEBUG_HASHMAP
|
||||
# define HASHMAP_DEBUG_PARAMS , const char *func, const char *file, int line
|
||||
# define HASHMAP_DEBUG_SRC_ARGS , __func__, __FILE__, __LINE__
|
||||
# define HASHMAP_DEBUG_PASS_ARGS , func, file, line
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_LINUX_MEMFD_H
|
||||
#if HAVE_LINUX_MEMFD_H
|
||||
#include <linux/memfd.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
|
||||
+11
-11
@@ -40,7 +40,7 @@
|
||||
#include <uchar.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef HAVE_AUDIT
|
||||
#if HAVE_AUDIT
|
||||
#include <libaudit.h>
|
||||
#endif
|
||||
|
||||
@@ -48,11 +48,11 @@
|
||||
#include <asm/sgidefs.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LINUX_BTRFS_H
|
||||
#if HAVE_LINUX_BTRFS_H
|
||||
#include <linux/btrfs.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LINUX_VM_SOCKETS_H
|
||||
#if HAVE_LINUX_VM_SOCKETS_H
|
||||
#include <linux/vm_sockets.h>
|
||||
#else
|
||||
#define VMADDR_CID_ANY -1U
|
||||
@@ -204,7 +204,7 @@ struct sockaddr_vm {
|
||||
#define BTRFS_QGROUP_LEVEL_SHIFT 48
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_LINUX_BTRFS_H
|
||||
#if ! HAVE_LINUX_BTRFS_H
|
||||
struct btrfs_ioctl_vol_args {
|
||||
int64_t fd;
|
||||
char name[BTRFS_PATH_NAME_MAX + 1];
|
||||
@@ -546,8 +546,8 @@ struct btrfs_ioctl_quota_ctl_args {
|
||||
#define MAX_HANDLE_SZ 128
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SECURE_GETENV
|
||||
# ifdef HAVE___SECURE_GETENV
|
||||
#if ! HAVE_SECURE_GETENV
|
||||
# if HAVE___SECURE_GETENV
|
||||
# define secure_getenv __secure_getenv
|
||||
# else
|
||||
# error "neither secure_getenv nor __secure_getenv are available"
|
||||
@@ -1108,7 +1108,7 @@ struct input_mask {
|
||||
#define KEY_ALS_TOGGLE 0x230
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_KEY_SERIAL_T
|
||||
#if ! HAVE_KEY_SERIAL_T
|
||||
typedef int32_t key_serial_t;
|
||||
#endif
|
||||
|
||||
@@ -1204,11 +1204,11 @@ typedef int32_t key_serial_t;
|
||||
#ifndef IF_OPER_UP
|
||||
#define IF_OPER_UP 6
|
||||
|
||||
#ifndef HAVE_CHAR32_T
|
||||
#if ! HAVE_CHAR32_T
|
||||
#define char32_t uint32_t
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_CHAR16_T
|
||||
#if ! HAVE_CHAR16_T
|
||||
#define char16_t uint16_t
|
||||
#endif
|
||||
|
||||
@@ -1220,7 +1220,7 @@ typedef int32_t key_serial_t;
|
||||
#define IFA_F_MCAUTOJOIN 0x400
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRUCT_ETHTOOL_LINK_SETTINGS
|
||||
#if ! HAVE_STRUCT_ETHTOOL_LINK_SETTINGS
|
||||
|
||||
#define ETHTOOL_GLINKSETTINGS 0x0000004c /* Get ethtool_link_settings */
|
||||
#define ETHTOOL_SLINKSETTINGS 0x0000004d /* Set ethtool_link_settings */
|
||||
@@ -1247,7 +1247,7 @@ struct ethtool_link_settings {
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRUCT_FIB_RULE_UID_RANGE
|
||||
#if ! HAVE_STRUCT_FIB_RULE_UID_RANGE
|
||||
|
||||
struct fib_rule_uid_range {
|
||||
__u32 start;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#define DEFAULT_PATH_NORMAL "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
|
||||
#define DEFAULT_PATH_SPLIT_USR DEFAULT_PATH_NORMAL ":/sbin:/bin"
|
||||
|
||||
#ifdef HAVE_SPLIT_USR
|
||||
#if HAVE_SPLIT_USR
|
||||
# define DEFAULT_PATH DEFAULT_PATH_SPLIT_USR
|
||||
#else
|
||||
# define DEFAULT_PATH DEFAULT_PATH_NORMAL
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <sys/wait.h>
|
||||
#include <syslog.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_VALGRIND_VALGRIND_H
|
||||
#if HAVE_VALGRIND_VALGRIND_H
|
||||
#include <valgrind/valgrind.h>
|
||||
#endif
|
||||
|
||||
@@ -945,7 +945,7 @@ int opinionated_personality(unsigned long *ret) {
|
||||
}
|
||||
|
||||
void valgrind_summary_hack(void) {
|
||||
#ifdef HAVE_VALGRIND_VALGRIND_H
|
||||
#if HAVE_VALGRIND_VALGRIND_H
|
||||
if (getpid_cached() == 1 && RUNNING_ON_VALGRIND) {
|
||||
pid_t pid;
|
||||
pid = raw_clone(SIGCHLD);
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
#include <linux/random.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef HAVE_SYS_AUXV_H
|
||||
#if HAVE_SYS_AUXV_H
|
||||
# include <sys/auxv.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_SYS_RANDOM_H
|
||||
#if USE_SYS_RANDOM_H
|
||||
# include <sys/random.h>
|
||||
#else
|
||||
# include <linux/random.h>
|
||||
@@ -100,14 +100,14 @@ int acquire_random_bytes(void *p, size_t n, bool high_quality_required) {
|
||||
void initialize_srand(void) {
|
||||
static bool srand_called = false;
|
||||
unsigned x;
|
||||
#ifdef HAVE_SYS_AUXV_H
|
||||
#if HAVE_SYS_AUXV_H
|
||||
void *auxv;
|
||||
#endif
|
||||
|
||||
if (srand_called)
|
||||
return;
|
||||
|
||||
#ifdef HAVE_SYS_AUXV_H
|
||||
#if HAVE_SYS_AUXV_H
|
||||
/* The kernel provides us with 16 bytes of entropy in auxv, so let's
|
||||
* try to make use of that to seed the pseudo-random generator. It's
|
||||
* better than nothing... */
|
||||
|
||||
+17
-17
@@ -26,7 +26,7 @@
|
||||
#include <sys/un.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
#include <selinux/context.h>
|
||||
#include <selinux/label.h>
|
||||
#include <selinux/selinux.h>
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "time-util.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, freecon);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(context_t, context_free);
|
||||
|
||||
@@ -54,7 +54,7 @@ static struct selabel_handle *label_hnd = NULL;
|
||||
#endif
|
||||
|
||||
bool mac_selinux_use(void) {
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
if (cached_use < 0)
|
||||
cached_use = is_selinux_enabled() > 0;
|
||||
|
||||
@@ -65,7 +65,7 @@ bool mac_selinux_use(void) {
|
||||
}
|
||||
|
||||
void mac_selinux_retest(void) {
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
cached_use = -1;
|
||||
#endif
|
||||
}
|
||||
@@ -73,7 +73,7 @@ void mac_selinux_retest(void) {
|
||||
int mac_selinux_init(void) {
|
||||
int r = 0;
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
usec_t before_timestamp, after_timestamp;
|
||||
struct mallinfo before_mallinfo, after_mallinfo;
|
||||
|
||||
@@ -110,7 +110,7 @@ int mac_selinux_init(void) {
|
||||
|
||||
void mac_selinux_finish(void) {
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
if (!label_hnd)
|
||||
return;
|
||||
|
||||
@@ -121,7 +121,7 @@ void mac_selinux_finish(void) {
|
||||
|
||||
int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
struct stat st;
|
||||
int r;
|
||||
|
||||
@@ -169,7 +169,7 @@ int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
|
||||
|
||||
int mac_selinux_apply(const char *path, const char *label) {
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
if (!mac_selinux_use())
|
||||
return 0;
|
||||
|
||||
@@ -188,7 +188,7 @@ int mac_selinux_apply(const char *path, const char *label) {
|
||||
int mac_selinux_get_create_label_from_exe(const char *exe, char **label) {
|
||||
int r = -EOPNOTSUPP;
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
_cleanup_freecon_ char *mycon = NULL, *fcon = NULL;
|
||||
security_class_t sclass;
|
||||
|
||||
@@ -220,7 +220,7 @@ int mac_selinux_get_our_label(char **label) {
|
||||
|
||||
assert(label);
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
if (!mac_selinux_use())
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
@@ -235,7 +235,7 @@ int mac_selinux_get_our_label(char **label) {
|
||||
int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *exec_label, char **label) {
|
||||
int r = -EOPNOTSUPP;
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
_cleanup_freecon_ char *mycon = NULL, *peercon = NULL, *fcon = NULL;
|
||||
_cleanup_context_free_ context_t pcon = NULL, bcon = NULL;
|
||||
security_class_t sclass;
|
||||
@@ -296,7 +296,7 @@ int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *
|
||||
|
||||
char* mac_selinux_free(char *label) {
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
if (!label)
|
||||
return NULL;
|
||||
|
||||
@@ -312,7 +312,7 @@ char* mac_selinux_free(char *label) {
|
||||
|
||||
int mac_selinux_create_file_prepare(const char *path, mode_t mode) {
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
_cleanup_freecon_ char *filecon = NULL;
|
||||
int r;
|
||||
|
||||
@@ -355,7 +355,7 @@ int mac_selinux_create_file_prepare(const char *path, mode_t mode) {
|
||||
|
||||
void mac_selinux_create_file_clear(void) {
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
PROTECT_ERRNO;
|
||||
|
||||
if (!mac_selinux_use())
|
||||
@@ -367,7 +367,7 @@ void mac_selinux_create_file_clear(void) {
|
||||
|
||||
int mac_selinux_create_socket_prepare(const char *label) {
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
if (!mac_selinux_use())
|
||||
return 0;
|
||||
|
||||
@@ -386,7 +386,7 @@ int mac_selinux_create_socket_prepare(const char *label) {
|
||||
|
||||
void mac_selinux_create_socket_clear(void) {
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
PROTECT_ERRNO;
|
||||
|
||||
if (!mac_selinux_use())
|
||||
@@ -400,7 +400,7 @@ int mac_selinux_bind(int fd, const struct sockaddr *addr, socklen_t addrlen) {
|
||||
|
||||
/* Binds a socket and label its file system object according to the SELinux policy */
|
||||
|
||||
#ifdef HAVE_SELINUX
|
||||
#if HAVE_SELINUX
|
||||
_cleanup_freecon_ char *fcon = NULL;
|
||||
const struct sockaddr_un *un;
|
||||
bool context_changed = false;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "string-table.h"
|
||||
#include "xattr-util.h"
|
||||
|
||||
#ifdef HAVE_SMACK
|
||||
#if HAVE_SMACK
|
||||
bool mac_smack_use(void) {
|
||||
static int cached_use = -1;
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include "utf8.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifdef ENABLE_IDN
|
||||
#if ENABLE_IDN
|
||||
# define IDN_FLAGS (NI_IDN|NI_IDN_USE_STD3_ASCII_RULES)
|
||||
#else
|
||||
# define IDN_FLAGS 0
|
||||
|
||||
Reference in New Issue
Block a user