diff options
Diffstat (limited to 'src/validate_value.ml')
| -rw-r--r-- | src/validate_value.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/validate_value.ml b/src/validate_value.ml index 05d62b1..fd9f3d9 100644 --- a/src/validate_value.ml +++ b/src/validate_value.ml @@ -12,14 +12,16 @@ let rec validate_value buf value_constraint value = | Group l -> List.for_all (fun c -> validate_value buf c value) l | Regex s -> - (try let _ = Pcre.exec ~pat:(Printf.sprintf "^%s$" s) value in true + (try let _ = Pcre2.exec ~pat:(Printf.sprintf "^%s$" s) value in true with Not_found -> false) | Exec c -> (* XXX: Unix.open_process_in is "shelling out", which is a bad idea on multiple levels, especially when the input comes directly from the user... We should do something about it. *) - let chan = Unix.open_process_in (Printf.sprintf "%s \'%s\' 2>&1" c value) in + let cmd = Printf.sprintf "%s \'%s\' 2>&1" c value in + let () = Printf.printf "COMMAND: %s" cmd in + let chan = Unix.open_process_in cmd in let out = try CCIO.read_all chan with _ -> "" in let result = Unix.close_process_in chan in match result with |
