Ticket #4382 (new defect)
MC editor running under root cannot save files not belonging to the root user in /tmp
Reported by: | birdie | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | Future Releases |
Component: | mc-core | Version: | 4.8.28 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: |
Description
The error is "Save as: Cannot save file"
OS: Fedora 36 MC: 4.8.28 tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,seclabel)
Yet, in the root session:
echo 123 >> /tmp/testfile
works just fine, so this is a bug in MC.
strace shows
symlink("root@localhost.localdomain.481116", "/tmp/.#testfile") = 0 newfstatat(AT_FDCWD, "/tmp/testfile", {st_mode=S_IFREG|0755, st_size=8341, ...}, 0) = 0 chown("/tmp/testfile", 1000, 1000) = 0 chmod("/tmp/testfile", 0100755) = 0 openat(AT_FDCWD, "/tmp/testfile", O_WRONLY|O_CREAT|O_TRUNC, 0100755) = -1 EACCES (Permission denied)
In other directories, i.e. real mounted filesystems, this bug doesn't occur.
Change History
comment:2 Changed 2 years ago by birdie
I'm using Fedora Linux 36 with default settings.
This warrants an investigation and fix. This is not some odd obscure distro, Fedora is one of the most important Linux distros out there.
Note: See
TracTickets for help on using
tickets.
the problem is presumably not tmpfs, but the fact that the directory is sticky.
from the openat() manual:
so presumably you have some security setting enabled which makes root not all-powerful.