assistance writing a polkit rule to mount and umount

Thomas Gläßle t_glaessle at gmx.de
Fri Sep 18 15:34:21 PDT 2015


Hey,

John wrote on 09/18/2015 09:18 PM:
> Hello.  I am currently using a helper script which, when users add themselves to /etc/sudoers will mount an overlayfs mount and umount it for them.  I'd like a more elegant way to do this and believe udisks/udisks2 might be that solution.  I am not sure how to write a polkit ruleset to cover this particular use case and am posting here asking for assistance.
I am not an expert on these matters, but I think there is no polkit
authentification for direct usage of mount/umount.

You can find an example for a polkit rule for udisks here:
https://github.com/coldfix/udiskie#permissions
This allows to use `udisksctl` or the udisks D-Bus API from userspace.


> Goals:
> 1) Run `mount nosuid,nodev,noexec -t overlay ...` for the unprivileged user.
> 2) Run `umount -l ...` for the unprivileged user.
>
> The arguments for the overlayfs or overlay mount will be set by the script and are variable based on the user's data.  You can find my helper-script here: 
> https://github.com/graysky2/profile-sync-daemon/blob/master/common/psd-overlay-helper
I'm afraid udisks does probably not support such complex mount commands
(the custom options), but better try on your own (using udisksctl)!



>
> Thanks in advance!
> _______________________________________________
> devkit-devel mailing list
> devkit-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/devkit-devel


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/devkit-devel/attachments/20150919/95ec5c22/attachment.sig>


More information about the devkit-devel mailing list