From d6806870a2a040788fdbd175dff2a814e1e86d23 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 5 Dec 2017 14:01:39 +0900 Subject: [PATCH 1/5] meson: fix indentation --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index e0e8178910..edfa02afbb 100644 --- a/meson.build +++ b/meson.build @@ -635,9 +635,9 @@ substs.set('TTY_GID', tty_gid) # Ensure provided GID argument is numeric, otherwise fallback to default assignment if get_option('users-gid') != '' - users_gid = get_option('users-gid').to_int() + users_gid = get_option('users-gid').to_int() else - users_gid = '-' + users_gid = '-' endif substs.set('USERS_GID', users_gid) From 4e066f7feda001f98884ee2a29647e44f3d45c4e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 5 Dec 2017 14:03:11 +0900 Subject: [PATCH 2/5] bootspec: use blkid only if HAVE_BLKID is defined --- src/shared/bootspec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index aa722c304a..0481293a50 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -419,12 +419,14 @@ static int verify_esp( uint64_t *ret_pstart, uint64_t *ret_psize, sd_id128_t *ret_uuid) { - +#if HAVE_BLKID _cleanup_blkid_free_probe_ blkid_probe b = NULL; char t[DEV_NUM_PATH_MAX]; + const char *v; +#endif uint64_t pstart = 0, psize = 0; struct stat st, st2; - const char *v, *t2; + const char *t2; struct statfs sfs; sd_id128_t uuid = SD_ID128_NULL; uint32_t part = 0; @@ -479,6 +481,7 @@ static int verify_esp( if (detect_container() > 0 || geteuid() != 0) goto finish; +#if HAVE_BLKID xsprintf_dev_num_path(t, "block", st.st_dev); errno = 0; b = blkid_new_probe_from_filename(t); @@ -561,6 +564,7 @@ static int verify_esp( r = safe_atou64(v, &psize); if (r < 0) return log_error_errno(r, "Failed to parse PART_ENTRY_SIZE field."); +#endif finish: if (ret_part) From 92b423b9b4bef15da24814a81420629808f7e21e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 5 Dec 2017 14:04:12 +0900 Subject: [PATCH 3/5] execute: define setup_smack() only if SMACK is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This suppresses the following warning ``` execute.c:2149:12: warning: ‘setup_smack’ defined but not used [-Wunused-function] static int setup_smack( ^~~~~~~~~~~ ``` --- src/core/execute.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/execute.c b/src/core/execute.c index 59a8d60fe3..904082eacd 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -2146,6 +2146,7 @@ fail: return r; } +#if ENABLE_SMACK static int setup_smack( const ExecContext *context, const ExecCommand *command) { @@ -2176,6 +2177,7 @@ static int setup_smack( return 0; } +#endif static int compile_bind_mounts( const ExecContext *context, From 7f59dd3566eefc628dcaab2809e0e548c3a97eb5 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 5 Dec 2017 14:07:38 +0900 Subject: [PATCH 4/5] execute: define the variable mac_selinux_contex_net only when build with SELinux --- src/core/execute.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/execute.c b/src/core/execute.c index 904082eacd..62f8ca7731 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -2735,7 +2735,7 @@ static int exec_child( int *exit_status) { _cleanup_strv_free_ char **our_env = NULL, **pass_env = NULL, **accum_env = NULL, **final_argv = NULL; - _cleanup_free_ char *mac_selinux_context_net = NULL, *home_buffer = NULL; + _cleanup_free_ char *home_buffer = NULL; _cleanup_free_ gid_t *supplementary_gids = NULL; const char *username = NULL, *groupname = NULL; const char *home = NULL, *shell = NULL; @@ -2746,6 +2746,7 @@ static int exec_child( needs_mount_namespace, /* Do we need to set up a mount namespace for this kernel? */ needs_ambient_hack; /* Do we need to apply the ambient capabilities hack? */ #if HAVE_SELINUX + _cleanup_free_ char *mac_selinux_context_net = NULL; bool use_selinux = false; #endif #if ENABLE_SMACK From a28b9567321972b0cfc5babb0acc83f8b3cdb5d2 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 5 Dec 2017 16:21:16 +0900 Subject: [PATCH 5/5] test: increase timeout for test-async The test calls sync(). So, on the heavy io system, the 30s default can be easily exceeded. --- src/test/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/meson.build b/src/test/meson.build index efaa259d76..327c2859e8 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -155,7 +155,8 @@ tests += [ [['src/test/test-async.c'], [], - []], + [], + '', 'timeout=120'], [['src/test/test-locale-util.c'], [],