]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
execute: define the variable mac_selinux_contex_net only when build with SELinux
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 5 Dec 2017 05:07:38 +0000 (14:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 5 Dec 2017 05:08:09 +0000 (14:08 +0900)
src/core/execute.c

index 904082eacdaaa60e3c7440300f3e2487025201b8..62f8ca7731af8a1840974e469230b49ae6736fd8 100644 (file)
@@ -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