You are not logged in.

#1 2015-07-06 23:02:35

HDArtworks
Member
Registered: 2015-04-20
Posts: 70
Website

No password need for mount my partitions

Hi.
Few days ago i have a problem for mount my NTFS partition after update my Arch.
I searched in internet and i find a way to fix that problem:

https://wiki.archlinux.org/index.php/Polkit
https://wiki.archlinux.org/index.php/Udisks

In the Udisks wiki, i found this part:
https://wiki.archlinux.org/index.php/Ud … figuration

And i add these commands to /etc/polkit-1/rules.d/50-udisks.rules file:

polkit.addRule(function(action, subject) {
  var YES = polkit.Result.YES;
  var permission = {
    // only required for udisks1:
    "org.freedesktop.udisks.filesystem-mount": YES,
    "org.freedesktop.udisks.filesystem-mount-system-internal": YES,
    "org.freedesktop.udisks.luks-unlock": YES,
    "org.freedesktop.udisks.drive-eject": YES,
    "org.freedesktop.udisks.drive-detach": YES,
    // only required for udisks2:
    "org.freedesktop.udisks2.filesystem-mount": YES,
    "org.freedesktop.udisks2.filesystem-mount-system": YES,
    "org.freedesktop.udisks2.encrypted-unlock": YES,
    "org.freedesktop.udisks2.eject-media": YES,
    "org.freedesktop.udisks2.power-off-drive": YES,
    // required for udisks2 if using udiskie from another seat (e.g. systemd):
    "org.freedesktop.udisks2.filesystem-mount-other-seat": YES,
    "org.freedesktop.udisks2.encrypted-unlock-other-seat": YES,
    "org.freedesktop.udisks2.eject-media-other-seat": YES,
    "org.freedesktop.udisks2.power-off-drive-other-seat": YES
  };
  if (subject.isInGroup("storage")) {
    return permission[action.id];
  }
});

Now the problem is fixed and i can mount my partitions, But there is no ask me for password!
I need password for mount my partitions. How can i fix that?
Please tell the solution in here, Because i get confused in wiki!
Thanks and sorry for my bad english... :-)

Offline

#2 2015-07-07 12:58:17

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,304

Re: No password need for mount my partitions

HDArtworks wrote:

Few days ago i have a problem for mount my NTFS partition after update my Arch.
I searched in internet and i find a way to fix that problem:
...
Now the problem is fixed and i can mount my partitions, But there is no ask me for password!
I need password for mount my partitions

You never said what the initial problem was!

The '/etc/polkit-1/rules.d/50-udisks.rules' file of the wiki is just an example;
and it applies only 'If your session is not activated or present';
so if you use systemd-logind to log in, this is not necessary, because with it the user session is already active.
and udisks2 is managed by the '/usr/share/polkit-1/actions/org.freedesktop.udisks2.policy' file.

As an aside you can define and use other vars:

var YES = polkit.Result.YES;
var AUTH_ADMIN = polkit.Result.AUTH_ADMIN;
var AUTH_SELF = polkit.Result.AUTH_SELF;

Read the polkit manual, and don't copy things found in internel witout understanding what they are meant to do.

Offline

Board footer

Powered by FluxBB