[libuser/f14/master] Handle matchpathcon() failing with ENOENT

Miloslav Trmac mitr at fedoraproject.org
Wed Sep 29 21:16:04 UTC 2010


commit b5a19ade39013f11e2092015b871a8b54e091fb7
Author: Miloslav Trmač <mitr at redhat.com>
Date:   Wed Sep 29 23:15:51 2010 +0200

    Handle matchpathcon() failing with ENOENT
    
    * Wed Sep 29 2010 Miloslav Trmač <mitr at redhat.com> - 0.56.18-2
    - Handle matchpathcon() failing with ENOENT
      Resolves: #631717

 libuser-0.56.18-matchpathcon.patch |   30 ++++++++++++++++++++++++++++++
 libuser.spec                       |    9 ++++++++-
 2 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/libuser-0.56.18-matchpathcon.patch b/libuser-0.56.18-matchpathcon.patch
new file mode 100644
index 0000000..b67ec60
--- /dev/null
+++ b/libuser-0.56.18-matchpathcon.patch
@@ -0,0 +1,30 @@
+Handle matchpathcon() failing with ENOENT.
+
+2010-09-29  Miloslav Trmač  <mitr at redhat.com>
+
+	* lib/util.c (lu_util_fscreate_for_path): Handle cases when a path is
+	not in the matchpathcon database.
+
+diff -r cf42457692b4 -r 2744aecc92b1 lib/util.c
+--- a/lib/util.c	Mon Sep 27 19:27:26 2010 +0200
++++ b/lib/util.c	Wed Sep 29 23:02:56 2010 +0200
+@@ -756,10 +756,15 @@
+ 		security_context_t ctx;
+ 
+ 		if (matchpathcon(path, mode, &ctx) < 0) {
+-			lu_error_new(error, lu_error_stat,
+-				     _("couldn't determine security context "
+-				       "for `%s': %s"), path, strerror(errno));
+-			return FALSE;
++			if (errno == ENOENT)
++				ctx = NULL;
++			else {
++				lu_error_new(error, lu_error_stat,
++					     _("couldn't determine security "
++					       "context for `%s': %s"), path,
++					     strerror(errno));
++				return FALSE;
++			}
+ 		}
+ 		if (setfscreatecon(ctx) < 0) {
+ 			lu_error_new(error, lu_error_generic,
diff --git a/libuser.spec b/libuser.spec
index 93cc196..dffcfbf 100644
--- a/libuser.spec
+++ b/libuser.spec
@@ -2,13 +2,15 @@
 
 Name: libuser
 Version: 0.56.18
-Release: 1%{?dist}
+Release: 2%{?dist}
 Group: System Environment/Base
 License: LGPLv2+
 URL: https://fedorahosted.org/libuser/
 Source: https://fedorahosted.org/releases/l/i/libuser/libuser-%{version}.tar.xz
 # Upstream commit 276fa0a3078b431e18289285f84a77381b89726c
 Patch0: libuser-0.56.17-crypt_style.patch
+# Upstream commit 2744aecc92b1f0c78d19022bf9e8107450544e18
+Patch1: libuser-0.56.18-matchpathcon.patch
 BuildRequires: glib2-devel, linuxdoc-tools, pam-devel, popt-devel, python2-devel
 BuildRequires: cyrus-sasl-devel, libselinux-devel, openldap-devel
 # To make sure the configure script can find it
@@ -46,6 +48,7 @@ administering user and group accounts.
 %prep
 %setup -q
 %patch0 -p1 -b .crypt_style
+%patch1 -p1 -b .matchpathcon
 
 %build
 %configure --with-selinux --with-ldap --with-html-dir=%{_datadir}/gtk-doc/html
@@ -101,6 +104,10 @@ python -c "import libuser"
 %{_datadir}/gtk-doc/html/*
 
 %changelog
+* Wed Sep 29 2010 Miloslav Trmač <mitr at redhat.com> - 0.56.18-2
+- Handle matchpathcon() failing with ENOENT
+  Resolves: #631717
+
 * Tue Sep 14 2010 Miloslav Trmač <mitr at redhat.com> - 0.56.18-1
 - Update to libuser-0.56.18
 


More information about the scm-commits mailing list