Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux Keyboard Permission Issue "Fix It" Button Doesn't Work #603

Closed
rjhilgefort opened this issue Nov 11, 2020 · 7 comments
Closed

Linux Keyboard Permission Issue "Fix It" Button Doesn't Work #603

rjhilgefort opened this issue Nov 11, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@rjhilgefort
Copy link

Describe the bug
On the development build, the "Fix It" button gave me an error that looks like permission issues.

I was chatting with @obra on Discord and that conversation can be seen here:
https://discord.com/channels/492408953041321984/638783537734090813/775867293196484609

To Reproduce
Steps to reproduce the behavior:

  1. Download development build
  2. Click on "Fix It" related to udev rules

Expected behavior
I suppose I expected it to resolve the permission issue it claimed to say it would fix.

Screenshots
image
image

Desktop (please complete the following information):

  • OS: Arch 5.9.6
  • Chrysalis Version: 0.7.9+286

Additional context
N/A

@rjhilgefort rjhilgefort added the bug Something isn't working label Nov 11, 2020
@algernon
Copy link
Collaborator

I guess Arch is not using udev and/or systemd?

@obra
Copy link
Member

obra commented Nov 11, 2020 via email

@algernon
Copy link
Collaborator

We can, yes. We can't (easily) detect the exact error, but we can direct them to a page when we encounter any error. Apart from authentication, we can detect that, and we shouldn't direct them anywhere in that case.

@kurzkopfgleitbeutler
Copy link

I get the same issue with Chrysalis-0.8.0.amd64.AppImage on Ubuntu 20.04.1 LTS.

cd "/home/foo/chrysalis";
"/usr/bin/pkexec" --disable-internal-agent /bin/bash -c "echo SUDOPROMPT;
(mv /etc/udev/rules.d/60-kaleidoscope.rules /etc/udev/rules.d/60-kaleidoscope.rules.orig || true)
&& cp /tmp/.mount_ChrysaxM57yH/resources/static/udev/60-kaleidoscope.rules /etc/udev/rules.d/
&& udevadm control --reload-rules
&& udevadm trigger /dev/ttyACM0"

mv: cannot stat '/etc/udev/rules.d/60-kaleidoscope.rules': No such file or directory
cp: cannot stat '/tmp/.mount_ChrysaxM57yH/resources/static/udev/60-kaleidoscope.rules': Permission denied

From the error, I'd guess it has to do with how permissions in AppImage are handled. Maybe (n.b. I don't know about this kind of stuff) it has to do with chromium sandboxing or preserving ownership in the AppImage, does this have to do with it?
laurent22/joplin#2246 (comment)

@hatxet
Copy link

hatxet commented Jan 24, 2021

@kurzkopfgleitbeutler I get the same error as you, also on Ubuntu 20.04 LTS. That temporary mount folder in /tmp sure doesn't look right.

root@localhost# ls -la /tmp/                                                                                                                                                   
d?????????  ? ?     ?          ?            ?  .mount_ChrysatuM5zq/  

root@localhost# ls -l /tmp/.mount_ChrysatuM5zq                                                                                                                                                                      
ls: cannot access '/tmp/.mount_ChrysatuM5zq': Permission denied

@algernon
Copy link
Collaborator

I think I figured out what the problem is. It looks like the temporary mount folder is set up so that it is only accessible to the process that created it - which makes sense, and @kurzkopfgleitbeutler's assumption seems to be correct. This means that we can't copy files out of it after we elevated our privileges to root. As such, the solution is most likely to copy the file without elevating privileges to a place where we can copy (or rather, move) from as root. Therefore, we need to copy the udev rules file to a temporary place first, without elevated privileges, and then move it from there after, as root.

@algernon
Copy link
Collaborator

Reproduced, fix tested & pushed to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants