From cc89383b3207f14671ad4266bb945347d5c1b609 Mon Sep 17 00:00:00 2001 From: Andy Lutomirski Date: Wed, 30 Apr 2014 22:10:13 -0700 Subject: setpriv: Fix --selinux-label This commit: commit 05cef8eafbf169a8da1d2831f5ed3d5b1b81aaad Author: Sami Kerola Date: Sat Apr 13 20:54:59 2013 +0100 setpriv: check writing to a file descriptor was successful broke --selinux-label. It checks whether fsyncing /proc/self/attr/exec succeeds, and it doesn't, because fsync isn't supported on that file. I have stealthily improved the error message as part of this fix. Signed-off-by: Andy Lutomirski --- sys-utils/setpriv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys-utils/setpriv.c') diff --git a/sys-utils/setpriv.c b/sys-utils/setpriv.c index 7bea62649..65921be18 100644 --- a/sys-utils/setpriv.c +++ b/sys-utils/setpriv.c @@ -526,9 +526,9 @@ static void do_selinux_label(const char *label) err(SETPRIV_EXIT_PRIVERR, _("write failed: %s"), _PATH_PROC_ATTR_EXEC); - if (close_fd(fd) != 0) + if (close(fd) != 0) err(SETPRIV_EXIT_PRIVERR, - _("write failed: %s"), _PATH_PROC_ATTR_EXEC); + _("close failed: %s"), _PATH_PROC_ATTR_EXEC); } static void do_apparmor_profile(const char *label) -- cgit v1.2.3-55-g7522