bneradt opened a new pull request, #12274:
URL: https://github.com/apache/trafficserver/pull/12274

   For directory changes, we compared the event's name (which indicates which 
file in the directory changed) against the config's basename but limited the 
check to basename_len via strncmp. Unwittingly, though, if event->name was more 
bytes than basename_len, we could incorrectly match on the substring.
   
   For instance, with a config like this:
   
   /acme /tmp/sb/healthchecks/acme text/plain 200 404 /acme-ssl 
/tmp/sb/healthchecks/acme-ssl text/plain 200 404
   
   An events for acme-ssl changes would accidentally match for acme, because 
acme's basename_len is 4, while event->name is acme-ssl, thus strncmp on the 
event would incorrectly indicate a match because the first four bytes were the 
same for each.
   
   This extracts event/config file matching to a function so it is easier to 
understand and ensures that event->name and basename are the same length to 
avoid the accidental match.
   
   This also adds an autest for healthchecks which reproduces the above issue 
and verifies basic file event processing functionality.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to