components/openscap/patches/file.c.patch
branchs11-update
changeset 2821 8add1494802c
parent 2705 e39a44e3cb41
child 3595 3fab3649e6cd
equal deleted inserted replaced
2819:edca5d32095e 2821:8add1494802c
       
     1 Fixed issue with file probe not returning has_extended_acl on solaris.
     1 This patch fixes the file probe from crashing on solaris when encountering file
     2 This patch fixes the file probe from crashing on solaris when encountering file
     2 types of door and port.
     3 types of door and port.
     3 This patch has not been contributed upstream, but is planned to be done by
     4 This patch has not been contributed upstream, but is planned to be done by
     4  2013-Jul-12.
     5 2013-Jul-12.
     5 
     6 
     6 --- openscap-0.9.7/src/OVAL/probes/unix/file.c.~1~	2012-12-12 07:09:05.806498654 -0800
     7 --- openscap-0.9.7/src/OVAL/probes/unix/file.c.~1~	2013-04-23 06:21:51.447000001 -0700
     7 +++ openscap-0.9.7/src/OVAL/probes/unix/file.c	2013-03-12 19:52:50.739765914 -0700
     8 +++ openscap-0.9.7/src/OVAL/probes/unix/file.c	2013-08-16 13:04:51.171523322 -0700
     8 @@ -84,6 +84,9 @@
     9 @@ -77,6 +77,9 @@
       
    10  #else
       
    11  # error "Sorry, your OS isn't supported."
       
    12  #endif
       
    13 +#if defined(__SVR4) && defined(__sun)
       
    14 +#include <sys/acl.h>
       
    15 +#endif
       
    16  
       
    17  oval_version_t over;
       
    18  
       
    19 @@ -84,6 +87,9 @@
     9  static SEXP_t *gr_t_dir  = NULL, *gr_t_lnk  = NULL, *gr_t_blk  = NULL;
    20  static SEXP_t *gr_t_dir  = NULL, *gr_t_lnk  = NULL, *gr_t_blk  = NULL;
    10  static SEXP_t *gr_t_fifo = NULL, *gr_t_sock = NULL, *gr_t_char = NULL;
    21  static SEXP_t *gr_t_fifo = NULL, *gr_t_sock = NULL, *gr_t_char = NULL;
    11  static SEXP_t  gr_lastpath;
    22  static SEXP_t  gr_lastpath;
    12 +#if defined(__SVR4) && defined(__sun)
    23 +#if defined(__SVR4) && defined(__sun)
    13 +static SEXP_t *gr_t_door = NULL, *gr_t_port = NULL;
    24 +static SEXP_t *gr_t_door = NULL, *gr_t_port = NULL;
    14 +#endif
    25 +#endif
    15  
    26  
    16  static SEXP_t *se_filetype (mode_t mode)
    27  static SEXP_t *se_filetype (mode_t mode)
    17  {
    28  {
    18 @@ -95,6 +98,10 @@
    29 @@ -95,6 +101,10 @@
    19          case S_IFIFO:  return (gr_t_fifo);
    30          case S_IFIFO:  return (gr_t_fifo);
    20          case S_IFSOCK: return (gr_t_sock);
    31          case S_IFSOCK: return (gr_t_sock);
    21          case S_IFCHR:  return (gr_t_char);
    32          case S_IFCHR:  return (gr_t_char);
    22 +#if	defined(__SVR4) && defined(__sun)
    33 +#if	defined(__SVR4) && defined(__sun)
    23 +	case S_IFDOOR: return (gr_t_door);
    34 +	case S_IFDOOR: return (gr_t_door);
    24 +	case S_IFPORT: return (gr_t_port);
    35 +	case S_IFPORT: return (gr_t_port);
    25 +#endif
    36 +#endif
    26          default:
    37          default:
    27                  abort ();
    38                  abort ();
    28          }
    39          }
    29 @@ -355,6 +362,10 @@
    40 @@ -286,8 +297,12 @@
       
    41  			se_acl = acl_extended_file(st_path) ? gr_true : gr_false;
       
    42  		}
       
    43  #else
       
    44 +#if defined(__SVR4) && defined(__sun)
       
    45 +		se_acl = acl_trivial(st_path) ? gr_true : gr_false;
       
    46 +#else
       
    47  		se_acl = NULL;
       
    48  #endif
       
    49 +#endif
       
    50  
       
    51                  item = probe_item_create(OVAL_UNIX_FILE, NULL,
       
    52                                           "filepath", OVAL_DATATYPE_SEXP, se_filepath,
       
    53 @@ -355,6 +370,10 @@
    30  #define STR_SOCKET    "socket"
    54  #define STR_SOCKET    "socket"
    31  #define STR_CHARSPEC  "character special"
    55  #define STR_CHARSPEC  "character special"
    32  #define STRLEN_PAIR(str) (str), strlen(str)
    56  #define STRLEN_PAIR(str) (str), strlen(str)
    33 +#if	defined(__SVR4) && (__sun)
    57 +#if	defined(__SVR4) && (__sun)
    34 +#define	STR_DOOR	"door"
    58 +#define	STR_DOOR	"door"
    35 +#define	STR_PORT	"port"
    59 +#define	STR_PORT	"port"
    36 +#endif
    60 +#endif
    37  
    61  
    38          gr_t_reg  = SEXP_string_new (STRLEN_PAIR(STR_REGULAR));
    62          gr_t_reg  = SEXP_string_new (STRLEN_PAIR(STR_REGULAR));
    39          gr_t_dir  = SEXP_string_new (STRLEN_PAIR(STR_DIRECTORY));
    63          gr_t_dir  = SEXP_string_new (STRLEN_PAIR(STR_DIRECTORY));
    40 @@ -363,6 +374,10 @@
    64 @@ -363,6 +382,10 @@
    41          gr_t_fifo = SEXP_string_new (STRLEN_PAIR(STR_FIFO));
    65          gr_t_fifo = SEXP_string_new (STRLEN_PAIR(STR_FIFO));
    42          gr_t_sock = SEXP_string_new (STRLEN_PAIR(STR_SOCKET));
    66          gr_t_sock = SEXP_string_new (STRLEN_PAIR(STR_SOCKET));
    43          gr_t_char = SEXP_string_new (STRLEN_PAIR(STR_CHARSPEC));
    67          gr_t_char = SEXP_string_new (STRLEN_PAIR(STR_CHARSPEC));
    44 +#if	defined(__SVR4) && (__sun)
    68 +#if	defined(__SVR4) && (__sun)
    45 +        gr_t_door = SEXP_string_new (STRLEN_PAIR(STR_DOOR));
    69 +        gr_t_door = SEXP_string_new (STRLEN_PAIR(STR_DOOR));