From d0c24c50d9857254f5d32cf53adb0091ceaa1fa6 Mon Sep 17 00:00:00 2001 From: bigbiff bigbiff Date: Fri, 11 Oct 2013 20:28:00 -0400 Subject: fix getting and setting contexts in selinux recreate lost+found with selinux contexts Change-Id: I19e8696d47319dfb641520956c8a27c2a796a0c3 --- libtar/extract.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libtar/extract.c') diff --git a/libtar/extract.c b/libtar/extract.c index d19ba859d..8081aa2b9 100644 --- a/libtar/extract.c +++ b/libtar/extract.c @@ -161,8 +161,9 @@ tar_extract_file(TAR *t, char *realname, char *prefix) #ifdef DEBUG printf(" Restoring SELinux context %s to file %s\n", t->th_buf.selinux_context, realname); #endif - if(setfilecon(realname, t->th_buf.selinux_context) < 0) + if (lsetfilecon(realname, t->th_buf.selinux_context) < 0) { fprintf(stderr, "Failed to restore SELinux context %s!\n", strerror(errno)); + } } #endif -- cgit v1.2.3