Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/10/2022 in all areas

  1. Don't hard-code the .log then. You have access to the full file name including the extension in your script. You use it to generate your $log_type variable. The extension you need can similarly be extracted and used in the script rather than a hard-coded value. You have: $file = $_POST['file']; $exploded = explode('.', basename($file)); $log_type = $exploded[0]; I'm assuming that $_POST['file'] is the full name shown in the image, ie dhcpd.leases.20220708-030000.tar.gz. Given that, then when you explode it on the dots, you get an array with the different components. You're taking $exploded[0] which is the first part (dhcpd). $exploded[1] would be the second part, the extension you want (leases). Use them both to assemble your command later. $file = $_POST['file']; $exploded = explode('.', basename($file)); $log_type = $exploded[0]; $log_extension = $exploded[1]; //... exec('openssl ts -verify -data /tmp/' . $log_type . '.' . $log_extension . ' -in /tmp/' . $log_type . '.' . $log_extension . '.der -token_in -CAfile /CA/cacert.pem -untrusted /CA/tsacert.pem', $result);
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.