Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
udisksctl not working without root auth
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4657
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Fri Jan 03, 2014 12:45 am    Post subject: udisksctl not working without root auth Reply with quote

I need to mount my dvd as a simple user with udiskctl, but:
Code:

cloc3@dell ~ $ LANG="" udisksctl mount -b /dev/sr0
==== AUTHENTICATING FOR org.freedesktop.udisks2.filesystem-mount ===
Authentication is required to mount HL-DT-ST DVD+/-RW GU70N (/dev/sr0)
Authenticating as: root
Password:


what should I do to allow my user to mount dvds?

p.s:
Code:

cloc3@dell ~ $ groups
disk wheel uucp audio cdrom video cdrw usb users portage plugdev cloc3

_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6193

PostPosted: Fri Jan 03, 2014 6:42 am    Post subject: Reply with quote

If that's not a systemd setup, you should check if consolekit stuff is set up correctly.[/b]
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4657
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Fri Jan 03, 2014 8:29 am    Post subject: Reply with quote

VoidMage wrote:
If that's not a systemd setup ...

ops. that may it be the problem.

few time ago, I added systemd useflag on my system, mantaining openrc init system (there was a specific useflag for openrc ebuiid).
anyway, consolekit, in default configuration, doesn't help me.

I found this workaround to run cdrom and dvd's:
Code:

dell ~ # cat /etc/udev/rules.d/99-automount.rules
ENV{ID_SERIAL}="HL-DT-ST_DVD+_-RW_GU70N_KM3D1BD3548"  ENV{UDISKS_AUTO}="1", ENV{UDISKS_SYSTEM}="0" RUN+="/usr/local/sbin/montaCdrom.sh"


what do you think should I do to raise a stable configuration?
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Fri Jan 03, 2014 10:55 am    Post subject: Reply with quote

Avoid all this udisks madness and just setup and use udevil.
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6193

PostPosted: Fri Jan 03, 2014 6:35 pm    Post subject: Reply with quote

ppurka wrote:
Avoid all this udisks madness and just setup and use udevil.

:roll: :snort: Honestly, udevil isn't any better - it may have less dependencies, but at the cost of functionality.
In the end it's just as inflexible as udisks is.
Back to top
View user's profile Send private message
GFCCAE6xF
Apprentice
Apprentice


Joined: 06 Aug 2012
Posts: 266

PostPosted: Fri Jan 03, 2014 6:49 pm    Post subject: Reply with quote

^^ +1
Udevil shits itself for me and gives the middle finger to my fstab for no good reason, I never had that problem with udisks which always worked flawlessly, so tempted to go back to it. 8O
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6193

PostPosted: Fri Jan 03, 2014 7:15 pm    Post subject: Reply with quote

As for the original problem, I really hate repeating all of the stuff from the old threads,but...

- does ck-list-sessions list your current session as active ?
- does getfacl show the drive as properly marked for your user ?
- did you change default polkit policies in any way ?
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4657
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Fri Jan 03, 2014 10:51 pm    Post subject: Reply with quote

VoidMage wrote:
I really hate repeating all of the stuff

Thank for your patience, and sorry if it's so difficult to orient yourself in freedesktop labirinth.
I don't touch anything in polkit configuration, because I simply don't understand it.
Also, I dont' understand how a text configuration file may be so complex and breakable to became untouchable for the user: It should be binary.

about getfacl:
Code:

cloc3@dell ~ $ getfacl /dev/sr0
getfacl: Removing leading '/' from absolute path names
# file: dev/sr0
# owner: root
# group: cdrom
user::rw-
group::rw-
other::---

I think it's ok, because my user is part of cdrom group.
Instead, ck-list-sessions is simple void.
I don't know way.

@ppurka: I'll try udevil. It seems working better from the command line, but not from plasma gui.
My goal, in this moment, is not to found a dirty workaround, but to became able to understand freedesktop system.
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Sat Jan 04, 2014 8:49 am    Post subject: Reply with quote

If you are trying to get it work from plasma then just go udisks all the way. udevil is very good when you don't want to mess around with consolekit and polkit.
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6193

PostPosted: Sat Jan 04, 2014 7:03 pm    Post subject: Reply with quote

Well, is consolekit built with acl useflag ?
Also, did you set things up so that your session is launched under consolekit ?
Just search the old threads - a relevant case shouldn't be that hard to find.
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4657
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Sat Jan 04, 2014 11:21 pm    Post subject: Reply with quote

VoidMage wrote:

Also, did you set things up so that your session is launched under consolekit ?

that's may it be the problem, but:
Code:

