You are not logged in.

#1 2016-10-11 06:58:39

duyinthee
Member
Registered: 2015-06-14
Posts: 222
Website

[SOLVED] polkit prompts for root password?

I use thunar, gvfs, polkit and polkit-gnome in Awesome in Arch Linux which is installed on LVM and dual-booted with Fedora.
Everything is ok but when I click on Fedora's home partition in Thunar's side pane in Arch Linux, polkit-gnome prompts for root password. I think it should prompt for user password.

my /etc/polkit-1/rules.d/50-default.rules is

/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */

// DO NOT EDIT THIS FILE, it will be overwritten on update
//
// Default rules for polkit
//
// See the polkit(8) man page for more information
// about configuring polkit.

polkit.addAdminRule(function(action, subject) {
    return ["unix-group:wheel"];
});

my user is member of these groups:

lp users wheel

According to Arch wiki page https://wiki.archlinux.org/index.php/Polkit
saying this:

The Arch default is to make all members of the group wheel administrators.

it should prompt for user password, I think. But not.

Last edited by duyinthee (2016-10-13 08:19:30)

Offline

#2 2016-10-11 09:23:52

duyinthee
Member
Registered: 2015-06-14
Posts: 222
Website

Re: [SOLVED] polkit prompts for root password?

for testing purpose, I installed gparted and run this command:

$ pkexec --user myusername gparted

then polkit prompts for root password. Why? It should prompts for my user password because my /etc/polkit-1/rules.d/50-default.rules is this:

polkit.addAdminRule(function(action, subject) {
    return ["unix-group:wheel"];
});

I have been googling and running trail and error all day.

I can not launch gparted from dmenu as well. It says "Root privileges are required for running GParted"
I think, polkit-gnome is supposed to pop-up and ask for my user password. But not.

Last edited by duyinthee (2016-10-11 09:25:09)

Offline

#3 2016-10-11 13:30:00

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [SOLVED] polkit prompts for root password?

polkit-gnome issue?
Does it only *say* enter the root password or does it really (and only) take the root password?

Offline

#4 2016-10-11 15:04:49

duyinthee
Member
Registered: 2015-06-14
Posts: 222
Website

Re: [SOLVED] polkit prompts for root password?

yeah, it does not only saying "enter root password", but also really take the root password.

I have also tried mate-polkit, it does same as polkit-gnome.

Offline

#5 2016-10-11 20:32:55

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [SOLVED] polkit prompts for root password?

What if you kick all agents and use the direct input on "pkexec foo" from a textshell?

Offline

#6 2016-10-12 03:55:32

duyinthee
Member
Registered: 2015-06-14
Posts: 222
Website

Re: [SOLVED] polkit prompts for root password?

yes,

$ pkexec --user myusername anypackage

or

$ pkexec anypackage

prompts for root password.

Offline

#7 2016-10-12 06:58:43

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] polkit prompts for root password?

Offline

#8 2016-10-12 07:11:48

duyinthee
Member
Registered: 2015-06-14
Posts: 222
Website

Re: [SOLVED] polkit prompts for root password?

yes, I have read but not helpful.

my

 $ loginctl show-session $XDG_SESSION_ID

shows

Id=c1
User=1000
Name=msh
Timestamp=Wed 2016-10-12 09:43:56 MMT
TimestampMonotonic=59838460
VTNr=1
Seat=seat0
TTY=tty1
Remote=no
Service=login
Scope=session-c1.scope
Leader=434
Audit=0
Type=tty
Class=user
Active=yes
State=active
IdleHint=yes
IdleSinceHint=1476242577627982
IdleSinceHintMonotonic=600966826
LockedHint=no

and

 $ loginctl

shows

   SESSION        UID USER             SEAT            
        c1       1000 msh              seat0           

Offline

#9 2016-10-12 07:35:04

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [SOLVED] polkit prompts for root password?

Do you have more rules in /etc/polkit-1/rules.d/? Does any of them contain the string "root"?

Offline

#10 2016-10-12 11:10:10

duyinthee
Member
Registered: 2015-06-14
Posts: 222
Website

Re: [SOLVED] polkit prompts for root password?

No, I have only that 50-default.rules in that dir.

Offline

#11 2016-10-12 11:43:17

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [SOLVED] polkit prompts for root password?

Anything related in /usr/share/polkit-1/* ? (sorry, forgot the other path ...)

Offline

#12 2016-10-12 13:08:52

duyinthee
Member
Registered: 2015-06-14
Posts: 222
Website

Re: [SOLVED] polkit prompts for root password?

there are two folders in that dir /usr/share/polkit-1.
one is actions and one is rules.d folders

.policy files are in actions and rules.d folder is empty.

Offline

#13 2016-10-12 13:48:10

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [SOLVED] polkit prompts for root password?

Yup, does any of the policy in actions containt the string "root"?

Offline

#14 2016-10-13 02:02:45

duyinthee
Member
Registered: 2015-06-14
Posts: 222
Website

Re: [SOLVED] polkit prompts for root password?

No, non of them contain the string "root".

Offline

#15 2016-10-13 07:39:14

seth
Member
Registered: 2012-09-03
Posts: 51,253

Re: [SOLVED] polkit prompts for root password?

Grep everything in those paths for "addAdminRule".

Wouldn't it be cool if pkcheck could do anything but telling you "subject not specified", like, telling you the requirements to execute some action, as it f**** suggests to do ... :-\

Offline

#16 2016-10-13 08:16:09

duyinthee
Member
Registered: 2015-06-14
Posts: 222
Website

Re: [SOLVED] polkit prompts for root password?

I think I found solution. Look at in my first post, I said

$ groups myusername

shows:

lp users wheel

Actually, It should be

lp wheel users

I think I did

# useradd -m -G users -g wheel -s /bin/bash myusername

instead of

-g users -G wheel

when I created my user account in Arch installation process. smile smile smile

Now, I deleted my user account first and created new one with the same name (without "-m" option in command) like this:

# useradd -g users -G wheel -s /bin/bash myusername

Now user password is prompted to mount volume in thunar.
Anyway, gparted is still need root privileges to open. I think it is different story.

Last edited by duyinthee (2016-10-13 08:20:20)

Offline

#17 2016-10-13 08:45:23

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: [SOLVED] polkit prompts for root password?

gparted is not a polkit/dbus program; it has to be run as root. So either pkexec it, or use *sudo

Offline

Board footer

Powered by FluxBB