|
1 --- openscap-0.9.7/src/OVAL/probes/unix/uname.c.~1~ 2013-04-23 06:21:51.480000001 -0700 |
|
2 +++ openscap-0.9.7/src/OVAL/probes/unix/uname.c 2013-08-27 10:06:34.813681695 -0700 |
|
3 @@ -50,6 +50,9 @@ |
|
4 #endif |
|
5 #include <string.h> |
|
6 #include <sys/utsname.h> |
|
7 +#if defined (__SVR4) && defined (__sun) |
|
8 +#include <sys/systeminfo.h> |
|
9 +#endif |
|
10 |
|
11 #include "seap.h" |
|
12 #include "probe-api.h" |
|
13 @@ -59,17 +62,28 @@ |
|
14 { |
|
15 struct utsname buf; |
|
16 SEXP_t *item; |
|
17 +#if defined (__SVR4) && defined (__sun) |
|
18 + char procbuf[SYS_NMLN]; |
|
19 +#endif |
|
20 |
|
21 // Collect the info |
|
22 uname(&buf); |
|
23 |
|
24 +#if defined (__SVR4) && defined (__sun) |
|
25 + if (sysinfo(SI_ARCHITECTURE, procbuf, sizeof(procbuf)) == -1) |
|
26 + return(PROBE_EFATAL); |
|
27 +#endif |
|
28 item = probe_item_create(OVAL_UNIX_UNAME, NULL, |
|
29 "machine_class", OVAL_DATATYPE_STRING, buf.machine, |
|
30 "node_name", OVAL_DATATYPE_STRING, buf.nodename, |
|
31 "os_name", OVAL_DATATYPE_STRING, buf.sysname, |
|
32 "os_release", OVAL_DATATYPE_STRING, buf.release, |
|
33 "os_version", OVAL_DATATYPE_STRING, buf.version, |
|
34 +#if defined (__SVR4) && defined (__sun) |
|
35 + "processor_type", OVAL_DATATYPE_STRING, procbuf, |
|
36 +#else |
|
37 "processor_type", OVAL_DATATYPE_STRING, buf.machine, |
|
38 +#endif |
|
39 NULL); |
|
40 |
|
41 probe_item_collect(ctx, item); |