File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/OVAL/probes/unix/linux Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 62
62
63
63
64
64
struct dpkginfo_global {
65
+ int init_done ;
65
66
pthread_mutex_t mutex ;
66
67
};
67
68
68
- static struct dpkginfo_global g_dpkg ;
69
+ static struct dpkginfo_global g_dpkg = {
70
+ .init_done = -1 ,
71
+ };
69
72
70
73
71
74
void * probe_init (void )
72
75
{
73
76
pthread_mutex_init (& (g_dpkg .mutex ), NULL );
74
- dpkginfo_init ();
77
+
78
+ g_dpkg .init_done = dpkginfo_init ();
79
+ if (g_dpkg .init_done < 0 ) {
80
+ dE ("dpkginfo_init has failed." );
81
+ }
75
82
76
83
return ((void * )& g_dpkg );
77
84
}
@@ -97,6 +104,11 @@ int probe_main (probe_ctx *ctx, void *arg)
97
104
return PROBE_EINIT ;
98
105
}
99
106
107
+ if (g_dpkg .init_done < 0 ) {
108
+ probe_cobj_set_flag (probe_ctx_getresult (ctx ), SYSCHAR_FLAG_UNKNOWN );
109
+ return 0 ;
110
+ }
111
+
100
112
obj = probe_ctx_getobject (ctx );
101
113
ent = probe_obj_getent (obj , "name" , 1 );
102
114
You can’t perform that action at this time.
0 commit comments