X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fselinux-util.c;h=a2233e0cfb75e5c259fd42131e5930af2fc96841;hb=d14b5bc621fc1fa57ef0db3ccba6957efed8e7d4;hp=6bd3bf1c8027c651a928692b2773e21a32c7b63e;hpb=2d58aa4692e9fc47911bff5d064ba3e328c35369;p=elogind.git diff --git a/src/shared/selinux-util.c b/src/shared/selinux-util.c index 6bd3bf1c8..a2233e0cf 100644 --- a/src/shared/selinux-util.c +++ b/src/shared/selinux-util.c @@ -233,7 +233,7 @@ int mac_selinux_get_our_label(char **label) { return r; } -int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, char **label) { +int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *exec_label, char **label) { int r = -EOPNOTSUPP; #ifdef HAVE_SELINUX @@ -257,11 +257,7 @@ int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, char **label if (r < 0) return -errno; - r = getexeccon(&fcon); - if (r < 0) - return -errno; - - if (!fcon) { + if (!exec_label) { /* If there is no context set for next exec let's use context of target executable */ r = getfilecon(exe, &fcon);