From 7885012ba0a7c1d7c974dd9528afa90aeed916a6 Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Tue, 10 Nov 2009 12:12:54 -0500 Subject: Replace the use of the global variable 'modpath' in diagnostic messages within verify_it with the use of a 'module_name' parameter passed in. Add a comment in insert_module explaining why it's ok to overwrite the 'path' parameter with the canonicalized path. --- runtime/staprun/staprun_funcs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runtime/staprun/staprun_funcs.c') diff --git a/runtime/staprun/staprun_funcs.c b/runtime/staprun/staprun_funcs.c index 47ad6a19..89f78ade 100644 --- a/runtime/staprun/staprun_funcs.c +++ b/runtime/staprun/staprun_funcs.c @@ -84,7 +84,9 @@ int insert_module( /* Overwrite the path with the canonicalized one, to defeat a possible race between path and signature checking below and, - somewhat later, module loading. */ + somewhat later, module loading. This path gets propogated to the + helper functions called by this function and is not used for any + other purpose, so it is ok to overwrite the 'path' parameter. */ path = strdup (module_realpath); if (path == NULL) { _perr("allocating memory failed"); @@ -256,7 +258,7 @@ check_signature(const char *path, const void *module_data, off_t module_size) } sprintf (signature_realpath, "%s.sgn", path); - rc = verify_module (signature_realpath, module_data, module_size); + rc = verify_module (signature_realpath, path, module_data, module_size); dbug(2, "verify_module returns %d\n", rc); -- cgit