components/openscap/patches/system_info5.c.patch
branchs11-update
changeset 4340 729452029ab0
equal deleted inserted replaced
4333:b0149b07d10b 4340:729452029ab0
       
     1 This fix prevents the probe from reporting failure when it is not able
       
     2  to probe network interfaces, for e.g. on cluster machines with failover.
       
     3 
       
     4 The s12 version (which also contains infrastructure fixes) is going upstream.
       
     5 
       
     6 --- openscap-1.2.0/src/OVAL/probes/independent/system_info.c.~5~	2015-01-12 09:34:43.204367626 -0800
       
     7 +++ openscap-1.2.0/src/OVAL/probes/independent/system_info.c	2015-01-12 09:30:40.087375833 -0800
       
     8 @@ -232,7 +232,7 @@
       
     9  leave2:
       
    10          close(fd);
       
    11  #if defined(__SVR4) && defined(__sun)
       
    12 -	if (item_added == 0 && rc == 0) {
       
    13 +	if (item_added == 0) {
       
    14  		attrs = probe_attr_creat("name",
       
    15  					 r0 = SEXP_string_newf("dummy0"),
       
    16  					 "ip_address",
       
    17 @@ -243,6 +243,9 @@
       
    18  		probe_item_ent_add(item, "interface", attrs, NULL);
       
    19  		SEXP_vfree(attrs, r0, r1, r2, NULL);
       
    20  	}
       
    21 + /* if not able to get info on interfaces, do not fail. */
       
    22 +	if (rc > 0) 
       
    23 +		rc = 0;
       
    24  #endif
       
    25  leave1:
       
    26          freeifaddrs(ifaddr);