Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gnome-session
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
37
Issues
37
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
gnome-session
Commits
4b4312a4
Commit
4b4312a4
authored
Sep 24, 2019
by
Iain Lane
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'benzea/systemd-fixes' into 'master'
Systemd fixes Closes
#31
See merge request
!23
parents
08522478
b7b24627
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
6 deletions
+37
-6
data/gnome-session-manager@.service.in
data/gnome-session-manager@.service.in
+1
-1
gnome-session/gsm-util.c
gnome-session/gsm-util.c
+36
-5
No files found.
data/gnome-session-manager@.service.in
View file @
4b4312a4
...
...
@@ -15,5 +15,5 @@ Before=gnome-session-manager.target
[Service]
Type=notify
ExecStart=@libexecdir@/gnome-session-binary --
debug --
systemd-service --session=%i
ExecStart=@libexecdir@/gnome-session-binary --systemd-service --session=%i
ExecStopPost=-@libexecdir@/gnome-session-ctl --shutdown
gnome-session/gsm-util.c
View file @
4b4312a4
...
...
@@ -35,6 +35,12 @@
static
gchar
*
_saved_session_dir
=
NULL
;
static
gchar
**
child_environment
;
/* These are variables that will not be passed on to subprocesses
* (either directly, via systemd or DBus).
* Some of these are blacklisted as they might end up in the wrong session
* (e.g. XDG_VTNR), others because they simply must never be passed on
* (NOTIFY_SOCKET).
*/
static
const
char
*
const
variable_blacklist
[]
=
{
"NOTIFY_SOCKET"
,
"XDG_SEAT"
,
...
...
@@ -43,6 +49,24 @@ static const char * const variable_blacklist[] = {
NULL
};
/* The following is copied from GDMs spawn_session function.
*
* Environment variables listed here will be copied into the user's service
* environments if they are set in gnome-session's environment. If they are
* not set in gnome-session's environment, they will be removed from the
* service environments. This is to protect against environment variables
* leaking from previous sessions (e.g. when switching from classic to
* default GNOME $GNOME_SHELL_SESSION_MODE will become unset).
*/
static
const
char
*
const
variable_unsetlist
[]
=
{
"DISPLAY"
,
"XAUTHORITY"
,
"WAYLAND_DISPLAY"
,
"WAYLAND_SOCKET"
,
"GNOME_SHELL_SESSION_MODE"
,
NULL
};
char
*
gsm_util_find_desktop_file_for_app_name
(
const
char
*
name
,
gboolean
look_in_saved_session
,
...
...
@@ -616,10 +640,17 @@ gsm_util_export_user_environment (GError **error)
entries
=
g_get_environ
();
for
(;
variable_blacklist
[
i
]
!=
NULL
;
i
++
)
for
(
i
=
0
;
variable_blacklist
[
i
]
!=
NULL
;
i
++
)
entries
=
g_environ_unsetenv
(
entries
,
variable_blacklist
[
i
]);
g_variant_builder_init
(
&
builder
,
G_VARIANT_TYPE
(
"as"
));
g_variant_builder_init
(
&
builder
,
G_VARIANT_TYPE
(
"(asas)"
));
g_variant_builder_open
(
&
builder
,
G_VARIANT_TYPE
(
"as"
));
for
(
i
=
0
;
variable_unsetlist
[
i
]
!=
NULL
;
i
++
)
g_variant_builder_add
(
&
builder
,
"s"
,
variable_unsetlist
[
i
]);
g_variant_builder_close
(
&
builder
);
g_variant_builder_open
(
&
builder
,
G_VARIANT_TYPE
(
"as"
));
for
(
i
=
0
;
entries
[
i
]
!=
NULL
;
i
++
)
{
const
char
*
entry
=
entries
[
i
];
...
...
@@ -631,6 +662,7 @@ gsm_util_export_user_environment (GError **error)
g_variant_builder_add
(
&
builder
,
"s"
,
entry
);
}
g_variant_builder_close
(
&
builder
);
g_regex_unref
(
regex
);
g_strfreev
(
entries
);
...
...
@@ -639,9 +671,8 @@ gsm_util_export_user_environment (GError **error)
"org.freedesktop.systemd1"
,
"/org/freedesktop/systemd1"
,
"org.freedesktop.systemd1.Manager"
,
"SetEnvironment"
,
g_variant_new
(
"(@as)"
,
g_variant_builder_end
(
&
builder
)),
"UnsetAndSetEnvironment"
,
g_variant_builder_end
(
&
builder
),
NULL
,
G_DBUS_CALL_FLAGS_NONE
,
-
1
,
NULL
,
&
bus_error
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment