#endif
}
+/// UNNEEDED by elogind
+#if 0
void mac_selinux_retest(void) {
#ifdef HAVE_SELINUX
cached_use = -1;
#endif
}
+#endif // 0
int mac_selinux_init(const char *prefix) {
int r = 0;
return r;
}
+/// UNNEEDED by elogind
+#if 0
void mac_selinux_finish(void) {
#ifdef HAVE_SELINUX
label_hnd = NULL;
#endif
}
+#endif // 0
int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
#endif
return 0;
}
-#endif // 0
int mac_selinux_get_create_label_from_exe(const char *exe, char **label) {
int r = -EOPNOTSUPP;
if (!mac_selinux_use())
return -EOPNOTSUPP;
- r = getcon(&mycon);
+ r = getcon_raw(&mycon);
if (r < 0)
return -errno;
- r = getfilecon(exe, &fcon);
+ r = getfilecon_raw(exe, &fcon);
if (r < 0)
return -errno;
if (!mac_selinux_use())
return -EOPNOTSUPP;
- r = getcon(label);
+ r = getcon_raw(label);
if (r < 0)
return -errno;
#endif
if (!mac_selinux_use())
return -EOPNOTSUPP;
- r = getcon(&mycon);
+ r = getcon_raw(&mycon);
if (r < 0)
return -errno;
if (!exec_label) {
/* If there is no context set for next exec let's use context
of target executable */
- r = getfilecon(exe, &fcon);
+ r = getfilecon_raw(exe, &fcon);
if (r < 0)
return -errno;
}
return r;
}
-void mac_selinux_free(char *label) {
+char* mac_selinux_free(char *label) {
#ifdef HAVE_SELINUX
+ if (!label)
+ return NULL;
+
if (!mac_selinux_use())
- return;
+ return NULL;
+
freecon((security_context_t) label);
#endif
+
+ return NULL;
}
+#endif // 0
int mac_selinux_create_file_prepare(const char *path, mode_t mode) {
int r = 0;
#endif
}
+/// UNNEEDED by elogind
+#if 0
int mac_selinux_create_socket_prepare(const char *label) {
#ifdef HAVE_SELINUX
#endif
return bind(fd, addr, addrlen) < 0 ? -errno : 0;
}
+#endif // 0