From: David Zeuthen Date: Mon, 23 Apr 2012 17:23:38 +0000 (-0400) Subject: Add section about polkit actions to the docs X-Git-Tag: upstream/2.1.2~286 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=249485bfa029219603ea9be7a46dce18dccfdcc9;p=platform%2Fupstream%2Fudisks2.git Add section about polkit actions to the docs Also, - Add more comments to the .policy file (since it's included verbatim) - Explicitly state that polkit actions are not considered stable - Don't reference polkit actions in D-Bus docs - Cross-reference polkit actions chapter from udisks(8) man page - Mention ID_SEAT in udisks(8) man page Signed-off-by: David Zeuthen --- diff --git a/data/org.freedesktop.UDisks2.xml b/data/org.freedesktop.UDisks2.xml index ee76c32..4d0a2bd 100644 --- a/data/org.freedesktop.UDisks2.xml +++ b/data/org.freedesktop.UDisks2.xml @@ -1118,36 +1118,21 @@ filesystem types are validated against a (small) whitelist to avoid unexpected privilege escalation - Mounting a file system is a privileged operation and before - fulfilling the request, an authorization check for one of the - two actions - org.freedesktop.udisks2.filesystem-mount - or - org.freedesktop.udisks2.filesystem-mount-system - is performed (the value of the - #org.freedesktop.UDisks2.Block:HintSystem property is used to - determine which one). The latter check typically results in - the user having to authenticate as an administrator while the - former typically doesn't require authentication if the caller - is on a local console. - If the device in question is referenced in the /etc/fstab file, the mount command is called directly (as root) and the given options or filesystem type given in @options are - ignored. The authorization checks mentioned above are still - performed. + ignored. If x-udisks-auth is specified as an option for the device in the /etc/fstab file, then the mount command is run as the - calling user, without performing any of the authorization - checks mentioned above. If this fails because of insufficient - permissions, an authorization check is performed for the - org.freedesktop.udisks2.filesystem-fstab - action which typically results in the user having to - authenticate as an administrator. If authorized, the - mount command is then run as root. + calling user, without performing any authorization check + mentioned above. If this fails because of insufficient + permissions, an authorization check is performed (which + typically results in the user having to authenticate as an + administrator). If authorized, the mount + command is then run as root. The filesystem should be unmounted using the org.freedesktop.UDisks2.Filesystem.Unmount() method. @@ -1175,11 +1160,9 @@ If the device in question was not mounted by the calling user via the org.freedesktop.UDisks2.Filesystem.Mount() method the filesystem is unmounted without any authorization checks. - Otherwise, an authorization check is performed for the - org.freedesktop.udisks2.filesystem-unmount-others - action which typically results in the user having to - authenticate as an administrator. If authorized, the - filesystem is unmounted. + Otherwise, an authorization check is performed (which + typically results in the user having to authenticate as an + administrator). If authorized, the filesystem is unmounted. If the filesystem is busy, this operation fails with the error org.freedesktop.UDisks2.Error.DeviceBusy diff --git a/data/org.freedesktop.udisks2.policy.in b/data/org.freedesktop.udisks2.policy.in index 7963252..7425765 100644 --- a/data/org.freedesktop.udisks2.policy.in +++ b/data/org.freedesktop.udisks2.policy.in @@ -9,7 +9,9 @@ http://udisks.freedesktop.org/ drive-removable-media + + <_description>Mount a filesystem <_message>Authentication is required to mount the filesystem @@ -20,6 +22,7 @@ + <_description>Mount a filesystem on a system device <_message>Authentication is required to mount the filesystem @@ -30,6 +33,7 @@ + <_description>Mount a filesystem from a device plugged into another seat <_message>Authentication is required to mount the filesystem @@ -40,6 +44,7 @@ + <_description>Mount/unmount filesystems defined in the fstab file with the x-udisks-auth option <_message>Authentication is required to mount/unmount the filesystem @@ -50,6 +55,10 @@ + + + + <_description>Unmount a device mounted by another user <_message>Authentication is required to unmount a filesystem mounted by another user @@ -60,6 +69,7 @@ + <_description>Unmount a shared device mounted by another user <_message>Authentication is required to unmount a filesystem mounted by another user @@ -70,7 +80,9 @@ + + <_description>Unlock an encrypted device <_message>Authentication is required to unlock an encrypted device @@ -81,6 +93,7 @@ + <_description>Unlock an encrypted system device <_message>Authentication is required to unlock an encrypted device @@ -91,6 +104,7 @@ + <_description>Unlock an encrypted device plugged into another seat <_message>Authentication is required to unlock an encrypted device @@ -101,6 +115,7 @@ + <_description>Unlock an encrypted device specified in the crypttab file with the x-udisks-auth option <_message>Authentication is required to unlock an encrypted device @@ -111,6 +126,10 @@ + + + + <_description>Lock an encrypted device unlocked by another user <_message>Authentication is required to lock an encrypted device unlocked by another user @@ -121,6 +140,9 @@ + + + <_description>Change passphrase for an encrypted device <_message>Authentication is required to change the passphrase for an encrypted device @@ -131,6 +153,7 @@ + <_description>Change passphrase for an encrypted device <_message>Authentication is required to change the passphrase for an encrypted device @@ -141,18 +164,23 @@ + + <_description>Manage loop devices <_message>Authentication is required to set up a loop device auth_admin auth_admin - + yes + + + <_description>Manage loop devices <_message>Authentication is required to delete a loop device set up by another user @@ -163,7 +191,9 @@ - + + + <_description>Manage swapspace <_message>Authentication is required to manage swapspace @@ -174,7 +204,9 @@ + + <_description>Modify a device <_message>Authentication is required to modify a device @@ -185,6 +217,7 @@ + <_description>Modify a system device <_message>Authentication is required to modify a device @@ -195,6 +228,7 @@ + <_description>Modify a device <_message>Authentication is required to modify a device plugged into another seat @@ -205,7 +239,9 @@ - + + + <_description>Open a device <_message>Authentication is required to open a device @@ -226,12 +262,16 @@ + + <_description>Modify system-wide configuration <_message>Authentication is required to modify system-wide configuration @@ -253,7 +293,10 @@ - + + + + <_description>Update SMART data <_message>Authentication is required to update SMART data diff --git a/doc/man/udisks.xml b/doc/man/udisks.xml index ed69f98..0612c09 100644 --- a/doc/man/udisks.xml +++ b/doc/man/udisks.xml @@ -31,37 +31,51 @@ ACCESS CONTROL By default, logged-in users in active log-in sessions are - permitted to mount and unlock devices attached to the local - console. To lock down globally, configure the - polkit8 - authorizations for the actions - filesystem-mount, - filesystem-mount-system, - encrypted-unlock and - encrypted-unlock-system, all in the - org.freedesktop.udisks2 namespace. + permitted to perform operations (for example, mounting, + unlocking or modifying) devices attached to the seat their + session is on. Access-control is fine-grained and based on + polkit8, + see the Authorization + Checks chapter in the udisks documentation for + more information (available + online here). - Note that the actions ending in -system - typically requires administrator authentication and are used for - devices not considered "removable" (devices considered - "removable" include USB attached storage, Flash media, optical - discs etc.). The udev property UDISKS_SYSTEM - can be used to override this on a per-device basis, see below. + Note that the polkit actions ending in + -system typically requires administrator + authentication and are used for devices not considered + removable (devices considered removable include + USB attached storage, Flash media, optical discs etc.). The udev + property UDISKS_SYSTEM can be used to + override this on a per-device basis, see below. - To lock down access on a per-device basis, use the option - x-udisks-auth in the - /etc/fstab file and the option - x-udisks-auth in the - /etc/crypttab file. + The x-udisks-auth option can be used in the + /etc/fstab and + /etc/crypttab files to specify that + additional authorization is required to mount resp. unlock the + device (typically requiring the user to authenticate as an + administrator). + + + + WHAT THE USER SEES + + udisks is a system-level component and is not per se concerned + with what a desktop user interface shows the user. For GNOME see + these GVfs + notes about what is shown in the desktop user interface + and how to influence it. DEVICE INFORMATION - On Linux, udisks relies on recent versions of + udisks relies on recent versions of udev7 and the Linux kernel. Influential device properties in the udev database include: @@ -116,6 +130,23 @@ + + + + + The physical seat the device is attached to. If not set, + seat0 (the first seat) is assumed. The + special value all means that the device + should be available on all seats, e.g. available from + login sessions running on any seat. This also means that + special mount options and mount directory will be used so + all users can access mounted filesystems from the device - + for example, the device will be mounted in + /media instead of + /run/media/USER. + + + diff --git a/doc/udisks2-docs.xml b/doc/udisks2-docs.xml index b7363b8..558a208 100644 --- a/doc/udisks2-docs.xml +++ b/doc/udisks2-docs.xml @@ -125,6 +125,60 @@ + + Authorization Checks + + Many methods and operations offered by udisks requires the + calling user to be sufficiently authorized. Whether the user + is authorized is checked using polkit + and the administrator can configure polkit's + local authority (but note that the system may be + using another polkit authority implementation). + + + There is not necessarily a one-to-one relationship between + D-Bus methods and polkit actions - typically the + relationship is more complicated and depends on both the + context of the process invoking the method, the object the + method is acting on and possibly more factors. For example, + the Filesystem.Mount() + method call may check that the caller is authorized for one + of the four actions + org.freedesktop.udisks2.filesystem-mount, + org.freedesktop.udisks2.filesystem-mount-system, + org.freedesktop.udisks2.filesystem-mount-other-seat + or + org.freedesktop.udisks2.filesystem-mount-fstab + depending on circumstances. + + + Often there will be two polkit actions for one operation - + one for so-called system devices and one for + non-system devices. In this context system + device refers to the value of the Block:HintSystem + D-Bus property and is normally only + TRUE for devices not considered + removable (devices considered removable + include USB attached storage, Flash media and optical + drives). See for how to control + if a device is considered a system device. + + + The polkit actions are not considered stable and may change + from release to release so administrators should take notice + when upgrading from one version of udisks to another. For + example, .pkla files may need to be + updated to match an updated policy. + For reference, the polkit actions defined by udisks &version; + are included here: + FIXME: MISSING XINCLUDE CONTENT + + + The <parameter>options</parameter> parameter @@ -157,6 +211,7 @@ +