platform/upstream/udisks2.git
12 years agoBug 49842 – Unhandled rootfs on bind mount
David Zeuthen [Tue, 15 May 2012 14:17:22 +0000 (10:17 -0400)]
Bug 49842 – Unhandled rootfs on bind mount

Don't ignore a mount just because if a subtree of the filesystem is
mounted. Because if we do this, we may wrongly conclude the device is
not mounted at all, which then means that it's visible in the desktop
UI and subject to automounting.

In the future, we may want a "a(ss) MountPointsFull" property that in
addition to the mount point also contains the subtree that is mounted
at said mountpoint.

https://bugs.freedesktop.org/show_bug.cgi?id=49842

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoCall it "Disk Manager" and reword some sections of udisks(8) man page
David Zeuthen [Mon, 14 May 2012 17:10:02 +0000 (13:10 -0400)]
Call it "Disk Manager" and reword some sections of udisks(8) man page

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoudisksctl: describe 'loop-setup' and 'loop-delete' verbs
David Zeuthen [Sat, 12 May 2012 16:18:53 +0000 (12:18 -0400)]
udisksctl: describe 'loop-setup' and 'loop-delete' verbs

For some reason the man page didn't describe these verbs. Also remove
some references to udisksd(8) for the unmount and lock verbs.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoudisksctl: add 'smart-simulate' verb
David Zeuthen [Sat, 12 May 2012 16:07:33 +0000 (12:07 -0400)]
udisksctl: add 'smart-simulate' verb

This makes it a lot easier to simulate failing disks. Also add proper
polkit support so the user don't have to run it as root.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPost-release version bump to 1.98.0
David Zeuthen [Wed, 9 May 2012 18:00:18 +0000 (14:00 -0400)]
Post-release version bump to 1.98.0

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate NEWS for release
David Zeuthen [Wed, 9 May 2012 17:57:01 +0000 (13:57 -0400)]
Update NEWS for release

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoLoop: try writing to loop/autoclear sysfs file before LO_{GET,SET}_STATUS
David Zeuthen [Wed, 9 May 2012 17:34:11 +0000 (13:34 -0400)]
Loop: try writing to loop/autoclear sysfs file before LO_{GET,SET}_STATUS

This will only work if the following kernel patch is applied

 http://people.freedesktop.org/~david/linux-3.4.0-rc5+-loop-make-it-possible-to-set-autoclear-through-sysfs.patch

however with this patch it's now possible to set autoclear for loop
devices backed on files on FUSE filesystems - without this patch we'll
fail when doing LO_GET_STATUS64.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoSimplify loop device checking
David Zeuthen [Wed, 9 May 2012 16:54:03 +0000 (12:54 -0400)]
Simplify loop device checking

... and never automatically tear down loop devices.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUDisksCleanup: Remove stale entries when adding new ones
David Zeuthen [Wed, 9 May 2012 14:20:01 +0000 (10:20 -0400)]
UDisksCleanup: Remove stale entries when adding new ones

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate path to mounted-fs file in documentation
David Zeuthen [Wed, 9 May 2012 13:47:40 +0000 (09:47 -0400)]
Update path to mounted-fs file in documentation

It's been /run/udisks2, not /var/lib/udisks2, for a while now.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRevert "Add loop.autoclear option to Filesystem.Mount() method"
David Zeuthen [Fri, 4 May 2012 23:30:24 +0000 (19:30 -0400)]
Revert "Add loop.autoclear option to Filesystem.Mount() method"

Now that we have a Loop.SetAutoclear() method, this is no longer
needed.

This reverts commit 9a3939800e280efbac0efe22dca26799da894f4d.

12 years agoUDisksDaemon: rework wait_for_object_sync() method
David Zeuthen [Fri, 4 May 2012 21:04:42 +0000 (17:04 -0400)]
UDisksDaemon: rework wait_for_object_sync() method

Simpler and more intuitive this way. Also update all current users to
the new API and semantics.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUDisksDaemon: add get_objects() method
David Zeuthen [Fri, 4 May 2012 21:04:23 +0000 (17:04 -0400)]
UDisksDaemon: add get_objects() method

Mostly convenience to avoid casting and getting the object-manager.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoManager: wait for partitions to appear before returning in LoopSetup()
David Zeuthen [Fri, 4 May 2012 18:21:37 +0000 (14:21 -0400)]
Manager: wait for partitions to appear before returning in LoopSetup()

This is needed for the Disk Image Mounter when mounting all
filesystems in a partitioned disk image.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDaemon: Add new find_block_*() convenience methods
David Zeuthen [Fri, 4 May 2012 18:19:44 +0000 (14:19 -0400)]
Daemon: Add new find_block_*() convenience methods

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd work-around to show FS on CDs/USB sticks created using isohybrid
David Zeuthen [Thu, 3 May 2012 13:46:43 +0000 (09:46 -0400)]
Add work-around to show FS on CDs/USB sticks created using isohybrid

This happens at least in two cases - when using loop-devices with
LO_PARTSCAN and when dd(1)'ing the image to a USB stick.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoLoop: add SetupByUID property
David Zeuthen [Thu, 3 May 2012 12:55:36 +0000 (08:55 -0400)]
Loop: add SetupByUID property

This is useful in GVfs where we don't want to show loop devices set up
by other users.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUDisksClient: add get_loop_for_block() convenience method
David Zeuthen [Thu, 3 May 2012 12:55:28 +0000 (08:55 -0400)]
UDisksClient: add get_loop_for_block() convenience method

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoWarn if /run/udisks2/loop has an existing entry when setting up a new loop device
David Zeuthen [Thu, 3 May 2012 12:54:28 +0000 (08:54 -0400)]
Warn if /run/udisks2/loop has an existing entry when setting up a new loop device

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoManager: Add locking around LoopSetup()
David Zeuthen [Tue, 1 May 2012 23:58:12 +0000 (19:58 -0400)]
Manager: Add locking around LoopSetup()

Surprisingly, contention did happen when trying to attach 20-some disk
images in a row.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoManager: Add new 'no-part-scan' option in LoopSetup() method
David Zeuthen [Tue, 1 May 2012 23:46:05 +0000 (19:46 -0400)]
Manager: Add new 'no-part-scan' option in LoopSetup() method

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix up how we check if use is authorized for Loop.SetAutoclear()
David Zeuthen [Tue, 1 May 2012 22:02:24 +0000 (18:02 -0400)]
Fix up how we check if use is authorized for Loop.SetAutoclear()

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDon't assign the Loop D-Bus interface to partitions of a loop device
David Zeuthen [Tue, 1 May 2012 22:01:34 +0000 (18:01 -0400)]
Don't assign the Loop D-Bus interface to partitions of a loop device

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoLoop: add :Autoclear property and SetAutoclear() method
David Zeuthen [Tue, 1 May 2012 04:05:21 +0000 (00:05 -0400)]
Loop: add :Autoclear property and SetAutoclear() method

Also add some UI in Disks for this

 http://people.freedesktop.org/~david/disks-loop-autoclear-switch.png

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAlso check for "target is busy" when checking umount(8) output
David Zeuthen [Mon, 30 Apr 2012 21:29:22 +0000 (17:29 -0400)]
Also check for "target is busy" when checking umount(8) output

Apparently this changed recently... ideally umount(8) would simply
return a well-defined exit code but that's not the way things work
right now.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd loop.autoclear option to Filesystem.Mount() method
David Zeuthen [Mon, 30 Apr 2012 20:59:53 +0000 (16:59 -0400)]
Add loop.autoclear option to Filesystem.Mount() method

