id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	branch_state	votes
4382	MC editor running under root cannot save files not belonging to the root user in /tmp	birdie		"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."	defect	new	major	Future Releases	mc-core	4.8.28						no branch	
