Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Laurent Bigonville
dbus
Commits
7dc49177
Commit
7dc49177
authored
Aug 31, 2018
by
Laurent Bigonville
Browse files
Set a DBusError in all failing paths of bus_selinux_check()
Bug:
dbus/dbus#198
parent
79bb1b4b
Pipeline
#68074
passed with stage
in 14 minutes and 45 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bus/selinux.c
View file @
7dc49177
...
...
@@ -423,13 +423,16 @@ bus_selinux_check (BusSELinuxID *sender_sid,
switch
(
errno
)
{
case
EACCES
:
_dbus_verbose
(
"SELinux denying due to security policy.
\n
"
);
dbus_set_error
(
error
,
DBUS_ERROR_ACCESS_DENIED
,
"SELinux denying due to security policy."
);
return
FALSE
;
case
EINVAL
:
_dbus_verbose
(
"SELinux denying due to invalid security context.
\n
"
);
dbus_set_error
(
error
,
DBUS_ERROR_ACCESS_DENIED
,
"SELinux denying due to invalid security context."
);
return
FALSE
;
default:
_dbus_verbose
(
"SELinux denying due to: %s
\n
"
,
_dbus_strerror
(
errno
));
dbus_set_error
(
error
,
DBUS_ERROR_ACCESS_DENIED
,
"SELinux denying due to: %s"
,
_dbus_strerror
(
errno
));
return
FALSE
;
}
}
...
...
bus/services.c
View file @
7dc49177
...
...
@@ -445,20 +445,13 @@ bus_registry_acquire_service (BusRegistry *registry,
if
(
!
bus_selinux_allows_acquire_service
(
connection
,
sid
,
_dbus_string_get_const_data
(
service_name
),
error
))
{
if
(
dbus_error_is_set
(
error
)
&&
dbus_error_has_name
(
error
,
DBUS_ERROR_NO_MEMORY
))
{
goto
out
;
}
dbus_set_error
(
error
,
DBUS_ERROR_ACCESS_DENIED
,
"Connection
\"
%s
\"
is not allowed to own the service
\"
%s
\"
due "
"to SELinux policy"
,
_dbus_verbose
(
"Connection
\"
%s
\"
is not allowed to own the service
\"
%s
\"
due "
"to SELinux policy:
\"
%s
\"\n
"
,
bus_connection_is_active
(
connection
)
?
bus_connection_get_name
(
connection
)
:
"(inactive)"
,
_dbus_string_get_const_data
(
service_name
));
_dbus_string_get_const_data
(
service_name
),
error
->
message
);
goto
out
;
}
...
...
Write
Preview
Supports
Markdown
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