diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/meta/recipes-core/systemd/systemd/0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch b/meta/recipes-core/systemd/systemd/0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch index 85279d68c2..55a0088c65 100644 --- a/meta/recipes-core/systemd/systemd/0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch +++ b/meta/recipes-core/systemd/systemd/0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch | |||
@@ -10,32 +10,29 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> | |||
10 | src/nspawn/nspawn.c | 7 +++++++ | 10 | src/nspawn/nspawn.c | 7 +++++++ |
11 | 1 file changed, 7 insertions(+) | 11 | 1 file changed, 7 insertions(+) |
12 | 12 | ||
13 | diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c | 13 | Index: git/src/nspawn/nspawn.c |
14 | index 0d8d199..b597edb 100644 | 14 | =================================================================== |
15 | --- a/src/nspawn/nspawn.c | 15 | --- git.orig/src/nspawn/nspawn.c |
16 | +++ b/src/nspawn/nspawn.c | 16 | +++ git/src/nspawn/nspawn.c |
17 | @@ -129,6 +129,8 @@ typedef enum Volatile { | 17 | @@ -143,6 +143,8 @@ typedef struct CustomMount { |
18 | VOLATILE_STATE, | 18 | char **lower; |
19 | } Volatile; | 19 | } CustomMount; |
20 | 20 | ||
21 | +#include "config.h" | 21 | +#include "config.h" |
22 | + | 22 | + |
23 | static char *arg_directory = NULL; | 23 | static char *arg_directory = NULL; |
24 | static char *arg_template = NULL; | 24 | static char *arg_template = NULL; |
25 | static char *arg_user = NULL; | 25 | static char *arg_user = NULL; |
26 | @@ -4257,7 +4259,12 @@ int main(int argc, char *argv[]) { | 26 | @@ -4238,7 +4240,12 @@ static int inner_child( |
27 | a[0] = (char*) "/sbin/init"; | 27 | a[0] = (char*) "/sbin/init"; |
28 | execve(a[0], a, env_use); | 28 | execve(a[0], a, env_use); |
29 | } else if (argc > optind) | 29 | } else if (argc > optind) |
30 | +#ifdef HAVE_EXECVPE | 30 | +#ifdef HAVE_EXECVPE |
31 | execvpe(argv[optind], argv + optind, env_use); | 31 | execvpe(argv[optind], argv + optind, env_use); |
32 | +#else | 32 | +#else |
33 | + environ = env_use; | 33 | + environ = env_use; |
34 | + execvp(argv[optind], argv + optind); | 34 | + execvp(argv[optind], argv + optind); |
35 | +#endif /* HAVE_EXECVPE */ | 35 | +#endif /* HAVE_EXECVPE */ |
36 | else { | 36 | else { |
37 | chdir(home ? home : "/root"); | 37 | chdir(home ? home : "/root"); |
38 | execle("/bin/bash", "-bash", NULL, env_use); | 38 | execle("/bin/bash", "-bash", NULL, env_use); |
39 | -- | ||
40 | 2.1.4 | ||
41 | |||