...
!!! The ebuild selected to satisfy ">=kde-base/kdm-4.11:4[aqua=]" has unmet requirements.
- kde-base/kdm-4.11.4::gentoo USE="consolekit handbook pam systemd (-aqua) -debug -kerberos"

  The following REQUIRED_USE flag constraints are unsatisfied:
    consolekit? ( !systemd ) systemd? ( !consolekit )

Few times ago, I choose to add systemd useflag in make.conf.
Now, it seems I'm forced to turn back.

I don't want to do this. what else may I do?
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4657
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Sat Jan 04, 2014 11:49 pm    Post subject: Reply with quote

anyway, even rebuilding kdm with consolekit useflag:
Code:

cloc3@dell ~ $ ck-list-sessions
Session1:
        unix-user = '1000'
        realname = '(null)'
        seat = 'Seat1'
        session-type = ''
        active = TRUE
        x11-display = ':0'
        x11-display-device = '/dev/tty7'
        display-device = ''
        remote-host-name = ''
        is-local = TRUE
        on-since = '2014-01-04T23:44:46.778763Z'
        login-session-id = '4'
cloc3@dell ~ $ udisksctl mount -b /dev/sr0
==== AUTHENTICATING FOR org.freedesktop.udisks2.filesystem-mount ===
È richiesto autenticarsi per montare HL-DT-ST DVD+/-RW GU70N (/dev/sr0)
Authenticating as: root
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Error mounting /dev/sr0: GDBus.Error:org.freedesktop.UDisks2.Error.NotAuthorized: Not authorized to perform operation

_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6193

PostPosted: Sun Jan 05, 2014 7:29 am    Post subject: Reply with quote

What does 'pkaction -v --action-id org.freedesktop.udisks2.filesystem-mount' and 'pkaction -v --action-id org.freedesktop.udisks2.filesystem-mount-system' print then ?

...any chance that drive is connected by firewire ? Cause it would seem, that it's the first one that should be invoked, not the second one.
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4657
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Sun Jan 05, 2014 11:55 am    Post subject: Reply with quote

as you guess:
Code:

cloc3@dell ~ $ pkaction -v --action-id org.freedesktop.udisks2.filesystem-mount
org.freedesktop.udisks2.filesystem-mount:
  description:       Mount a filesystem
  message:           Authentication is required to mount the filesystem
  vendor:            The udisks Project
  vendor_url:        http://udisks.freedesktop.org/
  icon:              drive-removable-media
  implicit any:      auth_admin
  implicit inactive: auth_admin
  implicit active:   yes

cloc3@dell ~ $ pkaction -v --action-id org.freedesktop.udisks2.filesystem-mount-system
org.freedesktop.udisks2.filesystem-mount-system:
  description:       Mount a filesystem on a system device
  message:           Authentication is required to mount the filesystem
  vendor:            The udisks Project
  vendor_url:        http://udisks.freedesktop.org/
  icon:              drive-removable-media
  implicit any:      auth_admin
  implicit inactive: auth_admin
  implicit active:   auth_admin_keep

my laptop is a inspiron 15z. no firewire is available.
anyway, dvd is not the only automount issue in my system.
I look similar behaviours on other gentoo-boxes.
sometimes ago, I opened a bug, but the developer closed it as a kde upstream problem.

unlikely, freedesktop envinroment needs too much learning time and offers non enough documentation.
I add this in /etc/polkit.d/rules.d:
Code:

dell rules.d # cat 60-dvd.rules
// Allow users in group 'users' to perform any operation on
// some drives without having to authenticate
//
polkit.addRule(function(action, subject) {
    if (action.id.indexOf("org.freedesktop.udisks2.") == 0 &&
        action.lookup("drive.model") == "HL-DT-ST_DVD+_-RW_GU70N" &&
        subject.isInGroup("users")) {
            return polkit.Result.YES;
        }
    }
});

but:
Code:

cloc3@dell ~ $ LANG="" udisksctl mount -b /dev/sr0
==== AUTHENTICATING FOR org.freedesktop.udisks2.filesystem-mount ===
Authentication is required to mount HL-DT-ST DVD+/-RW GU70N (/dev/sr0)
Authenticating as: root
Password:

_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Sun Jan 05, 2014 1:06 pm    Post subject: Reply with quote

cloc3 wrote:
unlikely, freedesktop envinroment needs too much learning time and offers non enough documentation.
That was one of my major issues/gripes with the *kits. It is good for binary distros where everything is set up by someone upstream of upstream. Too little documentation and whatever documentation is there goes around in circles.
Quote:

but:
Code:

cloc3@dell ~ $ LANG="" udisksctl mount -b /dev/sr0
==== AUTHENTICATING FOR org.freedesktop.udisks2.filesystem-mount ===
Authentication is required to mount HL-DT-ST DVD+/-RW GU70N (/dev/sr0)
Authenticating as: root
Password:
Since you have added the rules to /etc/polkit.d, try using pkexec and see if it works:
Code:
pkexec udisksctl mount -b /dev/sr0

