psss / rpms / libselinux

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