summaryrefslogtreecommitdiff
path: root/src/selinux.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/selinux.c')
-rw-r--r--src/selinux.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/selinux.c b/src/selinux.c
index cd38a81e8..016db1626 100644
--- a/src/selinux.c
+++ b/src/selinux.c
@@ -192,6 +192,11 @@ restorecon_private (char const *path, bool local)
{
if (getfscreatecon (&tcon) < 0)
return rc;
+ if (!tcon)
+ {
+ errno = ENODATA;
+ return rc;
+ }
rc = lsetfilecon (path, tcon);
freecon (tcon);
return rc;