Control: tag -1 confirmed upstream patch pending

On Sat, Jul 03, 2021 at 01:39:49PM +0200, xiscu wrote:
> Package: kakoune
> Version: 2020.01.16-2
> Severity: grave
> Justification: renders package unusable
> 
> Dear Maintainer,
> i'm currently unable to use kakoune as it gives a Permission denied error on 
> start
> (reinstalling the package hasn't solved the problem). The programm worked for 
> me,
> but currently i get:
> 
> Fatal error: unable to bind listen socket '/run/user/1000/kakoune/3781950': 
> Permission denied

Hi,

Yes, you did stumble into an upstream kakoune bug that is fixed in
a later upstream release that is not in Debian yet. The problem is that
Kakoune determines the name of a "user-specific directory to put some
stuff in" using your desktop environment's idea of a "user-specific
directory to put some stuff in", i.e. the XDG_RUNTIME_DIR environment
variable that is set upon the start of your GUI session. However, if you
*first* run `sudo kak something` (and you have told sudo to preserve
the environment variables!) or `su kak something` (and su, by default,
does preserve the environment variables), as the first thing you do
after restarting your computer, before running Kakoune as yourself,
then Kakoune will create its own directory while running as root, and
the directory will not be writable by your actual user account.
So if later you run it from your user account, it will not be able to
put stuff into that directory. This has happened with other tools, too,
and this is actually part of the reason why sudo does NOT preserve all
the environment variables by default. (Note: I'm not saying "don't use
su, use sudo!"; I'm just saying "su does some weird things by default,
sudo tries to prevent some problems by doing *other* weird things by
default, and it is not always the better choice, but it does help
prevent *some* problems")

I will test and adapt the patches for this problem, but in the meantime,
a short-term solution for your current situation is:

1. Make sure the problem is what I think it is:

   ls -ld /run/user/1000/kakoune

   ...and check that it is owned by "root", not by your user account

2. Change its owner to your user account:

   sudo chown "$(id -un):$(id -gn)" /run/user/1000/kakoune

   or, if using su:

   su -c "chown '$(id -un)' /run/user/1000/kakoune"

   ...of course, you can put your account's username and groupname
   directly instead of the "$(id -un):$(id -gn)" construct :)

That should fix it until the next time you restart your computer, since
Kakoune will see that the directory already exists and will not attempt
to recreate it. Even after you restart your computer, the problem will
only show up if you run Kakoune through su *before* running it from your
own user account.

...and I will indeed upload a bugfix version in the next couple of days.

Thanks for using Kakoune, and thanks for making its Debian package
better by reporting this problem!

G'luck,
Peter

-- 
Peter Pentchev  r...@ringlet.net r...@debian.org p...@storpool.com
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13

Attachment: signature.asc
Description: PGP signature

Reply via email to