public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] setpriv: Fix --selinux-label
@ 2014-05-01  5:10 Andy Lutomirski
  2014-05-06  9:28 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Lutomirski @ 2014-05-01  5:10 UTC (permalink / raw)
  To: util-linux; +Cc: Andy Lutomirski

This commit:

    commit 05cef8eafbf169a8da1d2831f5ed3d5b1b81aaad
    Author: Sami Kerola <kerolasa@iki.fi>
    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 <luto@amacapital.net>
---
 sys-utils/setpriv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys-utils/setpriv.c b/sys-utils/setpriv.c
index 7bea626..65921be 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)
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] setpriv: Fix --selinux-label
  2014-05-01  5:10 [PATCH] setpriv: Fix --selinux-label Andy Lutomirski
@ 2014-05-06  9:28 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2014-05-06  9:28 UTC (permalink / raw)
  To: Andy Lutomirski; +Cc: util-linux

On Wed, Apr 30, 2014 at 10:10:13PM -0700, Andy Lutomirski wrote:
>  sys-utils/setpriv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-06  9:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-01  5:10 [PATCH] setpriv: Fix --selinux-label Andy Lutomirski
2014-05-06  9:28 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox