File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/murfey/instrument_server Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -335,6 +335,14 @@ def upload_gain_reference(
335335 headers = {"Authorization" : f"Bearer { tokens [session_id ]} " },
336336 ).json ()
337337
338+ # Validate that file passed is from the gain reference directory
339+ gain_ref_dir = machine_config .get ("gain_reference_directory" , "" )
340+ if not safe_gain_path .startswith (gain_ref_dir ):
341+ raise ValueError (
342+ "Gain reference file does not originate from the gain reference directory "
343+ f"{ gain_ref_dir !r} "
344+ )
345+
338346 # Return the rsync URL if set, otherwise assume you are syncing via Murfey
339347 rsync_url = urlparse (str (machine_config .get ("rsync_url" , _get_murfey_url ())))
340348 rsync_module = machine_config .get ("rsync_module" , "data" )
You can’t perform that action at this time.
0 commit comments