@neoline/hostbridge 1.4.2 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neoline/hostbridge",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "HostBridge MCP server for persistent allowlisted SSH and shell sessions.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hostbridge"
7
- version = "1.4.2"
7
+ version = "1.4.3"
8
8
  description = "HostBridge MCP server for persistent allowlisted SSH and shell sessions."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -255,12 +255,14 @@ class HostBridgeSFTPServer(asyncssh.SFTPServer):
255
255
  self._checked_run(f"mv -- {shlex.quote(self._path(oldpath))} {shlex.quote(self._path(newpath))}")
256
256
 
257
257
  def realpath(self, path: bytes) -> bytes:
258
- command = (
259
- "python3 -c "
260
- + shlex.quote("import os,sys; print(os.path.realpath(sys.argv[1]))")
261
- + " "
262
- + shlex.quote(self._path(path))
258
+ script = (
259
+ "import os,sys; "
260
+ "path=sys.argv[1]; "
261
+ "parent=os.path.dirname(path) or '/'; "
262
+ "base=os.path.basename(path); "
263
+ "print(os.path.join(os.path.realpath(parent), base) if not os.path.exists(path) else os.path.realpath(path))"
263
264
  )
265
+ command = "python3 -c " + shlex.quote(script) + " " + shlex.quote(self._path(path))
264
266
  result = self._checked_run(command)
265
267
  return (result.output.strip() or self._path(path)).encode("utf-8")
266
268