Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 1 | $! TVERIFY.COM |
| 2 | $ |
Richard Levitte | 537c982 | 2011-03-19 10:58:14 +0000 | [diff] [blame] | 3 | $ __arch = "VAX" |
Richard Levitte | cc8cc9a | 2009-05-15 16:36:56 +0000 | [diff] [blame] | 4 | $ if f$getsyi("cpu") .ge. 128 then - |
Richard Levitte | 407a410 | 2010-01-27 09:18:42 +0000 | [diff] [blame] | 5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") |
Richard Levitte | 537c982 | 2011-03-19 10:58:14 +0000 | [diff] [blame] | 6 | $ if __arch .eqs. "" then __arch = "UNK" |
| 7 | $! |
| 8 | $ if (p1 .eqs. "64") then __arch = __arch+ "_64" |
Richard Levitte | cc8cc9a | 2009-05-15 16:36:56 +0000 | [diff] [blame] | 9 | $! |
| 10 | $ line_max = 255 ! Could be longer on modern non-VAX. |
| 11 | $ temp_file_name = "certs_"+ f$getjpi( "", "PID")+ ".tmp" |
Richard Levitte | 537c982 | 2011-03-19 10:58:14 +0000 | [diff] [blame] | 12 | $ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" |
Richard Levitte | cc8cc9a | 2009-05-15 16:36:56 +0000 | [diff] [blame] | 13 | $ cmd = "mcr ''exe_dir'openssl verify ""-CAfile"" ''temp_file_name'" |
| 14 | $ cmd_len = f$length( cmd) |
| 15 | $ pems = "[-.certs...]*.pem" |
| 16 | $! |
| 17 | $! Concatenate all the certificate files. |
| 18 | $! |
| 19 | $ copy /concatenate 'pems' 'temp_file_name' |
| 20 | $! |
| 21 | $! Loop through all the certificate files. |
| 22 | $! |
| 23 | $ args = "" |
Richard Levitte | 537c982 | 2011-03-19 10:58:14 +0000 | [diff] [blame] | 24 | $ old_f = "" |
Richard Levitte | cc8cc9a | 2009-05-15 16:36:56 +0000 | [diff] [blame] | 25 | $ loop_file: |
| 26 | $ f = f$search( pems) |
| 27 | $ if ((f .nes. "") .and. (f .nes. old_f)) |
| 28 | $ then |
| 29 | $ old_f = f |
| 30 | $! |
| 31 | $! If this file name would over-extend the command line, then |
| 32 | $! run the command now. |
| 33 | $! |
| 34 | $ if (cmd_len+ f$length( args)+ 1+ f$length( f) .gt. line_max) |
| 35 | $ then |
| 36 | $ if (args .eqs. "") then goto disaster |
| 37 | $ 'cmd''args' |
| 38 | $ args = "" |
| 39 | $ endif |
| 40 | $! Add the next file to the argument list. |
| 41 | $ args = args+ " "+ f |
| 42 | $ else |
| 43 | $! No more files in the list |
| 44 | $ goto loop_file_end |
| 45 | $ endif |
| 46 | $ goto loop_file |
| 47 | $ loop_file_end: |
| 48 | $! |
| 49 | $! Run the command for any left-over arguments. |
| 50 | $! |
| 51 | $ if (args .nes. "") |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 52 | $ then |
Richard Levitte | cc8cc9a | 2009-05-15 16:36:56 +0000 | [diff] [blame] | 53 | $ 'cmd''args' |
Ulf Möller | 7d7d2cb | 1999-05-13 11:37:32 +0000 | [diff] [blame] | 54 | $ endif |
Richard Levitte | cc8cc9a | 2009-05-15 16:36:56 +0000 | [diff] [blame] | 55 | $! |
| 56 | $! Delete the temporary file. |
| 57 | $! |
| 58 | $ if (f$search( "''temp_file_name';*") .nes. "") then - |
| 59 | delete 'temp_file_name';* |
| 60 | $! |
| 61 | $ exit |
| 62 | $! |
| 63 | $ disaster: |
| 64 | $ write sys$output " Command line too long. Doomed." |
| 65 | $! |