On Sep 24 11:59:21, [email protected] wrote:
> On Thu, Sep 24, 2020 at 11:44:42AM +0200, Jan Stary wrote:
> > This is current/amd64 after a sysupgrade and pkg_add -u.
> > Firefox complains that it cannot store its own configuration
> > and settings into HOME:
> >
> > ** (firefox:19344): WARNING **: 11:38:24.795: Cannot set application as
> > default for URI scheme (http): Can’t create user MIME configuration
> > folder /home/hans/.config: No such file or directory
> >
> > ** (firefox:19344): WARNING **: 11:38:24.798: Cannot set application as
> > default for extension (htm): Can’t create user MIME configuration folder
> > /home/hans/.local/share/mime/packages: Permission denied
> >
> > The $HOME/.config directory does exist and is writable by the user.
> > The $HOME/.local/share/ directory does exist and is writable by the user.
> >
> > Is this because of the pledge/unveil restrictions?
>
> yes, that's supposed to be handled by the unveil.main lines. I never
> fully understood this part of the integration, but jcs@ might know
> better. Use ktrace to check what paths are opened, and maybe try
> adding/amending some of the lines.
As an example, I set
$XDG_CACHE_HOME rwc
$XDG_CONFIG_HOME rwc
$XDG_DATA_HOME rwc
in /etx/firefox/unveil.main and started ktrace firefox.
Here is a snipet from the kdump:
25434 firefox CALL mkdir(0x679bebc0c40,0700<S_IRUSR|S_IWUSR|S_IXUSR>)
25434 firefox NAMI "/home/hans/.local/share/mime/packages"
25434 firefox RET mkdir -1 errno 2 No such file or directory
25434 firefox CALL access(0x679bebc0480,0<F_OK>)
25434 firefox NAMI "/home"
25434 firefox RET access -1 errno 2 No such file or directory
25434 firefox CALL mkdir(0x679bebc0480,0700<S_IRUSR|S_IWUSR|S_IXUSR>)
25434 firefox NAMI "/home"
25434 firefox RET mkdir -1 errno 2 No such file or directory
25434 firefox CALL access(0x679bebc0480,0<F_OK>)
25434 firefox NAMI "/home/hans"
25434 firefox RET access -1 errno 2 No such file or directory
25434 firefox CALL mkdir(0x679bebc0480,0700<S_IRUSR|S_IWUSR|S_IXUSR>)
25434 firefox NAMI "/home/hans"
25434 firefox RET mkdir -1 errno 2 No such file or directory
25434 firefox CALL access(0x679bebc0480,0<F_OK>)
25434 firefox NAMI "/home/hans/.local"
25434 firefox RET access -1 errno 2 No such file or directory
25434 firefox CALL mkdir(0x679bebc0480,0700<S_IRUSR|S_IWUSR|S_IXUSR>)
25434 firefox NAMI "/home/hans/.local"
25434 firefox RET mkdir -1 errno 2 No such file or directory
25434 firefox CALL access(0x679bebc0480,0<F_OK>)
25434 firefox NAMI "/home/hans/.local/share"
25434 firefox RET access -1 errno 2 No such file or directory
25434 firefox CALL mkdir(0x679bebc0480,0700<S_IRUSR|S_IWUSR|S_IXUSR>)
25434 firefox NAMI "/home/hans/.local/share"
25434 firefox RET mkdir -1 errno 2 No such file or directory
25434 firefox CALL access(0x679bebc0480,0<F_OK>)
25434 firefox NAMI "/home/hans/.local/share/mime"
25434 firefox RET access -1 errno 2 No such file or directory
25434 firefox CALL mkdir(0x679bebc0480,0700<S_IRUSR|S_IWUSR|S_IXUSR>)
25434 firefox NAMI "/home/hans/.local/share/mime"
25434 firefox RET mkdir -1 errno 13 Permission denied
25434 firefox CALL
mmap(0,0x2000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0)
25434 firefox RET mmap 7120981131264/0x679fb8d0000
25434 firefox CALL mprotect(0x679fb8d1000,0x1000,0<PROT_NONE>)
25434 firefox RET mprotect 0
25434 firefox CALL munmap(0x679fb8d0000,0x2000)
25434 firefox RET munmap 0
25434 firefox CALL fcntl(2,F_ISATTY)
25434 firefox RET fcntl 1
25434 firefox CALL getpid()
25434 firefox RET getpid 25434/0x635a
25434 firefox CALL write(2,0x7f7ffffefac0,0xe1)
25434 firefox GIO fd 2 wrote 225 bytes
"
** (firefox:25434): \^[[1;33mWARNING\^[[0m **:
\^[[34m20:36:57.061\^[[0m: Cannot set application as default for extension
(htm): Can\M-b\M^@\M^Yt create user MIME configuration fold\
er /home/hans/.local/share/mime/packages: Permission denied
"
All of the paths (and initial subpaths) mentioned above
do exist and are chmod 770
drwx------ 3 hans hans 512 Sep 21 22:53 .local//
drwx------ 5 hans hans 512 Sep 24 20:57 .local/share//
drwx------ 3 hans hans 512 Sep 24 20:42 .local/share/mime//
drwx------ 2 hans hans 512 Sep 24 20:42 .local/share/mime/packages//
I have no idea why it reports ENOENT/EACCESS.
I have move unveil.main away temporarily and started firefox
- no error messages, apparently it saved the info of firefox
being the default browser (which is what has benn popping up
on every start, but never remembered, presumably because of
these failed writes), and then moved unveil.main back,
and removed the three lines above. There are no such
messages since then.
Jan