void initialize_srand(void) {
static bool pthread_atfork_registered = false;
unsigned x;
-#if HAVE_SYS_AUXV_H
- const void *auxv;
-#endif
+
if (srand_called)
return;
* AT_RANDOM data might be used by other stuff too (in particular: ASLR), and we probably shouldn't
* leak the seed for that. */
- auxv = ULONG_TO_PTR(getauxval(AT_RANDOM));
+ const void *auxv = ULONG_TO_PTR(getauxval(AT_RANDOM));
if (auxv) {
static const uint8_t auxval_hash_key[16] = {
0x92, 0x6e, 0xfe, 0x1b, 0xcf, 0x00, 0x52, 0x9c, 0xcc, 0x42, 0xcf, 0xdc, 0x94, 0x1f, 0x81, 0x0f
_cleanup_strv_free_ char **l = NULL;
int r;
-#if HAVE_SECCOMP
- void *id, *val;
-#endif
-
assert(bus);
assert(reply);
assert(c);
return r;
#if HAVE_SECCOMP
+ void *id, *val;
HASHMAP_FOREACH_KEY(val, id, c->syscall_filter) {
_cleanup_free_ char *name = NULL;
const char *e = NULL;
_cleanup_strv_free_ char **l = NULL;
int r;
-#if HAVE_SECCOMP
- void *id, *val;
-#endif
-
assert(bus);
assert(reply);
assert(c);
return r;
#if HAVE_SECCOMP
+ void *id, *val;
HASHMAP_FOREACH_KEY(val, id, c->syscall_log) {
char *name = NULL;
_cleanup_strv_free_ char **l = NULL;
int r;
-#if HAVE_SECCOMP
- void *id;
-#endif
-
assert(bus);
assert(reply);
assert(c);
#if HAVE_SECCOMP
+ void *id;
SET_FOREACH(id, c->syscall_archs) {
const char *name;
prefix, yes_no(c->lock_personality));
if (c->syscall_filter) {
-#if HAVE_SECCOMP
- void *id, *val;
- bool first = true;
-#endif
-
fprintf(f,
"%sSystemCallFilter: ",
prefix);
fputc('~', f);
#if HAVE_SECCOMP
+ void *id, *val;
+ bool first = true;
HASHMAP_FOREACH_KEY(val, id, c->syscall_filter) {
_cleanup_free_ char *name = NULL;
const char *errno_name = NULL;
}
if (c->syscall_archs) {
-#if HAVE_SECCOMP
- void *id;
-#endif
-
fprintf(f,
"%sSystemCallArchitectures:",
prefix);
#if HAVE_SECCOMP
+ void *id;
SET_FOREACH(id, c->syscall_archs)
fprintf(f, " %s", strna(seccomp_arch_to_string(PTR_TO_UINT32(id) - 1)));
#endif
prefix, c->network_namespace_path);
if (c->syscall_errno > 0) {
-#if HAVE_SECCOMP
- const char *errno_name;
-#endif
-
fprintf(f, "%sSystemCallErrorNumber: ", prefix);
#if HAVE_SECCOMP
- errno_name = seccomp_errno_or_action_to_string(c->syscall_errno);
+ const char *errno_name = seccomp_errno_or_action_to_string(c->syscall_errno);
if (errno_name)
fputs(errno_name, f);
else
Hashmap **registry,
sd_bus_error *ret_error) {
-#if ENABLE_POLKIT
- _cleanup_(sd_bus_message_unrefp) sd_bus_message *pk = NULL;
- AsyncPolkitQuery *q;
- int c;
-#endif
const char *sender;
int r;
return r;
#if ENABLE_POLKIT
- q = hashmap_get(*registry, call);
+ AsyncPolkitQuery *q = hashmap_get(*registry, call);
if (q) {
int authorized, challenge;
return -EBADMSG;
#if ENABLE_POLKIT
- c = sd_bus_message_get_allow_interactive_authorization(call);
+ _cleanup_(sd_bus_message_unrefp) sd_bus_message *pk = NULL;
+
+ int c = sd_bus_message_get_allow_interactive_authorization(call);
if (c < 0)
return c;
if (c > 0)
#include "user-util.h"
static int access_check_var_log_journal(sd_journal *j, bool want_other_users) {
-#if HAVE_ACL
- _cleanup_strv_free_ char **g = NULL;
- const char* dir;
-#endif
int r;
assert(j);
return 0;
#if HAVE_ACL
+ _cleanup_strv_free_ char **g = NULL;
+ const char* dir;
+
if (laccess("/run/log/journal", F_OK) >= 0)
dir = "/run/log/journal";
else