os.chown() operations will fail for non-root users
Priority: High Component: fs.py Type: Bug
Description
Multiple locations in the code call os.chown() without error handling. On Unix systems, only root can change file ownership, so these operations will fail for normal users.
Locations
curateipsum/fs.py:225-227
curateipsum/fs.py:377
curateipsum/fs.py:460
Problem
Normal users running backups will encounter PermissionError when trying to preserve ownership of files, causing backup to fail.
High - Makes tool unusable for non-root users in current form.
# os.chown() operations will fail for non-root users
**Priority:** High
**Component:** fs.py
**Type:** Bug
## Description
Multiple locations in the code call `os.chown()` without error handling. On Unix systems, only root can change file ownership, so these operations will fail for normal users.
## Locations
- `curateipsum/fs.py:225-227`
- `curateipsum/fs.py:377`
- `curateipsum/fs.py:460`
## Problem
Normal users running backups will encounter `PermissionError` when trying to preserve ownership of files, causing backup to fail.
## Proposed Solution
Either:
1. Wrap in try/except and log warning
2. Check if running as root before attempting
3. Add a flag to skip ownership preservation
```python
try:
os.chown(dst_path, src_stat.st_uid, src_stat.st_gid)
except PermissionError:
_lg.debug("Cannot change ownership (not root): %s", dst_path)
```
## Impact
**High** - Makes tool unusable for non-root users in current form.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
os.chown() operations will fail for non-root users
Priority: High
Component: fs.py
Type: Bug
Description
Multiple locations in the code call
os.chown()without error handling. On Unix systems, only root can change file ownership, so these operations will fail for normal users.Locations
curateipsum/fs.py:225-227curateipsum/fs.py:377curateipsum/fs.py:460Problem
Normal users running backups will encounter
PermissionErrorwhen trying to preserve ownership of files, causing backup to fail.Proposed Solution
Either:
Impact
High - Makes tool unusable for non-root users in current form.