psss / rpms / libselinux

Forked from rpms/libselinux 5 years ago
Clone
Blob Blame History Raw
diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-1.21.11/src/matchpathcon.c
--- nsalibselinux/src/matchpathcon.c	2005-02-22 16:34:17.000000000 -0500
+++ libselinux-1.21.11/src/matchpathcon.c	2005-02-28 13:27:33.000000000 -0500
@@ -679,6 +679,11 @@
 		 mode_t mode,
 		 security_context_t *con)
 {
+	/* If the user provides a mode but does not provide a file type
+	   default to regular file */
+	if (mode && ((mode & S_IFMT)==0)) {
+		mode = mode | S_IFREG;
+	}
 	int i = matchpathcon_common(name, mode);
 
 	if (i < 0)