Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Mounting external drive w/o password doesn't work (Read 643 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

Mounting external drive w/o password doesn't work

Hello,

After a fresh install on another drive (the latest XFCE Runit ISO), when I click on an external drive I always get an authentication dialogue. Even though there is a polkit rule (/etc/polkit-1/rules.d/99-artix.rules) to omit this behaviour:

Code: [Select]
polkit.addRule(function(action, subject) {
    if (action.id.indexOf("org.freedesktop.udisks2.") == 0 && subject.isInGroup("storage")) {
        return polkit.Result.YES;
    }
});

I'm in the storage group.

The strangest part is that I have an already running Artix installation (I installed it on 2022-10-17) and everything works there as expected. But not with the fresh install.

Can't figure out what's wrong actually. Any ideas?

SOLVED: /etc/polkit-1/rules.d directory permissions were somehow messed up. Idk why. Reinstalled 'polkit' and it got fixed.

Re: Mounting external drive w/o password doesn't work

Reply #1
/etc/polkit-1/rules.d/69-gripped.rules
Code: [Select]
polkit.addRule(function(action, subject) {
    if (action.id.indexOf("org.freedesktop.udisks2.filesystem-mount") == 0 && subject.isInGroup("wheel")) {
        return polkit.Result.YES;
    }
});

polkit.addRule(function(action, subject) {
    if (action.id.indexOf("org.freedesktop.udisks2.filesystem-mount-system") == 0 && subject.isInGroup("wheel")) {
        return polkit.Result.YES;
    }
});
Note I've used group wheel not storage as I'm not in it.
So whatever the
Code: [Select]
polkit.addRule(function(action, subject) {
    if (action.id.indexOf("org.freedesktop.udisks2.") == 0 && subject.isInGroup("storage")) {
        return polkit.Result.YES;
    }
});
rule does it's never done anything for my my user.

Indeed does it do anything at all ?
Code: [Select]
org.freedesktop.udisks2.
is not an action. Does the trailing dot signify some sort of wildcard ?
Can't find that in that docs. It doesn't seem to work in that sense ?
But I'm no expert.

I only just figured this out for myself which has cured a long standing minor annoyance so I thank you for that.
Hope it works for you as well ?

Re: Mounting external drive w/o password doesn't work

Reply #2
Indeed does it do anything at all ?
Code: [Select]
org.freedesktop.udisks2.
is not an action. Does the trailing dot signify some sort of wildcard ?
Can't find that in that docs. It doesn't seem to work in that sense ?
But I'm no expert.

I only just figured this out for myself which has cured a long standing minor annoyance so I thank you for that.
Hope it works for you as well ?

Well, this file was installed by default. I didn't do anything. And I didn't do anything in another Artix installation either and it works there.

And no, neither of these variants work... That's just crazy. My guess is that something wrong with permissions or whatever in the new installation.

Re: Mounting external drive w/o password doesn't work

Reply #3
That's odd.
I could have sworn that in the past I'd tried changing 'storage' to 'wheel' in the /etc/polkit-1/rules.d/99-artix.rules file and it didn't work. But now it does ? So that answers my question about trailing dots and wildcards but doesn't help you.
Quote
My guess is that something wrong with permissions or whatever in the new installation.
Clearly something wrong. Either polkit or udisks are the obvious suspects.

As a workaround I think you could add the external drive to fstab with the nofail option.
Other than that I have no other ideas.

Re: Mounting external drive w/o password doesn't work

Reply #4
As a workaround I think you could add the external drive to fstab with the nofail option.
Other than that I have no other ideas.

Yeah, sure. Just don't want to make it permanent. Anyway, thank you for your time and effort! Will investigate it further. Cheers.

Re: Mounting external drive w/o password doesn't work

Reply #5
Another strange thing is that I cannot find an active PolicyKit-gnome github/gitlab page since the only package that got updated recently (in March) was polkiit-gnome. The official gitlab is archived years ago. Can't figure out who maintains it now...


Re: Mounting external drive w/o password doesn't work

Reply #7

