From: Jean-Marc Pigeon Date: Thu, 13 Nov 2025 14:52:00 +0000 (-0500) Subject: Adjusted spec file X-Git-Tag: tag-0.17~49 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=05ad1fae96fff37b9e368a9b759c2376c141e915;p=jmp%2Fmailleur Adjusted spec file --- diff --git a/lib/lvleml.c b/lib/lvleml.c index 3a29fb7..a5296ee 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -1067,7 +1067,7 @@ return remotegood; */ /********************************************************/ /* */ -/* Procedure to check if helo or ehlo paratmeter */ +/* Procedure to check if helo or ehlo parameter */ /* is a correct one */ /* */ /********************************************************/ @@ -1086,62 +1086,102 @@ proceed=true; while (proceed==true) { //(void) rou_alert(0,"JMPDBG %s phase='%d' parm=<%s>",OPEP,phase,parameter); switch (phase) { - case 0 : //checking if we have a parameter - if ((parameter==(char *)0)||(strlen(parameter)==0)) { - (void) rou_alert(0,"%s sesid=<%s> fqdn is missing!", - OPEP,contact->mainsesid); - phase=999; //no parameter - } - break; - case 1 : //do we have only good character - if (strpbrk(parameter,"@(&$")!=(char *)0) { - (void) rou_alert(0,"%s sesid=<%s> fqdn <%s> wrong contents", - OPEP,contact->mainsesid,parameter); - phase=999; //bad parameter - } - break; - case 2 : //do we start with a dot or 2 dot + case 0 : //do we start with a dot or 2 dot if ((parameter[0]=='.')||(strstr(parameter,"..")!=(char *)0)) { (void) rou_alert(0,"%s sesid=<%s> fqdn <%s> not a good domain", OPEP,contact->mainsesid,parameter); phase=999; //bad parameter } break; - case 3 : //could it be localhost or localdomain + case 1 : //could it be localhost or localdomain if (strcasecmp(parameter,"localhost.localdomain")==0) { (void) rou_alert(0,"%s sesid=<%s> fqdn <%s> local!", OPEP,contact->mainsesid,parameter); phase=999; } break; - case 4 : //check if it only a hostname + case 2 : //check if it only a hostname if (strstr(parameter,".")==(char *)0) { (void) rou_alert(0,"%s sesid=<%s> fqdn <%s> is an host name!", OPEP,contact->mainsesid,parameter); phase=999; } break; - case 5 : //could it be an IP + case 3 : //could it be an IP if (parameter[0]=='[') { (void) rou_alert(0,"%s sesid=<%s> fqdn <%s> could be an ip", OPEP,contact->mainsesid,parameter); phase=999; //bad parameter } break; - case 6 : //is is an ip + case 4 : //is is an ip if (strlen(parameter)==strspn(parameter,".0123456789")) { (void) rou_alert(0,"%s sesid=<%s> fqdn <%s> is an ip", OPEP,contact->mainsesid,parameter); phase=999; //bad parameter } break; - case 7 : //seems to be a good fqdn + case 5 : //seems to be a good fqdn char *ptr; ptr=contact->fqdn; //parameter could be the SAME! contact->fqdn=strdup(parameter); ptr=rou_freestr(ptr); - done=true; + break; + case 6 : //check if we can resolve fqdn + break; + case 7 : //is resolved IP is the same as remote + break; + default : //SAFE guard + proceed=false; + break; + } + phase++; + } +return done; +#undef OPEP +} +/* +^L +*/ +/********************************************************/ +/* */ +/* Procedure to check if helo or ehlo paatmeter */ +/* is an acceptable one */ +/* */ +/********************************************************/ +static _Bool isgoodhelo(CONTYP *contact,char *parameter) + +{ +#define OPEP "lvleml.c:isgoodhelo" + +_Bool done; +int phase; +_Bool proceed; + +done=false; +phase=0; +proceed=true; +while (proceed==true) { + //(void) rou_alert(0,"JMPDBG %s phase='%d' parm=<%s>",OPEP,phase,parameter); + switch (phase) { + case 0 : //checking if we have a parameter + if ((parameter==(char *)0)||(strlen(parameter)==0)) { + (void) rou_alert(0,"%s sesid=<%s> fqdn is missing!", + OPEP,contact->mainsesid); + phase=999; //no parameter + } + break; + case 1 : //do we have only good character + if (strpbrk(parameter,"@(&$")!=(char *)0) { + (void) rou_alert(0,"%s sesid=<%s> fqdn <%s> wrong contents", + OPEP,contact->mainsesid,parameter); + phase=999; //bad parameter + } + break; + case 2 : //ehlo is acceptable, lets check if fqdn + done=true; + contact->isgoodfqdn=isgoodfqdn(contact,parameter); break; default : //SAFE guard proceed=false; @@ -1448,7 +1488,7 @@ static _Bool dohelo(CONTYP *contact,char *parameter) _Bool done; -if ((done=isgoodfqdn(contact,parameter))==false) { +if ((done=isgoodhelo(contact,parameter))==false) { (void) eml_transmit(contact,true,"%d 5.5.4 %s.",BADPAR,DETAIL); (void) setterminator(contact,"HELO parameter missing"); contact->credit-=2; @@ -1500,7 +1540,7 @@ while (proceed==true) { //(void) rou_alert(0,"JMPDBG %s phase='%d'",OPEP,phase); switch (phase) { case 0 : //Do we have a parameter - if ((done=isgoodfqdn(contact,parameter))==false) { + if ((done=isgoodhelo(contact,parameter))==false) { (void) eml_transmit(contact,true,"%d 5.5.4 %s.",BADPAR,DETAIL); (void) setterminator(contact,"EHLO parameter missing"); contact->credit-=2; //penalty diff --git a/lib/lvleml.h b/lib/lvleml.h index 289e3f5..9e0f5f1 100644 --- a/lib/lvleml.h +++ b/lib/lvleml.h @@ -19,6 +19,7 @@ typedef struct { SOCPTR *socptr; //established contact socket context SQLPTR *sqlptr; //established contact database access int delay; //communication max delay + _Bool isgoodfqdn; //Remoted presented a valid fqdn char *fqdn; //fully qualified domain from peer int credit; //Credits to be added or removed from contact RELTYP privilege; //onnection privilege diff --git a/mailleur.spec.in b/mailleur.spec.in index 33664b0..f8b2265 100644 --- a/mailleur.spec.in +++ b/mailleur.spec.in @@ -77,16 +77,17 @@ search about email exchange within time and transaction context. %attr(0750,%{name},mail) %dir %{spooldir}/%{name}/mails %attr(0750,%{name},apache) %dir %{wwwdir}/%{name}/ %{wwwdir}/%{name}/index.php -%attr(0750,%{name},apache) %{wwwdir}/%{name}/lvlmai.php %attr(0750,%{name},apache) %{wwwdir}/%{name}/devsql.php %attr(0750,%{name},apache) %{wwwdir}/%{name}/gesdis.php %attr(0750,%{name},apache) %{wwwdir}/%{name}/gessql.php %attr(0750,%{name},apache) %{wwwdir}/%{name}/lvllog.php +%attr(0750,%{name},apache) %{wwwdir}/%{name}/lvlmai.php +%attr(0750,%{name},apache) %{wwwdir}/%{name}/lvlrmt.php %attr(0750,%{name},apache) %{wwwdir}/%{name}/lvlusr.php %attr(0750,%{name},apache) %{wwwdir}/%{name}/release.php +%attr(0750,%{name},apache) %{wwwdir}/%{name}/subrou.php %attr(0750,%{name},apache) %{wwwdir}/%{name}/unienv.php %attr(0750,%{name},apache) %{wwwdir}/%{name}/unilng.php -%attr(0750,%{name},apache) %{wwwdir}/%{name}/subrou.php %attr(0640,%{name},apache) %{wwwdir}/%{name}/reg-icons/*.gif %attr(0640,%{name},apache) %{wwwdir}/%{name}/reg-icons/*.png %attr(0644,root,root) %{_datadir}/%{name}/sql/%{name}.sql