The main user of this could be the desktop shell / file manager
offering a "Attach Disk Image" option for e.g. ISO files - it would
first use Manager.LoopSetup() and then, on the returned block device,
invoke Filesystem.Mount() with this new option (assuming the returned
loop device has any interesting content). With this, the file manager
need not worry about the loop device - it goes away as soon as the
filesystem is unmounted.

Why is this an option to Filesystem.Mount() and not Manager.LoopSetup()?
Because right after setting up the loop device, the OS opens the
device so it can populate the udev database with the detected contents
of the newly created loop device and also to maintain symlinks in the
/dev/disk tree. If we had created the loop device with LO_AUTOCLEAR
the kernel would clear the loop device right after blkid(8) closes the
device. However, if we set the flag after successfully mounting the
file system on the loop device, there is already a single reference to
the block device.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPost-release version bump to 1.97.0
David Zeuthen [Mon, 30 Apr 2012 19:23:07 +0000 (15:23 -0400)]
Post-release version bump to 1.97.0

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate NEWS for release
David Zeuthen [Mon, 30 Apr 2012 19:20:28 +0000 (15:20 -0400)]
Update NEWS for release

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoActually link with libsystemd-login
David Zeuthen [Mon, 30 Apr 2012 18:53:59 +0000 (14:53 -0400)]
Actually link with libsystemd-login

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPost-release version bump to 1.96.0
David Zeuthen [Mon, 30 Apr 2012 18:33:47 +0000 (14:33 -0400)]
Post-release version bump to 1.96.0

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate NEWS for release
David Zeuthen [Mon, 30 Apr 2012 18:27:36 +0000 (14:27 -0400)]
Update NEWS for release

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMinor doc fixes
David Zeuthen [Mon, 30 Apr 2012 18:20:29 +0000 (14:20 -0400)]
Minor doc fixes

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRemove unused .filesystem-unmount-others-shared polkit action
David Zeuthen [Mon, 30 Apr 2012 17:58:31 +0000 (13:58 -0400)]
Remove unused .filesystem-unmount-others-shared polkit action

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRemove support for ID_SEAT=all
David Zeuthen [Mon, 30 Apr 2012 17:13:50 +0000 (13:13 -0400)]
Remove support for ID_SEAT=all

We might bring this back in one shape or the other, but remove it for
now until I get a chance to talk to Kay and Lennart some more.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd Transifex config and pull latest translations
David Zeuthen [Mon, 30 Apr 2012 16:53:20 +0000 (12:53 -0400)]
Add Transifex config and pull latest translations

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRemove danish translation
David Zeuthen [Mon, 30 Apr 2012 15:23:36 +0000 (11:23 -0400)]
Remove danish translation

We'll get this from Transifex going forward.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMake $(udisks2.device) in authentication messages include the vendor/model
David Zeuthen [Sun, 29 Apr 2012 19:54:45 +0000 (15:54 -0400)]
Make $(udisks2.device) in authentication messages include the vendor/model

... if available. Here's an example of what it looks like

 http://people.freedesktop.org/~david/udisks2-detailed-auth-message.png

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd some more translation context and strings
David Zeuthen [Fri, 27 Apr 2012 18:22:45 +0000 (14:22 -0400)]
Add some more translation context and strings

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd a bunch of translation comments
David Zeuthen [Fri, 27 Apr 2012 16:52:02 +0000 (12:52 -0400)]
Add a bunch of translation comments

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoReword parts of the udisks(8) man page
David Zeuthen [Tue, 24 Apr 2012 20:03:51 +0000 (16:03 -0400)]
Reword parts of the udisks(8) man page

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix typo
David Zeuthen [Mon, 23 Apr 2012 20:51:04 +0000 (16:51 -0400)]
Fix typo

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd separate polkit actions for ejecting media
David Zeuthen [Mon, 23 Apr 2012 20:45:25 +0000 (16:45 -0400)]
Add separate polkit actions for ejecting media

