mirror of
https://github.com/systemd/systemd.git
synced 2025-01-24 06:04:05 +03:00
selinux: check return value of string_to_security_class()
This should never happen, but better safe than sorry.
This commit is contained in:
parent
81d4a026a6
commit
fdb0405edd
@ -233,6 +233,9 @@ int mac_selinux_get_create_label_from_exe(const char *exe, char **label) {
|
||||
return -errno;
|
||||
|
||||
sclass = string_to_security_class("process");
|
||||
if (sclass == 0)
|
||||
return -ENOSYS;
|
||||
|
||||
r = security_compute_create_raw(mycon, fcon, sclass, label);
|
||||
if (r < 0)
|
||||
return -errno;
|
||||
@ -312,6 +315,9 @@ int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *
|
||||
return -ENOMEM;
|
||||
|
||||
sclass = string_to_security_class("process");
|
||||
if (sclass == 0)
|
||||
return -ENOSYS;
|
||||
|
||||
r = security_compute_create_raw(mycon, fcon, sclass, label);
|
||||
if (r < 0)
|
||||
return -errno;
|
||||
|
Loading…
x
Reference in New Issue
Block a user