Skip to content

Commit 952c3f1

Browse files
committed
fix: set group-write permission on files after chown in multi-user mode
_chown() transferred file ownership to the provisioned user but didn't set group-write permission, leaving files at 644. The server process (a group member) could create new files but couldn't overwrite them on subsequent saves, returning PermissionError. Now sets chmod g+w after chown, matching the 2770 treatment already applied to directories. Fixes #93
1 parent b18c151 commit 952c3f1

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [0.11.29] - 2026-03-24
8+
9+
### Fixed
10+
11+
- 🔒 **File save fails in multi-user mode**`_chown()` transferred file ownership to the provisioned user but didn't set group-write permission, leaving files at `644`. The server process (a group member) could create new files but couldn't overwrite them on subsequent saves, returning `PermissionError`. Now sets `chmod g+w` after `chown`, matching the `2770` treatment already applied to directories. ([#93](https://github.com/open-webui/open-terminal/issues/93))
12+
713
## [0.11.28] - 2026-03-24
814

915
### Added

open_terminal/utils/fs.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,23 @@ def _check_path(self, path: str) -> None:
9090
)
9191

9292
async def _chown(self, path: str) -> None:
93-
"""Fix ownership of *path* to the provisioned user."""
93+
"""Fix ownership of *path* to the provisioned user.
94+
95+
Also sets group-write permission so the server process (which is
96+
in the provisioned user's group) can overwrite the file on
97+
subsequent writes.
98+
"""
9499
if self.username:
95100
await asyncio.to_thread(
96101
subprocess.run,
97102
["sudo", "chown", f"{self.username}:{self.username}", path],
98103
check=True, capture_output=True,
99104
)
105+
await asyncio.to_thread(
106+
subprocess.run,
107+
["sudo", "chmod", "g+w", path],
108+
check=True, capture_output=True,
109+
)
100110

101111
async def _ensure_parents(self, path: str) -> None:
102112
"""Create parent directories for *path* with correct permissions.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "open-terminal"
3-
version = "0.11.28"
3+
version = "0.11.29"
44
description = "A remote terminal API."
55
readme = "README.md"
66
authors = [

0 commit comments

Comments
 (0)