_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6193

PostPosted: Sun Jan 05, 2014 2:46 pm    Post subject: Reply with quote

cloc3 wrote:
anyway, dvd is not the only automount issue in my system.

Please, elaborate.
cloc3 wrote:
sometimes ago, I opened a bug, but the developer closed it as a kde upstream problem.

Ditto.

Anyway, like udisks page says, pastebin 'udisksctl dump' and 'udevadm monitor --udev --property' (as root) as you put a disc into the drive.
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4657
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Sun Jan 05, 2014 9:24 pm    Post subject: Reply with quote

VoidMage wrote:
cloc3 wrote:
anyway, dvd is not the only automount issue in my system.

Please, elaborate.

:) No. once at the time. A lot of issues may depend by one only error.

udev: http://pastebin.com/raw.php?i=Ac9XPNKd
udisks: http://pastebin.com/raw.php?i=thDsMiCX

and thanks a lot for your help.
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6193

PostPosted: Mon Jan 06, 2014 5:29 am    Post subject: Reply with quote

Are HL-DT-ST-DVD+--RW-GU70N-KM3D1BD3548 and HL-DT-ST_DVD+_-RW_GU70N_KM3D1BD3548 different devices ?
What is that /dev/sdc node ?

Perhaps it's related to udf, does it happen with iso9660 discs ?
There seems to be something confusing here - one of the drives is marked as fixed, not removable.
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4657
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Mon Jan 06, 2014 1:12 pm    Post subject: Reply with quote

VoidMage wrote:
Are HL-DT-ST-DVD+--RW-GU70N-KM3D1BD3548 and HL-DT-ST_DVD+_-RW_GU70N_KM3D1BD3548 different devices ?
What is that /dev/sdc node ?

I find just one event:
Code:

UDEV  [377.033621] change   /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sr0 (block)

why do you guess about more than one device?
all links point to /dev/sr0:
Code:

ell linux # DEVLINKS="/dev/cdrom /dev/disk/by-id/ata-HL-DT-ST_DVD+_-RW_GU70N_KM3D1BD3548 /dev/disk/by-id/wwn-0x5001480000000000 /dev/disk/by-label/IL_CAIMANO /dev/disk/by-uuid/2006-07-19-11-34-54-00"
dell linux # ls -l $DEVLINKS
lrwxrwxrwx 1 root root 3  6 gen 14.03 /dev/cdrom -> sr0
lrwxrwxrwx 1 root root 9  6 gen 14.03 /dev/disk/by-id/ata-HL-DT-ST_DVD+_-RW_GU70N_KM3D1BD3548 -> ../../sr0
lrwxrwxrwx 1 root root 9  6 gen 14.03 /dev/disk/by-id/wwn-0x5001480000000000 -> ../../sr0
lrwxrwxrwx 1 root root 9  6 gen 14.03 /dev/disk/by-label/IL_CAIMANO -> ../../sr0
lrwxrwxrwx 1 root root 9  6 gen 14.03 /dev/disk/by-uuid/2006-07-19-11-34-54-00 -> ../../sr0

about /dev/sd*, it shoul be /dev/sdc:
Code:

dell linux # dmesg |grep sdc
[    8.078164] sd 6:0:0:0: [sdc] Attached SCSI removable disk

btu it cannot be used to mount the cdorm:
Code:

dell linux # mount /dev/sdc /mnt/sdc
mount: no medium found on /dev/sdc

module udf is loaded by mount command.
isofs is available for the kernel, but it's not loaded by mount command.
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6193

PostPosted: Mon Jan 06, 2014 1:47 pm    Post subject: Reply with quote

udisks sees two devices that are named suspiciously similar.
One of them is marked as a fixed drive, which would explain why is udisks asking for root password.

So, hard way it is - pastebin the rest of the set from wiki:
- 'udisksctl monitor' as you put something in the drive
- 'udevadm info --export-db' (as root)
- 'cat /proc/self/mountinfo'
- 'cat /etc/fstab'

...and perhaps a silly question, but is or is not your system running under systemd ?
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4657
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Mon Jan 06, 2014 6:01 pm    Post subject: Reply with quote

Quote:

cloc3@dell ~ $ udisksctl dump|pastebinit
http://pastebin.com/raw.php?i=VHpETAt5
cloc3@dell ~ $ su -
Password:
dell ~ # udevadm info --export-db|pastebinit
http://pastebin.com/raw.php?i=d6njwpB7
dell ~ # cat /proc/self/mountinfo|pastebinit
http://pastebin.com/raw.php?i=vvPCA9Q9
dell ~ # cat /etc/fstab|pastebinit
http://pastebin.com/raw.php?i=AxzZMm6L
dell ~ # ps 1
PID TTY STAT TIME COMMAND
1 ? Ss 0:02 init [3]
dell ~ # portageq owners / init
[...omit...]
sys-apps/sysvinit-2.88-r6
/sbin/init


