Skip to content
This repository has been archived by the owner on May 15, 2022. It is now read-only.

Doesn't work with Nautilus 3.24 #27

Closed
ceyhunn opened this issue Jun 17, 2017 · 12 comments
Closed

Doesn't work with Nautilus 3.24 #27

ceyhunn opened this issue Jun 17, 2017 · 12 comments
Assignees
Labels
Milestone

Comments

@ceyhunn
Copy link

ceyhunn commented Jun 17, 2017

No description provided.

@brunonova
Copy link
Owner

I just tried it with the current daily live ISO of Ubuntu 17.10 with Nautilus 3.14.1, and it worked fine.

Have you restarted Nautilus after installing the extension? (nautilus -q)

@ceyhunn
Copy link
Author

ceyhunn commented Jun 18, 2017

Sorry for that, I had to give more info. With gnome-xorg, it is OK. Problem with Gnome Wayland, it gives following error:

Can not open display :0

@brunonova
Copy link
Owner

Oh, Wayland. I never used Wayland, so I know little about it.

Apparently it isn't possible to run graphical applications under a different user (like root) under Wayland:

This is caused by Wayland not allowing processes run as a different user
to display on the desktop. Therefore using "su" or "sudo" to display a
graphical application doesn't work.

So I guess this extension simply can't work under Wayland!
I'll close this bug, since I don't think it can't be fixed.

But I think Nautilus (and Gedit) now have some support to do some tasks as root, so this extension may no longer be needed in the future.

@ceyhunn
Copy link
Author

ceyhunn commented Jun 18, 2017

I understood. Thanks for your answer!!

@brunonova
Copy link
Owner

And thank you for reporting this!

@ceyhunn
Copy link
Author

ceyhunn commented Jun 24, 2017

Hi @brunonova ,
I make your extension work on Gnome-Wayland. Adding environment variable XDG_RUNTIME_DIR of current user like

pkexec   env XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR nautilus
pkexec   env XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR gedit

solves the problem. That's why I did some changes in nautilus-admin.py for nautilus and gedit:

 cmd = [PKEXEC_PATH]
 cmd +=['env','XDG_RUNTIME_DIR='+os.environ['XDG_RUNTIME_DIR']]
 cmd +=[NAUTILUS_PATH]
 cmd +=['--no-desktop',uri]
 subprocess.Popen(cmd)
 #subprocess.Popen([PKEXEC_PATH, NAUTILUS_PATH, "--no-desktop", uri])

 cmd = [PKEXEC_PATH]
 cmd +=['env','XDG_RUNTIME_DIR='+os.environ['XDG_RUNTIME_DIR']]
 cmd +=[GEDIT_PATH]
 cmd +=[uri]
 subprocess.Popen(cmd)
 #subprocess.Popen([PKEXEC_PATH, GEDIT_PATH, uri])

@brunonova
Copy link
Owner

Thanks!
I have added your changes to the extension.

I can't really test it now, so I'll take your word for it that it works.

@ceyhunn
Copy link
Author

ceyhunn commented Jun 26, 2017

@brunonova, but there are some tiny problems in org.freedesktop.nautilus-admin.policy like pkexec messages. I don't know them very well.

@brunonova
Copy link
Owner

What messages are you referring to?

@ceyhunn
Copy link
Author

ceyhunn commented Jun 26, 2017

@brunonova ,
Example: Your Nautilus Message - Authentication is required to run the File Manager as Administrator like this - Authentication is needed to run /usr/bin/env as the superuser.

@brunonova
Copy link
Owner

Oh, right! pkexec is now running env instead of nautilus, so the policykit file no longer applies.
I'll take a look at this tomorrow.

brunonova added a commit that referenced this issue Jun 27, 2017
@brunonova
Copy link
Owner

I don't think there's another way to preserve environment variables with polkit besides using that env trick, but then the policykit file no longer applies.
I have reverted the change.

Try running:

xhost +local:
pkexec nautilus --no-desktop

To see if this works to open Nautilus as root under Wayland.
You can also try the other workarounds mentioned in:

brunonova added a commit that referenced this issue Aug 28, 2017
Also bump version to 1.0.0 and remove the "Run as Administrator" option.
@brunonova brunonova self-assigned this Aug 28, 2017
@brunonova brunonova added this to the v1.0.0 milestone Aug 28, 2017
@brunonova brunonova removed the wontfix label Aug 28, 2017
brunonova added a commit that referenced this issue May 14, 2022
brunonova added a commit that referenced this issue May 14, 2022
Also bump version to 1.0.0 and remove the "Run as Administrator" option.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants