SoarGroup / Soar

Soar, a general cognitive architecture for systems that exhibit intelligent behavior.
http://soar.eecs.umich.edu
Other
322 stars 70 forks source link

"cd" button/command in the debugger causes action at a distance #454

Open garfieldnate opened 1 month ago

garfieldnate commented 1 month ago

The cd command changes the Soar process's working directory (cwd) process-wide. If you have some complex application with lots of configuration files and you use relative file paths anywhere, a user connecting via the debugger and using the cd command for convenience in loading new source files will cause hardcoded relative paths to no longer resolve, which could easily hose the application.

I would recommend hardening SML applications against this by converting relative paths to absolute paths before the kernel is created so that no user can connect with the debugger and mess with the cwd value.

PLatCIC commented 1 month ago

I would add that the cd command as it now is causes the cwd to change not just for the "Soar process," but for the entire application that Soar is running in, including and main program that created the Soar kernel in the first place.

My opinion is that the cd command in the Soar Debugger should only affect that debugger and nothing else. The debugger can remember it and use if for Source commands, or opening log files, or whatever, but it should not affect other Soar Debuggers open in the same process or the main program of the process. Thus the cd command would only be local to a particular debugger. It seems that that is the case for the Source command.