It's a little weird to overload the modify-device action especially
since this doesn't change any bits on the media.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix typos in policy file
David Zeuthen [Mon, 23 Apr 2012 20:44:49 +0000 (16:44 -0400)]
Fix typos in policy file

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd missing "on" in udisks(8) man page
David Zeuthen [Mon, 23 Apr 2012 19:16:26 +0000 (15:16 -0400)]
Add missing "on" in udisks(8) man page

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRemove section about ID_DRIVE* properties
David Zeuthen [Mon, 23 Apr 2012 19:09:51 +0000 (15:09 -0400)]
Remove section about ID_DRIVE* properties

It is really inappropriate to mention these here. Instead these
properties should be mentioned in the udev docs, along with other key
properties such as ID_FS_TYPE, ID_MODEL, ID_VENDOR, ID_WWN, ID_CDROM*
and so on. I've talked to Kay about this several times and he seems to
agree, just needs to happen.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUse upper-case for all man page sections
David Zeuthen [Mon, 23 Apr 2012 18:58:55 +0000 (14:58 -0400)]
Use upper-case for all man page sections

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoudisksctl: Make man page point to API STABILITY section of udisks(8) man page
David Zeuthen [Mon, 23 Apr 2012 18:57:25 +0000 (14:57 -0400)]
udisksctl: Make man page point to API STABILITY section of udisks(8) man page

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMove API STABILITY remarks to udisks(8) man page
David Zeuthen [Mon, 23 Apr 2012 18:51:14 +0000 (14:51 -0400)]
Move API STABILITY remarks to udisks(8) man page

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMove audience blurb from README to the udisks(8) man page
David Zeuthen [Mon, 23 Apr 2012 18:12:27 +0000 (14:12 -0400)]
Move audience blurb from README to the udisks(8) man page

Also point people there from README.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRearrange docs so man pages come first
David Zeuthen [Mon, 23 Apr 2012 17:47:54 +0000 (13:47 -0400)]
Rearrange docs so man pages come first

In particular, ensure that the udisks(8) man page comes first and use
"Introduction to udisks" as its purpose.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix 'make distcheck'
David Zeuthen [Mon, 23 Apr 2012 17:35:38 +0000 (13:35 -0400)]
Fix 'make distcheck'

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd section about polkit actions to the docs
David Zeuthen [Mon, 23 Apr 2012 17:23:38 +0000 (13:23 -0400)]
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 <davidz@redhat.com>
12 years agoInterpret ID_SEAT=all to mean that a device is available on all seats
David Zeuthen [Sun, 22 Apr 2012 15:50:42 +0000 (11:50 -0400)]
Interpret ID_SEAT=all to mean that a device is available on all seats

This changes a couple of things

 - when mounting the device, we use different defaults so other users can
   access the filesystem too. We also mount the device in /media, not
   /run/media/$USER (unless an /etc/fstab entry exists for the device,
   of course)

 - if the drive is shared, we allow other users to unmount a
   filesystem mounted by another user (through a new polkit action)

 - we need to serialize multiple concurrent mount requests so we don't
   end up mounting the device twice... with this change, one one of the
   requests will succeed, the other one will get the AlreadyMounted error

   (basically, add locking, we needed that anyway .. it just only
   became apparent with this change because multiple sessions tried to
   mount the shared drive.)

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix reference count mistake in previous commit
David Zeuthen [Sun, 22 Apr 2012 14:12:12 +0000 (10:12 -0400)]
Fix reference count mistake in previous commit

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMake on_same_seat() also work for drive objects
David Zeuthen [Sun, 22 Apr 2012 14:07:23 +0000 (10:07 -0400)]
Make on_same_seat() also work for drive objects

Otherwise it won't work when used for the Drive.Eject() method which
operates on a Drive object instead of a Block object.