Thank you, but I thought polkit-gnome could be the culprit. It has a different page and other maintainers, afaik. And it's the only package that got updated recently. Polkit and udisks2 didn't get updates in a long time already. I'm just trying to bisect this issue. Though I tried to downgrade polkit-gnome (and polkit as well) and it didn't help. That's crazy indeed :)

Anyway, will continue investigating...

Re: Mounting external drive w/o password doesn't work

Reply #8
But polkiit-gnome's official gitlab page (mentioned in the package info) is archived and abandoned. That's what I find a bit strange, because Artix devs updated the package this March. So I wonder what's really changed and where to see the diffs etc.

Re: Mounting external drive w/o password doesn't work

Reply #9
Often packages need new versions simply because libraries they depend on have been updated. The code of the package itself may be exactly the same. It that case only the number after the hyphen at the end changes eg
polkit-gnome-0.105-10
polkit-gnome-0.105-9

See
https://gitea.artixlinux.org/packagesP/polkit-gnome/commits/branch/master




Re: Mounting external drive w/o password doesn't work

Reply #10
You can easily "git" an answer, and it looks like nothing changed, a simple rebuild against a newer glibc with a newer gcc and whatever else is involved in the build:
Code: [Select]
$ cd /tmp
$ git clone https://gitea.artixlinux.org/packagesP/polkit-gnome.git
Cloning into 'polkit-gnome'...
remote: Enumerating objects: 63, done.
remote: Total 63 (delta 0), reused 0 (delta 0), pack-reused 63
Receiving objects: 100% (63/63), 12.53 KiB | 4.17 MiB/s, done.
Resolving deltas: 100% (23/23), done.
$ cd polkit-gnome/
$ git log
commit a8dfd3e146c111fb417a99cf3b7ba54411ac72fa (HEAD -> master, origin/master, origin/HEAD)
Author: Dudemanguy <[email protected]>
Date:   Sun Mar 12 13:40:20 2023 -0500

    [trunk] -> [community] 'polkit-gnome-0.105-10' add

commit e93298637da0186ea8b9f34e7c8d84cf5dd7e77d
Author: Dudemanguy <[email protected]>
Date:   Mon Apr 25 07:50:21 2022 -0500

    [trunk] -> [community] 'polkit-gnome-0.105-9' add

....etc - etc - etc ....

$ git diff e93298637da0186ea8b9f34e7c8d84cf5dd7e77d a8dfd3e146c111fb417a99cf3b7ba54411ac72fa
diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 831d1df..8e1f2fb 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -4,7 +4,7 @@
 
 pkgname=polkit-gnome
 pkgver=0.105
-pkgrel=9
+pkgrel=10
 pkgdesc='Legacy polkit authentication agent for GNOME'
 arch=('x86_64')
 url='https://gitlab.gnome.org/Archive/policykit-gnome'
diff --git a/x86_64/community/PKGBUILD b/x86_64/community/PKGBUILD
index 831d1df..8e1f2fb 100644
--- a/x86_64/community/PKGBUILD
+++ b/x86_64/community/PKGBUILD
@@ -4,7 +4,7 @@
 
 pkgname=polkit-gnome
 pkgver=0.105
-pkgrel=9
+pkgrel=10
 pkgdesc='Legacy polkit authentication agent for GNOME'
 arch=('x86_64')
 url='https://gitlab.gnome.org/Archive/policykit-gnome'

Re: Mounting external drive w/o password doesn't work

Reply #11
Often packages need new versions simply because libraries they depend on have been updated. In that case only the number after the hyphen at the end changes eg
polkit-gnome-0.105-10
polkit-gnome-0.105-9

Oh, yes, didn't think of it. Thank you.

Re: Mounting external drive w/o password doesn't work

Reply #12
You can easily "git" an answer, and it looks like nothing changed, a simple rebuild against a newer glibc with a newer gcc and whatever else is involved in the build

Shame on me for being such a newb. Thank you, guys!

 

Re: Mounting external drive w/o password doesn't work

Reply #13
SOLVED: /etc/polkit-1/rules.d directory permissions were somehow messed up. Idk why. Reinstalled 'polkit' and it got fixed.