diff -up nspluginwrapper-1.3.0/plugin-config-1.9/src/plugin-config.c.time nspluginwrapper-1.3.0/plugin-config-1.9/src/plugin-config.c --- nspluginwrapper-1.3.0/plugin-config-1.9/src/plugin-config.c.time 2010-06-28 14:44:39.000000000 +0200 +++ nspluginwrapper-1.3.0/plugin-config-1.9/src/plugin-config.c 2010-06-28 14:52:57.000000000 +0200 @@ -400,6 +400,32 @@ int get_link_config(WRAP_PLUGIN *p_plugi return(link); } +time_t get_plugin_time(char * filename) +{ + struct stat filestat; + + int fd = open (filename, O_RDONLY); + if (fd < 0) + return 0; + if(fstat(fd, &filestat)) + return 0; + close (fd); + return filestat.st_mtime; +} + +int check_wrapped_time(WRAP_PLUGIN *p_plugin) +{ + info("Checking wrapped plugin %s timestamp...", p_plugin->file.name); + + time_t file = get_plugin_time(p_plugin->file.name); + time_t wrap = get_plugin_time(p_plugin->file.name_wrapped); + + info(" file = %d, wrap = %d", file, wrap); + + return(file && wrap && file <= wrap); +} + + /********************************************************************************** Directory processing callback - plugins removing ********************************************************************************* @@ -581,7 +607,7 @@ int check_installed_plugin(WRAP_PLUGIN * // should be wrapped if(plug) { if(wrap_ok && !link_ok) { // is wrapped? - return(wrap); + ret = wrap; } else { ret = (wrap_ok && link_ok); } @@ -595,7 +621,12 @@ int check_installed_plugin(WRAP_PLUGIN * ret = link_ok; } } - + + // Check timestamp of original and wrapped plugin + if(ret && wrap && wrap_current) { + ret = check_wrapped_time(p_plugin); + } + if(!ret) { info("FAIL: %s",p_plugin->file.name); }