Also use Drive:seat instead of peeking into the udev database.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd versioning macros
David Zeuthen [Sat, 21 Apr 2012 16:19:51 +0000 (12:19 -0400)]
Add versioning macros

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd multi-seat support
David Zeuthen [Sat, 21 Apr 2012 15:31:35 +0000 (11:31 -0400)]
Add multi-seat support

The first change is that we require additional authorization to
mount/unlock/modify a device, if it is on another seat than the
caller.

The other change is that we export the seat id as a property on the
org.freedesktop.UDisks2.Drive D-Bus interface. This can be used by
auto-mounter infrastructure (such as GVfs) to hint that a device
should not be automatically mounted unless it's plugged into the same
seat as where the environment is running.

All this is based on the libsystemd-login library - if this library is
not available at build-time, multi-seat support will not be enabled.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoWork around missing serial/wwn on VMware hard disks
David Zeuthen [Fri, 20 Apr 2012 21:45:47 +0000 (17:45 -0400)]
Work around missing serial/wwn on VMware hard disks

This is pretty much like how we work around the same for VirtIO so it
looks like a hard disk instead of a fake block device.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUse libacl library instead of setfacl(1)
David Zeuthen [Fri, 20 Apr 2012 13:33:08 +0000 (09:33 -0400)]
Use libacl library instead of setfacl(1)

https://bugs.freedesktop.org/show_bug.cgi?id=48842

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate link to GVolumeMonitor docs
David Zeuthen [Thu, 19 Apr 2012 17:12:52 +0000 (13:12 -0400)]
Update link to GVolumeMonitor docs

Stable/unstable in GLib means something completely different from what
we are discussing here, so to avoid confusion, point to the stable API
docs for GVolumeMonitor, not the unstable ones.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMention udisks audience (and non-audience) in README
David Zeuthen [Thu, 19 Apr 2012 16:27:54 +0000 (12:27 -0400)]
Mention udisks audience (and non-audience) in README

See https://plus.google.com/u/0/110773474140772402317/posts/eeJF4AHoh7a
for why this is a good idea.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPost-release version bump to 1.95.0
David Zeuthen [Tue, 10 Apr 2012 19:43:45 +0000 (15:43 -0400)]
Post-release version bump to 1.95.0

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate NEWS for release
David Zeuthen [Tue, 10 Apr 2012 19:40:24 +0000 (15:40 -0400)]
Update NEWS for release

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMake escaping work properly with non-ASCII UTF-8 strings
David Zeuthen [Tue, 10 Apr 2012 16:05:24 +0000 (12:05 -0400)]
Make escaping work properly with non-ASCII UTF-8 strings

Basically, we need to only unescape \ and " otherwise things won't
work with non-ASCII characters.

https://bugs.freedesktop.org/show_bug.cgi?id=48502

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd udev rules for identifying devices which should not be shown
David Zeuthen [Mon, 9 Apr 2012 16:41:44 +0000 (12:41 -0400)]
Add udev rules for identifying devices which should not be shown

Copied from udisks1 branch, see

 http://cgit.freedesktop.org/udisks/tree/data/80-udisks.rules?h=udisks1&id=1.0.4#n178

and adjusted to use the partition properties set by blkid and to use
UDISKS_IGNORE instead of UDISKS_PRESENTATION_HIDE.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix unmounting large disks when not asked to
Edward Sheldrake [Sun, 1 Apr 2012 14:58:08 +0000 (15:58 +0100)]
Fix unmounting large disks when not asked to

udisks2 was "Cleaning up mount point" claiming the device no longer existed.
Disk size may be larger than INT_MAX for large disks.

https://bugs.freedesktop.org/show_bug.cgi?id=48155

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoConvert some g_warning() uses to udisks_warning()
David Zeuthen [Tue, 13 Mar 2012 21:43:41 +0000 (17:43 -0400)]
Convert some g_warning() uses to udisks_warning()

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoChange some D-Bus types from bytestring ('ay') to UTF8 ('s')
David Zeuthen [Tue, 13 Mar 2012 21:29:55 +0000 (17:29 -0400)]
Change some D-Bus types from bytestring ('ay') to UTF8 ('s')