anyway, in my system all packages are built with the systemd useflag (kdm excluded, off course).
p.s.: :oops: /dev/sdc is the card reader device. we don't care about it.
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6193

PostPosted: Mon Jan 06, 2014 9:28 pm    Post subject: Reply with quote

First of all, you've skipped one point of the list.

But...
Either you've pastebined two different machines or for some reason sdc started referring to a different device, which is possible, but notable.
Also, it seems the previous conflict of removable vs fixed is gone.
Is that card reader by any chance a part of that dvd drive ?
By a stab in the dark: is CONFIG_SCSI_MULTI_LUN set ?
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4657
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Mon Jan 06, 2014 10:26 pm    Post subject: Reply with quote

VoidMage wrote:
First of all, you've skipped one point of the list.

sorry. which one?
I see 4 points and 4 pastebin.
about the silly question, I answered showing the ouput of ps 1 command.

VoidMage wrote:

But...
Either you've pastebined two different machines or for some reason sdc started referring to a different device, which is possible, but notable.

I don't understand. why two different machines?
all my pastebin come from my inspiron 15z. Service Tag HRH6KW1.
be sure: I'm absolutely earnest in my pastebins.
:)
VoidMage wrote:

Is that card reader by any chance a part of that dvd drive ?
By a stab in the dark: is CONFIG_SCSI_MULTI_LUN set ?

I don't know nothing about the physical internal connections, but sdc seems on a usb port, while sr0 seems on ata.
dell ~ # zgrep SCSI_MU /proc/config.gz
CONFIG_SCSI_MULTI_LUN=y
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4657
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Mon Jan 06, 2014 10:54 pm    Post subject: Reply with quote

sorry again.
I'm looking again on my first udisk pastebin.

there is something completly messy. for example:
Quote:

/org/freedesktop/UDisks2/block_devices/sda1:
org.freedesktop.UDisks2.Block:/org/freedesktop/UDisks2/block_devices/sda1:
org.freedesktop.UDisks2.Block:
Configuration: []
CryptoBackingDevice: '/'
Device: /dev/sda1
DeviceNumber: 2049
Drive: '/org/freedesktop/UDisks2/drives/ST500LT012_9WS142_S0V4TJ7B'
HintAuto: true
HintIconName:
HintIgnore: false
HintName:
HintPartitionable: true
HintSymbolicIconName:
HintSystem: false
Id: by-id-ata-HL-DT-ST_DVD+_-RW_GU70N_KM3D1BD3548-part1
IdLabel: EFI-BOOT
IdType: vfat
IdUUID: AAA4-4B68
IdUsage: filesystem
IdVersion: FAT32
MDRaid: '/'
MDRaidMember: '/'
PreferredDevice: /dev/sda1
ReadOnly: false
Size: 209715200
Symlinks: /dev/disk/by-id/ata-HL-DT-ST_DVD+_-RW_GU70N_KM3D1BD3548-part1
Configuration: []
CryptoBackingDevice: '/'
Device: /dev/sda1
DeviceNumber: 2049
Drive: '/org/freedesktop/UDisks2/drives/ST500LT012_9WS142_S0V4TJ7B'
HintAuto: true
HintIconName:
HintIgnore: false
HintName:
HintPartitionable: true
HintSymbolicIconName:
HintSystem: false
Id: by-id-ata-HL-DT-ST_DVD+_-RW_GU70N_KM3D1BD3548-part1
IdLabel: EFI-BOOT
IdType: vfat
IdUUID: AAA4-4B68
IdUsage: filesystem
IdVersion: FAT32
MDRaid: '/'
MDRaidMember: '/'
PreferredDevice: /dev/sda1
ReadOnly: false
Size: 209715200
Symlinks: /dev/disk/by-id/ata-HL-DT-ST_DVD+_-RW_GU70N_KM3D1BD3548-part1

sda1 device is the first partition of the sdd disk. but the IdLabel for udisks seems related to the dvd reader.
this seems a software bug in udisk or in dbus.
sometime, some values of database seems mixed one which other.

now, my problem may it be to demostrate this behaviuor is reproducible to submit an acceptable bug.
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6193

PostPosted: Mon Jan 06, 2014 11:53 pm    Post subject: Reply with quote

:sigh: 'udisksctl dump' != 'udisksctl monitor'

Also...
Gaah, delete your custom udev rule - it's broken and probably responsible for some of those bogus values in the first pastebin.

Might be useful to make udev reload the rules and recheck udev/udisks output.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum