Bug 2229180
| Summary: | bzip2: When normal user compress a file with read only access he deletes the original file once compression is done | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Ehab <ehab.gassem> |
| Component: | bzip2 | Assignee: | Jakub Martisko <jamartis> |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 37 | CC: | jamartis, jchaloup, mjw |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-08-08 13:00:27 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Ehab
2023-08-04 14:58:32 UTC
Hello, file deletion is based on the parent directory permissions, not on the permissions of the file itself. Check "RESTRICTED DELETION FLAG OR STICKY BIT" section in chmod manpage to achieve the expected behavior. The /tmp directory usually has the sticky bit set (you can try the following with rm instead of bzip2): pwd && ll foo && bzip2 foo; ll foo /tmp -rw-r--r-- 1 root root 0 Aug 8 12:27 foo bzip2: I/O or other error, bailing out. Possible reason follows. bzip2: Operation not permitted Input file = foo, output file = foo.bz2 -rw-r--r-- 1 root root 0 Aug 8 12:27 foo On the other hand, directory without the sticky bit: pwd && ll foo && bzip2 foo && ll foo /tmp/test -rw-r--r-- 1 root root 0 Aug 8 12:46 foo ls: cannot access 'foo': No such file or directory |