We are 100% sure that the changed items are always UTF-8 especially
because udisks_device_udev_string() guarantees this and this function
is used before setting the affected properties.

This breaks the D-Bus API but there is no change in the libudisks2.so
ABI since byte-strings and UTF-8 strings are mapped the same way when
GDBus is being used. It may require restarting the system, but apart
from that there is minimal interference from this change.

The remaining byte-strings in the API are things that either comes
from configuration files (such as /etc/fstab and /etc/crypttab), the
kernel (e.g. sysfs paths) or udev rules (e.g. device symlinks). We
could require UTF-8 here and just reject items that are not valid
UTF-8 but there's really no point in that.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoClarify docs for Filesystem.Mount() and Filesystem.Unmount()
David Zeuthen [Tue, 13 Mar 2012 18:49:43 +0000 (14:49 -0400)]
Clarify docs for Filesystem.Mount() and Filesystem.Unmount()

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate docs
David Zeuthen [Tue, 13 Mar 2012 17:06:27 +0000 (13:06 -0400)]
Update docs

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix how we sign the tarballs
David Zeuthen [Sat, 10 Mar 2012 20:02:00 +0000 (15:02 -0500)]
Fix how we sign the tarballs

This mistake was pointed out by Adam Sampson <ats@offog.org>, thanks
for noticing!

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPass --readonly to cryptsetup(8) if device to unlock is read-only
David Zeuthen [Mon, 5 Mar 2012 22:55:48 +0000 (17:55 -0500)]
Pass --readonly to cryptsetup(8) if device to unlock is read-only

With this fix, locked SD cards with LUKS now work.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPost-release version bump to 1.94.0
David Zeuthen [Mon, 5 Mar 2012 17:28:08 +0000 (12:28 -0500)]
Post-release version bump to 1.94.0

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate NEWS for release
David Zeuthen [Mon, 5 Mar 2012 17:25:16 +0000 (12:25 -0500)]
Update NEWS for release

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoTweak the docs some
David Zeuthen [Mon, 5 Mar 2012 17:23:40 +0000 (12:23 -0500)]
Tweak the docs some

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoProperly escape all device files
David Zeuthen [Mon, 5 Mar 2012 17:02:24 +0000 (12:02 -0500)]
Properly escape all device files

At least in the default install, udev never includes a space or quote
in the device file but better safe than sorry.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoEnsure that the loop file name we pass to the kernel is always NUL-terminated
David Zeuthen [Mon, 5 Mar 2012 16:04:12 +0000 (11:04 -0500)]
Ensure that the loop file name we pass to the kernel is always NUL-terminated

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoEnsure that whatever we pass as -t to mount(8) is in a whitelist
David Zeuthen [Thu, 1 Mar 2012 17:06:34 +0000 (12:06 -0500)]
Ensure that whatever we pass as -t to mount(8) is in a whitelist

