diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-09-10 12:10:22 -0500 |
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2025-09-10 12:48:27 -0500 |
| commit | 19d7e20f5cb7786f87e04a334e19415f18af6562 (patch) | |
| tree | 57a4409dc5282aa90073a891db6cc199962b0461 /src | |
| parent | 895f52e54fe32ba5c98d8bb69c5c8c67ddaad0fc (diff) | |
| download | vyconf-19d7e20f5cb7786f87e04a334e19415f18af6562.tar.gz vyconf-19d7e20f5cb7786f87e04a334e19415f18af6562.zip | |
T7737: use pid for lock ref
The session pid as the lock data makes more sense then the original
'user' field. As we will have use for a session field 'user' elsewhere,
make the change now.
Diffstat (limited to 'src')
| -rw-r--r-- | src/vyconfd.ml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vyconfd.ml b/src/vyconfd.ml index d765ed8..51014c7 100644 --- a/src/vyconfd.ml +++ b/src/vyconfd.ml @@ -29,9 +29,9 @@ let legacy_config_path = ref false (* Global data *) let sessions : (string, Session.session_data) Hashtbl.t = Hashtbl.create 10 -let commit_lock : string option ref = ref None +let commit_lock : int32 option ref = ref None -let conf_mode_lock : string option ref = ref None +let conf_mode_lock : int32 option ref = ref None (* Command line arguments *) let args = [ @@ -94,14 +94,14 @@ let enter_conf_mode req token = let lock = !conf_mode_lock in let session = Hashtbl.find sessions token in match lock with - | Some user -> + | Some pid -> if req.override_exclusive then aux token session else {response_tmpl with status=Configuration_locked; - error=Some (Printf.sprintf "Configuration was locked by %s" user)} + error=Some (Printf.sprintf "Configuration was locked by %ld" pid)} | None -> - if req.exclusive then (conf_mode_lock := Some session.user; aux token session) + if req.exclusive then (conf_mode_lock := Some session.client_pid; aux token session) else aux token session let exit_conf_mode world token = |
