Wrong stat object used when updating file permissions
Priority: High Component: fs.py Type: Bug
Description
When updating permissions in the rsync() function, the code uses dst_stat.st_mode instead of src_stat.st_mode, which is a logic error.
Location
curateipsum/fs.py:369-372
Current Code
ifsrc_stat.st_mode!=dst_stat.st_mode:_lg.debug("Rsync, updating permissions: %s",rel_path)os.chmod(dst_entry.path,dst_stat.st_mode)# Should be src_stat!yieldrel_path,Actions.UPDATE_PERM,""
Problem
The code compares source and destination modes, determines they're different, but then sets the destination to... the destination's current mode. This is a no-op.
High - Permissions are never updated correctly, defeating the purpose of the rsync functionality.
# Wrong stat object used when updating file permissions
**Priority:** High
**Component:** fs.py
**Type:** Bug
## Description
When updating permissions in the `rsync()` function, the code uses `dst_stat.st_mode` instead of `src_stat.st_mode`, which is a logic error.
## Location
`curateipsum/fs.py:369-372`
## Current Code
```python
if src_stat.st_mode != dst_stat.st_mode:
_lg.debug("Rsync, updating permissions: %s", rel_path)
os.chmod(dst_entry.path, dst_stat.st_mode) # Should be src_stat!
yield rel_path, Actions.UPDATE_PERM, ""
```
## Problem
The code compares source and destination modes, determines they're different, but then sets the destination to... the destination's current mode. This is a no-op.
## Proposed Solution
```python
if src_stat.st_mode != dst_stat.st_mode:
_lg.debug("Rsync, updating permissions: %s", rel_path)
os.chmod(dst_entry.path, src_stat.st_mode)
yield rel_path, Actions.UPDATE_PERM, ""
```
## Impact
**High** - Permissions are never updated correctly, defeating the purpose of the rsync functionality.
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.
Wrong stat object used when updating file permissions
Priority: High
Component: fs.py
Type: Bug
Description
When updating permissions in the
rsync()function, the code usesdst_stat.st_modeinstead ofsrc_stat.st_mode, which is a logic error.Location
curateipsum/fs.py:369-372Current Code
Problem
The code compares source and destination modes, determines they're different, but then sets the destination to... the destination's current mode. This is a no-op.
Proposed Solution
Impact
High - Permissions are never updated correctly, defeating the purpose of the rsync functionality.