IOW, ensure that you can't pass e.g. 'nfs../blah' to load the whole NFS
stack. Now we error out, like this

 $ udisksctl mount --block-device /dev/sdc3 -t nfs../blah
 Error mounting /dev/sdc3: GDBus.Error:org.freedesktop.UDisks2.Error.OptionNotPermitted: Requested filesystem type `nfs../blah' is neither well-known nor in /proc/filesystems nor in /etc/filesystems

This is a bug that was already fixed for udisks 1.x, see

 https://bugs.freedesktop.org/show_bug.cgi?id=32232
 CVE-2010-4661: Arbitrary kernel module load

But we apparently forgot to fix this in the move from udisks 1.x to
2.x. Pointed out by Sebastian Krahmer <krahmer@suse.de>, thanks!

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoForce MediaRemovable to TRUE for e.g. SD cards using the mmc layer
David Zeuthen [Fri, 24 Feb 2012 20:29:23 +0000 (15:29 -0500)]
Force MediaRemovable to TRUE for e.g. SD cards using the mmc layer

Otherwise udisks_client_get_drive_info() will return

 drive-removable-media-flash-sd

for /dev/mmcblk0p1 instead of

 media-flash-sd

and we want the latter.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRun gtkdoc-rebase to fix up links for GLib types
David Zeuthen [Fri, 24 Feb 2012 14:50:55 +0000 (09:50 -0500)]
Run gtkdoc-rebase to fix up links for GLib types

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd a section about /org/freedesktop/UDisks2/jobs/* objects
David Zeuthen [Fri, 24 Feb 2012 14:33:02 +0000 (09:33 -0500)]
Add a section about /org/freedesktop/UDisks2/jobs/* objects

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd a section about /org/freedesktop/UDisks2/drives/* objects
David Zeuthen [Fri, 24 Feb 2012 14:32:11 +0000 (09:32 -0500)]
Add a section about /org/freedesktop/UDisks2/drives/* objects

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoReword the section about block device objects a little bit
David Zeuthen [Fri, 24 Feb 2012 14:20:12 +0000 (09:20 -0500)]
Reword the section about block device objects a little bit

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd a section about /org/freedesktop/UDisks2/block_devices/* objects
David Zeuthen [Thu, 23 Feb 2012 23:16:06 +0000 (18:16 -0500)]
Add a section about /org/freedesktop/UDisks2/block_devices/* objects

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDon't include sys/acl.h - it's not needed
David Zeuthen [Thu, 23 Feb 2012 18:47:54 +0000 (13:47 -0500)]
Don't include sys/acl.h - it's not needed

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPost-release version bump to 1.93.0
David Zeuthen [Thu, 23 Feb 2012 18:39:10 +0000 (13:39 -0500)]
Post-release version bump to 1.93.0

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate NEWS for release
David Zeuthen [Thu, 23 Feb 2012 18:34:26 +0000 (13:34 -0500)]
Update NEWS for release

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMove to /usr-only setup and get rid of hardcoded paths to /lib and sbin
David Zeuthen [Wed, 22 Feb 2012 22:56:21 +0000 (17:56 -0500)]
Move to /usr-only setup and get rid of hardcoded paths to /lib and sbin

With the whole OS in /usr, tricks like these are no longer
needed. Howver, distros with different content in e.g. /sbin and
/usr/sbin will have to move things like the /usr/sbin/umount.udisks2
binary themselves etc.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoclient: Fix bit shifts of flags on 32 bit
Colin Walters [Wed, 22 Feb 2012 22:00:02 +0000 (17:00 -0500)]
client: Fix bit shifts of flags on 32 bit

Also, the flags should be unsigned, not signed.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUse /run/media/$USER for mounting
David Zeuthen [Wed, 22 Feb 2012 21:52:48 +0000 (16:52 -0500)]
Use /run/media/$USER for mounting

Also use ACLs on the $USER sub-directory so only $USER (and not any
other user) can access the mounted filesystem.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDon't free object twice when deleting a loop device
David Zeuthen [Wed, 22 Feb 2012 19:00:48 +0000 (14:00 -0500)]
Don't free object twice when deleting a loop device

Duh!

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAvoid using $XDG_RUNTIME_DIR/media for now
David Zeuthen [Wed, 22 Feb 2012 15:34:16 +0000 (10:34 -0500)]
Avoid using $XDG_RUNTIME_DIR/media for now

Needs a bit more thought on the security side.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPost-release version bump to version 1.92.0
David Zeuthen [Mon, 6 Feb 2012 19:19:23 +0000 (14:19 -0500)]
Post-release version bump to version 1.92.0

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate NEWS for release
David Zeuthen [Mon, 6 Feb 2012 19:07:18 +0000 (14:07 -0500)]
Update NEWS for release

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix a couple of uninitialized warnings and simplify SMART self-test handling
David Zeuthen [Fri, 27 Jan 2012 18:00:00 +0000 (13:00 -0500)]
Fix a couple of uninitialized warnings and simplify SMART self-test handling

In particular, this fixes a crash when running a SMART self-test on a
drive and then yanking it.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoShut up valgrind complaing about LOOP_GET_STATUS64 ioctl
David Zeuthen [Fri, 27 Jan 2012 17:43:54 +0000 (12:43 -0500)]
Shut up valgrind complaing about LOOP_GET_STATUS64 ioctl

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUse g_dbus_interface_dup_object() and check return value
David Zeuthen [Thu, 26 Jan 2012 22:53:54 +0000 (17:53 -0500)]
Use g_dbus_interface_dup_object() and check return value

This fixes potential (multi-threading related) problems where the
GDBusObject is removed just before or in the middle of handling a
call. Also bump required GLib version to (unreleased) 2.31.13 since
that's the version this API was introduced in.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDo coldplug for block devices twice
David Zeuthen [Thu, 26 Jan 2012 16:07:45 +0000 (11:07 -0500)]
Do coldplug for block devices twice

Otherwise we may miss some associations between LUKS devices and other
block devices. This bug only became evident once we started sorting
block devices before processing them.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMake sure that Drive:SortKey sorts e.g. sdz before sdaa
David Zeuthen [Thu, 26 Jan 2012 16:04:47 +0000 (11:04 -0500)]
Make sure that Drive:SortKey sorts e.g. sdz before sdaa

Also make sure that we e.g. process sdb before sdad to get
Drive:SortKey set using sdb rather than sdad.

With this change we get the expected output that corresponds to kernel
probing order. Which (on good days) may correspond to slot and
enclosure order.

MODEL                     REVISION  SERIAL               DEVICE
--------------------------------------------------------------------------
HP LOGICAL VOLUME         3.00      5001438008F61790     sda
SEAGATE ST3300657SS       0006      3SJ1S7K600009051M0CE sdad sdb
SEAGATE ST3300657SS       0006      3SJ1S4MH00009052RG6Z sdae sdc
SEAGATE ST3300657SS       0006      3SJ1RFP900009051HZ5S sdaf sdd
SEAGATE ST3300657SS       0006      3SJ1S66L00009052QGZA sdag sde
SEAGATE ST3300657SS       0006      3SJ1RPFJ00009052BZ10 sdah sdf
SEAGATE ST3300657SS       0006      3SJ1RWZ100009101T12H sdai sdg
SEAGATE ST3300657SS       0006      3SJ1S7C500009052RKPP sdaj sdh
SEAGATE ST3300657SS       0006      3SJ1S40K00009101T1XU sdak sdi
SEAGATE ST3300657SS       0006      3SJ1RJS700009050VYEA sdal sdj
SEAGATE ST3300657SS       0006      3SJ1RSJC00009052MWTB sdam sdk
SEAGATE ST3300657SS       0006      3SJ1QNMQ00009052NECM sdan sdl
SEAGATE ST3300657SS       0006      3SJ1S3NE00009101TB5Y sdao sdm
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30012560      sdn
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30064749      sdo
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30039741      sdp
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30064055      sdq
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30030732      sdr
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30010853      sds
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30024753      sdt
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30065104      sdu
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30031826      sdv
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30025874      sdw
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30063724      sdx
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30064486      sdy
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30032003      sdz
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30021345      sdaa
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30067287      sdab
WDC WD1002FAEX-00Y9A0     01.01V10  WD-WCAW30014347      sdac

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoudisksctl: sort the drives using Drive:SortKey for 'status' verb
David Zeuthen [Thu, 26 Jan 2012 15:08:24 +0000 (10:08 -0500)]
udisksctl: sort the drives using Drive:SortKey for 'status' verb

Signed-off-by: David Zeuthen <davidz@redhat.com>