aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/etc/polkit-1/rules.d/53-udisks-system-mount.rules
blob: 64c55175a8fd6b77c65955fc257f202ebe779bd0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Require an active session to mount system filesystems or modify
// system devices via udisks2. Normal USB-stick auto-mount uses the
// `filesystem-mount` action (not `*-system`) and is not affected; the
// gate is on /etc/fstab system mounts and disk-level operations.
polkit.addRule(function (action, subject) {
  if (
    action.id === "org.freedesktop.udisks2.filesystem-mount-system" ||
    action.id === "org.freedesktop.udisks2.modify-system"
  ) {
    if (!subject.active) {
      return polkit.Result.NO;
    }
  }
});