|
1 This patch fixes the file probe from crashing on solaris when encountering file |
|
2 types of door and port. |
|
3 This patch has not been contributed upstream, but is planned to be done by |
|
4 2013-Jul-12. |
|
5 |
|
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 2013-03-12 19:52:50.739765914 -0700 |
|
8 @@ -84,6 +84,9 @@ |
|
9 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; |
|
11 static SEXP_t gr_lastpath; |
|
12 +#if defined(__SVR4) && defined(__sun) |
|
13 +static SEXP_t *gr_t_door = NULL, *gr_t_port = NULL; |
|
14 +#endif |
|
15 |
|
16 static SEXP_t *se_filetype (mode_t mode) |
|
17 { |
|
18 @@ -95,6 +98,10 @@ |
|
19 case S_IFIFO: return (gr_t_fifo); |
|
20 case S_IFSOCK: return (gr_t_sock); |
|
21 case S_IFCHR: return (gr_t_char); |
|
22 +#if defined(__SVR4) && defined(__sun) |
|
23 + case S_IFDOOR: return (gr_t_door); |
|
24 + case S_IFPORT: return (gr_t_port); |
|
25 +#endif |
|
26 default: |
|
27 abort (); |
|
28 } |
|
29 @@ -355,6 +362,10 @@ |
|
30 #define STR_SOCKET "socket" |
|
31 #define STR_CHARSPEC "character special" |
|
32 #define STRLEN_PAIR(str) (str), strlen(str) |
|
33 +#if defined(__SVR4) && (__sun) |
|
34 +#define STR_DOOR "door" |
|
35 +#define STR_PORT "port" |
|
36 +#endif |
|
37 |
|
38 gr_t_reg = SEXP_string_new (STRLEN_PAIR(STR_REGULAR)); |
|
39 gr_t_dir = SEXP_string_new (STRLEN_PAIR(STR_DIRECTORY)); |
|
40 @@ -363,6 +374,10 @@ |
|
41 gr_t_fifo = SEXP_string_new (STRLEN_PAIR(STR_FIFO)); |
|
42 gr_t_sock = SEXP_string_new (STRLEN_PAIR(STR_SOCKET)); |
|
43 gr_t_char = SEXP_string_new (STRLEN_PAIR(STR_CHARSPEC)); |
|
44 +#if defined(__SVR4) && (__sun) |
|
45 + gr_t_door = SEXP_string_new (STRLEN_PAIR(STR_DOOR)); |
|
46 + gr_t_port = SEXP_string_new (STRLEN_PAIR(STR_PORT)); |
|
47 +#endif |
|
48 |
|
49 SEXP_init(&gr_lastpath); |
|
50 |