--- rpl/src/rpl.c 2011/11/24 14:24:49 1.97 +++ rpl/src/rpl.c 2011/11/30 09:28:38 1.101 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.1.4 + RPL/2 (R) version 4.1.5 Copyright (C) 1989-2011 Dr. BERTRAND Joël This file is part of RPL/2. @@ -31,7 +31,8 @@ */ int -rplinit(int argc, char *argv[], unsigned char ***resultats, char *rpl_home) +rplinit(int argc, char *argv[], char *envp[], + unsigned char ***resultats, char *rpl_home) { # include "copyright-conv.h" # include "licence-conv.h" @@ -182,6 +183,10 @@ rplinit(int argc, char *argv[], unsigned (*s_etat_processus).erreur_systeme = d_es; (*s_etat_processus).erreur_execution = d_ex; + (*s_etat_processus).argc = argc; + (*s_etat_processus).argv = argv; + (*s_etat_processus).envp = envp; + (*s_etat_processus).rpl_home = rpl_home; pthread_mutexattr_init(&attributs_mutex); @@ -2757,16 +2762,6 @@ rplinit(int argc, char *argv[], unsigned l_element_courant = (*s_etat_processus).liste_mutexes; while(l_element_courant != NULL) { - pthread_mutex_trylock(&((*((struct_mutex *) - (*(*((struct_liste_chainee *) - l_element_courant)).donnee).objet)).mutex)); - pthread_mutex_unlock(&((*((struct_mutex *) - (*(*((struct_liste_chainee *) - l_element_courant)).donnee).objet)).mutex)); - pthread_mutex_destroy(&((*((struct_mutex *) - (*(*((struct_liste_chainee *) - l_element_courant)).donnee).objet)).mutex)); - liberation(s_etat_processus, (*((struct_liste_chainee *) l_element_courant)).donnee); @@ -3650,6 +3645,57 @@ informations(struct_processus *s_etat_pr } +logical1 +controle_integrite(struct_processus *s_etat_processus, + unsigned char *executable_candidat, unsigned char *executable) +{ + unsigned char *md5; + unsigned char *sha1; + + if (strcmp(executable, "rplpp") == 0) + { + md5 = rplpp_md5; + sha1 = rplpp_sha1; + } + else if (strcmp(executable, "rplfile") == 0) + { + md5 = rplfile_md5; + sha1 = rplfile_sha1; + } + else if (strcmp(executable, "rpliconv") == 0) + { + md5 = rpliconv_md5; + sha1 = rpliconv_sha1; + } + else if (strcmp(executable, "rplawk") == 0) + { + md5 = rplawk_md5; + sha1 = rplawk_sha1; + } + else if (strcmp(executable, "rplconvert") == 0) + { + md5 = rplconvert_md5; + sha1 = rplconvert_sha1; + } + else + { + return(d_faux); + } + + if (controle(s_etat_processus, executable_candidat, "md5", md5) != d_vrai) + { + return(d_faux); + } + + if (controle(s_etat_processus, executable_candidat, "sha1", sha1) != d_vrai) + { + return(d_faux); + } + + return(d_vrai); +} + + unsigned char * date_compilation() {