components/openscap/patches/file.c.patch
branchs11-update
changeset 3806 bdc70b98921a
parent 2821 8add1494802c
--- a/components/openscap/patches/file.c.patch	Fri Feb 13 09:27:11 2015 -0800
+++ b/components/openscap/patches/file.c.patch	Fri Feb 13 12:30:50 2015 -0800
@@ -1,74 +1,16 @@
-Fixed issue with file probe not returning has_extended_acl on solaris.
-This patch fixes the file probe from crashing on solaris when encountering file
-types of door and port.
-This patch has not been contributed upstream, but is planned to be done by
-2013-Jul-12.
-
---- openscap-0.9.7/src/OVAL/probes/unix/file.c.~1~	2013-04-23 06:21:51.447000001 -0700
-+++ openscap-0.9.7/src/OVAL/probes/unix/file.c	2013-08-16 13:04:51.171523322 -0700
-@@ -77,6 +77,9 @@
- #else
- # error "Sorry, your OS isn't supported."
- #endif
-+#if defined(__SVR4) && defined(__sun)
-+#include <sys/acl.h>
-+#endif
- 
- oval_version_t over;
- 
-@@ -84,6 +87,9 @@
- static SEXP_t *gr_t_dir  = NULL, *gr_t_lnk  = NULL, *gr_t_blk  = NULL;
- static SEXP_t *gr_t_fifo = NULL, *gr_t_sock = NULL, *gr_t_char = NULL;
- static SEXP_t  gr_lastpath;
-+#if defined(__SVR4) && defined(__sun)
-+static SEXP_t *gr_t_door = NULL, *gr_t_port = NULL;
-+#endif
+This patch is required to fix file probe to support the has_extended_acl
+attribute in OVAL.
+This patch has not been contributed to upstream, but is planned to be
+completed by 2015-Jan-31.
  
- static SEXP_t *se_filetype (mode_t mode)
- {
-@@ -95,6 +101,10 @@
-         case S_IFIFO:  return (gr_t_fifo);
-         case S_IFSOCK: return (gr_t_sock);
-         case S_IFCHR:  return (gr_t_char);
-+#if	defined(__SVR4) && defined(__sun)
-+	case S_IFDOOR: return (gr_t_door);
-+	case S_IFPORT: return (gr_t_port);
-+#endif
-         default:
-                 abort ();
-         }
-@@ -286,8 +297,12 @@
- 			se_acl = acl_extended_file(st_path) ? gr_true : gr_false;
- 		}
+--- openscap-1.1.1/src/OVAL/probes/unix/file.c~1~	2014-10-27 12:41:33.138555312 -0700
++++ openscap-1.1.1/src/OVAL/probes/unix/file.c	2014-10-27 12:40:05.815261373 -0700
+@@ -261,7 +261,7 @@
+ 	}
+ 	return (has_acl == 1) ? gr_true : gr_false;
+ #elif defined(OS_SOLARIS)
+-	return acl_trivial(st_path) ? gr_true : gr_false;
++	return acl_trivial(path) ? gr_true : gr_false;
  #else
-+#if defined(__SVR4) && defined(__sun)
-+		se_acl = acl_trivial(st_path) ? gr_true : gr_false;
-+#else
- 		se_acl = NULL;
+ 	return NULL;
  #endif
-+#endif
- 
-                 item = probe_item_create(OVAL_UNIX_FILE, NULL,
-                                          "filepath", OVAL_DATATYPE_SEXP, se_filepath,
-@@ -355,6 +370,10 @@
- #define STR_SOCKET    "socket"
- #define STR_CHARSPEC  "character special"
- #define STRLEN_PAIR(str) (str), strlen(str)
-+#if	defined(__SVR4) && (__sun)
-+#define	STR_DOOR	"door"
-+#define	STR_PORT	"port"
-+#endif
- 
-         gr_t_reg  = SEXP_string_new (STRLEN_PAIR(STR_REGULAR));
-         gr_t_dir  = SEXP_string_new (STRLEN_PAIR(STR_DIRECTORY));
-@@ -363,6 +382,10 @@
-         gr_t_fifo = SEXP_string_new (STRLEN_PAIR(STR_FIFO));
-         gr_t_sock = SEXP_string_new (STRLEN_PAIR(STR_SOCKET));
-         gr_t_char = SEXP_string_new (STRLEN_PAIR(STR_CHARSPEC));
-+#if	defined(__SVR4) && (__sun)
-+        gr_t_door = SEXP_string_new (STRLEN_PAIR(STR_DOOR));
-+        gr_t_port = SEXP_string_new (STRLEN_PAIR(STR_PORT));
-+#endif
- 
- 	SEXP_init(&gr_lastpath);
-