Unix & Linux Asked on December 31, 2021
Permission denied shows up when I try to open some attachment in Thunderbird. Yet, it doesn’t look as a Thunderbird bug, because when I strace
the process I see it issues the correct call. Yet it fails.
11545 execve("/usr/local/bin/libreoffice6.4", ["libreoffice6.4", "--writer", "file:///tmp/user/1000/via%20alla%20quite%2012%20Laigueglia"], ["SHELL=/bin/bash", "WINDOWID=18874383", "QT_ACCESSIBILITY=1", "XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0", "XTERM_VERSION=XTerm(344)", ... ]) = -1 EACCES (Permission denied)
Permissions are good, I tested with namei
and getfacl
. Then I copied the execve
instruction from strace -v -s 1024
to a C file and compiled it. In that case, it succeeds. Every time I run it by mouse clicks in Thunderbird it fails, every time I run the following test program it succeeds.
#include <unistd.h>
#include <stdio.h>
int main()
{
char *path="/usr/local/bin/libreoffice6.4";
char *argv[] =
{
"libreoffice6.4",
"--writer",
"file:///tmp/user/1000/via%20alla%20quite%2012%20Laigueglia",
NULL
};
char *envp[] =
{
"SHELL=/bin/bash",
"WINDOWID=18874383",
"QT_ACCESSIBILITY=1",
"XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0",
"XTERM_VERSION=XTerm(344)",
// ...
NULL
};
int rtc = execve(path, argv, envp);
perror("execve failed");
return rtc;
}
Note that Thunderbird can open a number of attachments correctly. Only LibreOffice and a custom shell program fail, thus far. Both are not part of the stock distribution — Devuan Beowulf — but this cannot explain the failure, can it?
There is no point reporting the bug to Thunderbird, because it is an old 68 version, and the bug may be fixed already or perhaps will disappear spontaneously on the next install. Certainly, I cannot report it if I have no clue of what the heck goes wrong. I don’t understand how come the access is alternately denied and granted.
trace=setuid,setfsuid,setreuid
.x
bit is on on each part of the relevant paths.Edit: The man page for execve
lists four possible reasons for EACCESS
:
None of those appears to be true. I complicated the straw man program adding dummy thread_creation
s and fork
s to mimic Thunderbird behavior. In particular, running this executable:
-rwxr-xr-x 1 root root 14328 Nov 6 2019 /usr/lib/x86_64-linux-gnu/glib-2.0/gio-launch-desktop
Note that it is part of libglib2.0-0:amd64
, not Thunderbird.
Still, I cannot reproduce the failure as experienced by Thunderbird.
Edit2: Submitted the case against libc6 to both Devuan bug 497 and Debian bug 966343
This is a theory, not a conclusive answer...
There are other reasons for Permission Denied. The one that springs to mind is AppArmor. I've not checked to see if this affects Thunderbird on your distro. It should write to the syslog when blocking a program's access so check /var/log/syslog
.
This would neatly explain your issue because AppArmor is configured per program and by default will let unknown programs do whatever they like. Thunderbird might have an AppArmor profile preventing it from executing other programs (OpenOffice). Your own test program would not have such a profile.
Answered by Philip Couling on December 31, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP