chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
escape: beef up new systemd-escape tool
[elogind.git]
/
src
/
shared
/
label.c
diff --git
a/src/shared/label.c
b/src/shared/label.c
index 70e5c85a11273833837b30fc7faea6fffa752d73..25a8b361b7c9c86e23139976e16acc910f717342 100644
(file)
--- a/
src/shared/label.c
+++ b/
src/shared/label.c
@@
-27,9
+27,7
@@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#ifdef HAVE_XATTR
#include <sys/xattr.h>
#include <sys/xattr.h>
-#endif
#ifdef HAVE_SELINUX
#include <selinux/selinux.h>
#include <selinux/label.h>
#ifdef HAVE_SELINUX
#include <selinux/selinux.h>
#include <selinux/label.h>
@@
-79,7
+77,7
@@
static int smack_relabel_in_dev(const char *path) {
r = setxattr(path, "security.SMACK64", label, strlen(label), 0);
if (r < 0) {
r = setxattr(path, "security.SMACK64", label, strlen(label), 0);
if (r < 0) {
- log_error("Smack relabeling \"%s\" %
s", path, strerror(errno)
);
+ log_error("Smack relabeling \"%s\" %
m", path
);
return -errno;
}
#endif
return -errno;
}
#endif
@@
-295,6
+293,8
@@
int label_socket_set(const char *label) {
void label_context_clear(void) {
#ifdef HAVE_SELINUX
void label_context_clear(void) {
#ifdef HAVE_SELINUX
+ PROTECT_ERRNO;
+
if (!use_selinux())
return;
if (!use_selinux())
return;
@@
-305,6
+305,8
@@
void label_context_clear(void) {
void label_socket_clear(void) {
#ifdef HAVE_SELINUX
void label_socket_clear(void) {
#ifdef HAVE_SELINUX
+ PROTECT_ERRNO;
+
if (!use_selinux())
return;
if (!use_selinux())
return;