chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
path-util: make use of "mnt_id" field exported in /proc/self/fdinfo/<fd> to test...
[elogind.git]
/
src
/
shared
/
selinux-util.c
diff --git
a/src/shared/selinux-util.c
b/src/shared/selinux-util.c
index 6bd3bf1c8027c651a928692b2773e21a32c7b63e..7c58985cd26ae29975e4e7fc5458a5e5dd6b12d6 100644
(file)
--- a/
src/shared/selinux-util.c
+++ b/
src/shared/selinux-util.c
@@
-20,7
+20,6
@@
***/
#include <errno.h>
***/
#include <errno.h>
-#include <unistd.h>
#include <malloc.h>
#include <sys/un.h>
#include <malloc.h>
#include <sys/un.h>
@@
-117,6
+116,7
@@
void mac_selinux_finish(void) {
return;
selabel_close(label_hnd);
return;
selabel_close(label_hnd);
+ label_hnd = NULL;
#endif
}
#endif
}
@@
-146,7
+146,7
@@
int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
r = lsetfilecon(path, fcon);
/* If the FS doesn't support labels, then exit without warning */
r = lsetfilecon(path, fcon);
/* If the FS doesn't support labels, then exit without warning */
- if (r < 0 && errno == E
NOTSU
P)
+ if (r < 0 && errno == E
OPNOTSUP
P)
return 0;
}
}
return 0;
}
}
@@
-233,7
+233,7
@@
int mac_selinux_get_our_label(char **label) {
return r;
}
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, c
onst char *exec_label, c
har **label) {
int r = -EOPNOTSUPP;
#ifdef HAVE_SELINUX
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;
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);
/* If there is no context set for next exec let's use context
of target executable */
r = getfilecon(exe, &fcon);