Skip to content

Commit

Permalink
Fix probe_reset
Browse files Browse the repository at this point in the history
The probe_reset function didn't work properly,
because its second argument was always NULL.

This changes fixes the probe_reset function by
passing the probe as the second argument.

This change also call probe_ncache_clear to clear
the ncache instead of calling probe_ncache_free and
probe_ncache_new, like it was done in change
057873a.
  • Loading branch information
0intro committed Oct 4, 2023
1 parent 3a987f3 commit d55df87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/OVAL/probes/probe/probe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ static SEXP_t *probe_reset(SEXP_t *arg0, void *arg1)
* FIXME: implement main loop locking & worker waiting
*/
probe_rcache_free(probe->rcache);
probe_ncache_free(probe->ncache);

probe->rcache = probe_rcache_new();
probe->ncache = probe_ncache_new();
probe_ncache_clear(OSCAP_GSYM(ncache));
probe->ncache = OSCAP_GSYM(ncache);

return(NULL);
}
Expand Down Expand Up @@ -211,7 +211,7 @@ void *probe_common_main(void *arg)
if (probe.sd < 0)
fail(errno, "SEAP_openfd2", __LINE__ - 3);

if (SEAP_cmd_register(probe.SEAP_ctx, PROBECMD_RESET, 0, &probe_reset) != 0)
if (SEAP_cmd_register(probe.SEAP_ctx, PROBECMD_RESET, SEAP_CMDREG_USEARG, &probe_reset, &probe, NULL) != 0)
fail(errno, "SEAP_cmd_register", __LINE__ - 1);

/*
Expand Down

0 comments on commit d55df87

Please sign in to comment.