summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/wayland/weston/weston-launch-shell.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/wayland/weston/weston-launch-shell.patch')
-rw-r--r--meta/recipes-graphics/wayland/weston/weston-launch-shell.patch74
1 files changed, 0 insertions, 74 deletions
diff --git a/meta/recipes-graphics/wayland/weston/weston-launch-shell.patch b/meta/recipes-graphics/wayland/weston/weston-launch-shell.patch
deleted file mode 100644
index ffe0608ee2..0000000000
--- a/meta/recipes-graphics/wayland/weston/weston-launch-shell.patch
+++ /dev/null
@@ -1,74 +0,0 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@intel.com>
3
4From ff3230952a68077669e0ea0ac3ceb234273556fc Mon Sep 17 00:00:00 2001
5From: Quentin Glidic <sardemff7+git@sardemff7.net>
6Date: Fri, 17 May 2013 16:20:37 +0200
7Subject: [PATCH] weston-launch: Run weston in the user login shell
8
9This patch brings back the user environment from the shell.
10In the future, weston-launch could create the Wayland socket earlier, in
11which case the user's shell could be used to run Wayland-specific tools
12in the new Weston session.
13
14Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
15---
16 src/weston-launch.c | 19 ++++++++++++++++---
17 1 file changed, 16 insertions(+), 3 deletions(-)
18
19diff --git a/src/weston-launch.c b/src/weston-launch.c
20index 64d4a8a..89c3c5a 100644
21--- a/src/weston-launch.c
22+++ b/src/weston-launch.c
23@@ -60,6 +60,8 @@
24
25 #include "weston-launch.h"
26
27+#define MAX_ARGV_SIZE 256
28+
29 struct weston_launch {
30 struct pam_conv pc;
31 pam_handle_t *ph;
32@@ -523,8 +525,9 @@ main(int argc, char *argv[])
33 struct weston_launch wl;
34 char **env;
35 int i, c;
36- char **child_argv;
37+ char *child_argv[MAX_ARGV_SIZE];
38 char *tty = NULL, *new_user = NULL;
39+ char *term;
40 int sleep_fork = 0;
41 struct option opts[] = {
42 { "user", required_argument, NULL, 'u' },
43@@ -562,8 +565,8 @@ main(int argc, char *argv[])
44 }
45 }
46
47- child_argv = &argv[optind-1];
48- child_argv[0] = BINDIR "/weston";
49+ if ((argc - optind) > (MAX_ARGV_SIZE - 5))
50+ error(1, E2BIG, "Too many arguments to pass to weston");
51
52 if (new_user)
53 wl.pw = getpwnam(new_user);
54@@ -572,7 +575,17 @@ main(int argc, char *argv[])
55 if (wl.pw == NULL)
56 error(1, errno, "failed to get username");
57
58+ child_argv[0] = wl.pw->pw_shell;
59+ child_argv[1] = "-l";
60+ child_argv[2] = "-c";
61+ child_argv[3] = BINDIR "/weston \"$@\"";
62+ child_argv[4] = "weston";
63+ for (i = 0; i < (argc - optind); ++i)
64+ child_argv[5+i] = argv[optind+i];
65+
66+ term = getenv("TERM");
67 clearenv();
68+ setenv("TERM", term, 1);
69 setenv("USER", wl.pw->pw_name, 1);
70 setenv("LOGNAME", wl.pw->pw_name, 1);
71 setenv("HOME", wl.pw->pw_dir, 1);
72--
731.7.10.4
74