platform/upstream/udisks2.git
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>
12 years agoudisksctl: nuke PORT column in output of 'status' verb
David Zeuthen [Thu, 26 Jan 2012 15:03:03 +0000 (10:03 -0500)]
udisksctl: nuke PORT column in output of 'status' verb

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoWith /media and /run on tmfs, switch to temporary store for mounted-fs
David Zeuthen [Wed, 25 Jan 2012 22:18:31 +0000 (17:18 -0500)]
With /media and /run on tmfs, switch to temporary store for mounted-fs

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPrefer mounting in /run/user/$USER/media instead of /media
David Zeuthen [Wed, 25 Jan 2012 22:16:24 +0000 (17:16 -0500)]
Prefer mounting in /run/user/$USER/media instead of /media

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix .gir make dependencies
Martin Pitt [Wed, 25 Jan 2012 10:51:23 +0000 (11:51 +0100)]
Fix .gir make dependencies

Make UDisks-2.0.gir build depend on libudisks2.la. This fixes parallel builds,
as well as ensures that the gir/typelibs are updated on any code change that
affects the library.

12 years agoFor mount options, switch from comment=udisks to x-udisks
David Zeuthen [Tue, 24 Jan 2012 21:40:44 +0000 (16:40 -0500)]
For mount options, switch from comment=udisks to x-udisks

Recent util-linux (2.21+) supports any x-* option.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix 'make distcheck'
David Zeuthen [Tue, 24 Jan 2012 17:19:01 +0000 (12:19 -0500)]
Fix 'make distcheck'

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate POTFILES.in
David Zeuthen [Tue, 24 Jan 2012 17:09:34 +0000 (12:09 -0500)]
Update POTFILES.in

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUse gobject-introspection Makefile
David Zeuthen [Tue, 24 Jan 2012 17:08:13 +0000 (12:08 -0500)]
Use gobject-introspection Makefile

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd targets for release management
David Zeuthen [Tue, 24 Jan 2012 16:57:15 +0000 (11:57 -0500)]
Add targets for release management

Right now it's hard-coded for me but we can change that later if
needed etc.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd Transifex URL to README file
David Zeuthen [Mon, 23 Jan 2012 22:31:24 +0000 (17:31 -0500)]
Add Transifex URL to README file

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd Danish translation
David Zeuthen [Mon, 23 Jan 2012 21:36:45 +0000 (16:36 -0500)]
Add Danish translation

This is just to check that the translations are actually being used
properly.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMove polkit .policy file from policy/ to data/
David Zeuthen [Mon, 23 Jan 2012 21:12:07 +0000 (16:12 -0500)]
Move polkit .policy file from policy/ to data/

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAlso update the error name in D-Bus docs
David Zeuthen [Mon, 23 Jan 2012 13:32:08 +0000 (08:32 -0500)]
Also update the error name in D-Bus docs

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUse org.freedesktop.UDisks2.* for errors, not org.freedesktop.UDisks.*
David Zeuthen [Sun, 22 Jan 2012 18:02:47 +0000 (13:02 -0500)]
Use org.freedesktop.UDisks2.* for errors, not org.freedesktop.UDisks.*

This will break apps using the D-Bus library but will not break apps
using the libudisks2 library.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix up doc page
David Zeuthen [Sun, 22 Jan 2012 17:10:28 +0000 (12:10 -0500)]
Fix up doc page

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRemove copyright and license from docs and add link to online docs
David Zeuthen [Sun, 22 Jan 2012 16:36:35 +0000 (11:36 -0500)]
Remove copyright and license from docs and add link to online docs

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd 2012 to copyright years
David Zeuthen [Sun, 22 Jan 2012 16:29:02 +0000 (11:29 -0500)]
Add 2012 to copyright years

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRename systemd service to udisks2 and fix a couple of typos
David Zeuthen [Sat, 21 Jan 2012 22:12:39 +0000 (17:12 -0500)]
Rename systemd service to udisks2 and fix a couple of typos

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoInstall a systemd service file if systemd is used
Benedikt Morbach [Thu, 19 Jan 2012 18:10:38 +0000 (19:10 +0100)]
Install a systemd service file if systemd is used

This makes dbus defer starting udisks to systemd instead of doing it
itself and thus puts the daemon under proper systemd supervision.

Can be disabled by passing --without-systemdsystemunitdir to configure

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix use of memset(3)
David Zeuthen [Sat, 21 Jan 2012 21:45:50 +0000 (16:45 -0500)]
Fix use of memset(3)

Pointed out here https://bugs.freedesktop.org/show_bug.cgi?id=45039

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoEnsure PATH is set
David Zeuthen [Sat, 21 Jan 2012 21:26:46 +0000 (16:26 -0500)]
Ensure PATH is set

Apparently PATH may be empty if activated by recent D-Bus daemons.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPost-release version bump to version 1.91.0
David Zeuthen [Fri, 20 Jan 2012 21:44:50 +0000 (16:44 -0500)]
Post-release version bump to version 1.91.0

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate NEWS for release
David Zeuthen [Fri, 20 Jan 2012 21:38:56 +0000 (16:38 -0500)]
Update NEWS for release

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix typos in udisks(8) man page and reword a couple of things
David Zeuthen [Fri, 20 Jan 2012 18:08:11 +0000 (13:08 -0500)]
Fix typos in udisks(8) man page and reword a couple of things

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoClarify access control rules in udisks(8) man page
David Zeuthen [Fri, 20 Jan 2012 17:39:02 +0000 (12:39 -0500)]
Clarify access control rules in udisks(8) man page

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix hints for PC floppy drives
David Zeuthen [Fri, 20 Jan 2012 16:12:19 +0000 (11:12 -0500)]
Fix hints for PC floppy drives

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDon't accept a blank options string when adding/updating fstab entries
David Zeuthen [Thu, 19 Jan 2012 18:36:22 +0000 (13:36 -0500)]
Don't accept a blank options string when adding/updating fstab entries

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoChange how devices referenced in /etc/fstab and /etc/crypttab are handled
David Zeuthen [Thu, 19 Jan 2012 15:22:31 +0000 (10:22 -0500)]
Change how devices referenced in /etc/fstab and /etc/crypttab are handled

Hitherto we've required extra authorization (typically requiring the
user to authenticate as root) if a device is referenced in fstab or
crypttab and this actually limits the utility of these files -
e.g. why should the user need to authenticate as root just because
there are options in the fstab entry for the device? In fact, this
behavior is so annoying that people use e.g. the 'users' option for a
device which opens up extra security hole insofar that remote users
can now access the device.

Therefore, change the behavior so we treat fstab and crypttab devices
just like any other device, e.g. require the filesystem and
filesystem-system authorizations.

We also introduce options comment=udisks-auth [1] and x-udisks-auth
that can be used in fstab and crypttab respectively to force admin
authentication (the polkit actions in question are filesystem-fstab
encrypted-unlock-crypttab).

This has also been hooked up in GNOME's Disks
application

 http://people.freedesktop.org/~david/udisks-fstab-option-udisks-auth.png
 http://people.freedesktop.org/~david/udisks-crypttab-option-x-udisks-auth.png

Also mention this behavior in the udisks(8) man page.

Note that if a device is mounted at start-up, a user just can't
willy-nilly unmount the device - by default, he will still need to
authenticate as root in order to unmount the device (the polkit
action in question is 'filesystem-unmount-others')

[1] : this will be changed to x-udisks-auth when a future util-linux
release supporting arbitrary x-* options lands

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoJust call it "fstab device" instead of "non-user fstab device"
David Zeuthen [Wed, 18 Jan 2012 20:59:31 +0000 (15:59 -0500)]
Just call it "fstab device" instead of "non-user fstab device"

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd some safe and useful ntfs-3g allowed mount options
Martin Pitt [Wed, 18 Jan 2012 06:26:13 +0000 (07:26 +0100)]
Add some safe and useful ntfs-3g allowed mount options

12 years agoRemove invalid assertion that all managed mounts are in /media
David Zeuthen [Tue, 17 Jan 2012 21:59:58 +0000 (16:59 -0500)]
Remove invalid assertion that all managed mounts are in /media

This is not true as we support mounting items referenced in /etc/fstab.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDon't set Drive:Ejectable to TRUE for floppy drives
David Zeuthen [Tue, 10 Jan 2012 21:31:17 +0000 (16:31 -0500)]
Don't set Drive:Ejectable to TRUE for floppy drives

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdjust sort-key calculation
David Zeuthen [Tue, 10 Jan 2012 21:15:48 +0000 (16:15 -0500)]
Adjust sort-key calculation

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix up how Drive:SortKey and Drive:TimeMediaDetected is calculated
David Zeuthen [Tue, 10 Jan 2012 21:01:35 +0000 (16:01 -0500)]
Fix up how Drive:SortKey and Drive:TimeMediaDetected is calculated

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd work-around for kernel devices not going on media removal if mounted
David Zeuthen [Fri, 6 Jan 2012 20:08:56 +0000 (15:08 -0500)]
Add work-around for kernel devices not going on media removal if mounted

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUse reading/writing instead of backup/restore in authentication prompts
David Zeuthen [Thu, 5 Jan 2012 19:56:28 +0000 (14:56 -0500)]
Use reading/writing instead of backup/restore in authentication prompts

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd convenience routines to get block devices by label and uuid
David Zeuthen [Thu, 5 Jan 2012 19:09:07 +0000 (14:09 -0500)]
Add convenience routines to get block devices by label and uuid

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix escaping issues when handling LABEL= and UUID= entries in fstab and crypttab
David Zeuthen [Thu, 5 Jan 2012 18:30:56 +0000 (13:30 -0500)]
Fix escaping issues when handling LABEL= and UUID= entries in fstab and crypttab

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoNuke debug spew
David Zeuthen [Mon, 12 Dec 2011 15:14:12 +0000 (10:14 -0500)]
Nuke debug spew

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd some more thumb drive matches
David Zeuthen [Fri, 9 Dec 2011 19:30:50 +0000 (14:30 -0500)]
Add some more thumb drive matches

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoSupport new ID_DRIVE_THUMB udev property and 'thumb' media type
David Zeuthen [Fri, 9 Dec 2011 19:22:07 +0000 (14:22 -0500)]
Support new ID_DRIVE_THUMB udev property and 'thumb' media type

This will also set Drive:Removable to FALSE to override what the
hardware (wrongly) reports. So also add new Drive:Ejectable property
since we still want to display an Eject icon for thumb drives.

Use the icon 'media-removable' for drives of this type.

http://people.freedesktop.org/~david/gdu2-ID_DRIVE_THUMB-support.png

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoForce ReadOnly to TRUE for optical drives
David Zeuthen [Fri, 9 Dec 2011 17:08:35 +0000 (12:08 -0500)]
Force ReadOnly to TRUE for optical drives

At least do this until the kernel sets the 'ro' property properly.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix loop device cleanup if backing device is not known
David Zeuthen [Wed, 7 Dec 2011 21:19:13 +0000 (16:19 -0500)]
Fix loop device cleanup if backing device is not known

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDon't fail LoopSetup() because fstat(2) fails
David Zeuthen [Wed, 7 Dec 2011 21:09:03 +0000 (16:09 -0500)]
Don't fail LoopSetup() because fstat(2) fails

With this change, this method now works with fds from a GVfs FUSE
mount (where not even uid 0 may open files on).

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd Encrypted.ChangePassphrase() method
David Zeuthen [Wed, 7 Dec 2011 16:59:35 +0000 (11:59 -0500)]
Add Encrypted.ChangePassphrase() method

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix up docs
David Zeuthen [Wed, 7 Dec 2011 16:59:07 +0000 (11:59 -0500)]
Fix up docs

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd Block.OpenForRestore() method
David Zeuthen [Mon, 5 Dec 2011 18:16:54 +0000 (13:16 -0500)]
Add Block.OpenForRestore() method

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd Block.OpenForBackup() method used for creating disk images
David Zeuthen [Thu, 1 Dec 2011 17:19:04 +0000 (12:19 -0500)]
Add Block.OpenForBackup() method used for creating disk images

See

 http://people.freedesktop.org/~david/gdu2-create-disk-image-1.png
 http://people.freedesktop.org/~david/gdu2-create-disk-image-2.png
 http://people.freedesktop.org/~david/gdu2-create-disk-image-3.png
 http://people.freedesktop.org/~david/gdu2-create-disk-image-4.png
 http://people.freedesktop.org/~david/gdu2-create-disk-image-5.png
 http://people.freedesktop.org/~david/gdu2-create-disk-image-6.png
 http://people.freedesktop.org/~david/gdu2-create-disk-image-7.png

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDon't cleanup loop devices if backing device has major 0
David Zeuthen [Tue, 29 Nov 2011 21:59:33 +0000 (16:59 -0500)]
Don't cleanup loop devices if backing device has major 0

E.g. NFS mounts.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix compile warning
David Zeuthen [Tue, 29 Nov 2011 21:59:18 +0000 (16:59 -0500)]
Fix compile warning

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUDisksCleanup: Nuke error handling from user-level API
David Zeuthen [Tue, 29 Nov 2011 14:43:44 +0000 (09:43 -0500)]
UDisksCleanup: Nuke error handling from user-level API

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoGreatly simplify cleanup logic and routines
David Zeuthen [Tue, 29 Nov 2011 14:19:29 +0000 (09:19 -0500)]
Greatly simplify cleanup logic and routines

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUse /etc/bash_completion.d, not /etc/profile.d for bash completion script
David Zeuthen [Mon, 28 Nov 2011 15:32:51 +0000 (10:32 -0500)]
Use /etc/bash_completion.d, not /etc/profile.d for bash completion script

Also use _DATA, not _SCRIPTS, to ensure that the installed file is not
executable.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agointegration tests: small simplification
Martin Pitt [Mon, 7 Nov 2011 06:08:11 +0000 (07:08 +0100)]
integration tests: small simplification

Introduce "no_options" constant for an empty options variant.

12 years agoUse non-deprecated mutex and thread primitives in GLib 2.31 and later
David Zeuthen [Wed, 23 Nov 2011 14:55:00 +0000 (09:55 -0500)]
Use non-deprecated mutex and thread primitives in GLib 2.31 and later

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd new Job:Objects property and set it
David Zeuthen [Tue, 22 Nov 2011 18:48:50 +0000 (13:48 -0500)]
Add new Job:Objects property and set it

This can be used to render spinners, e.g.

 http://people.freedesktop.org/~david/gdu2-spinners.png

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDon't distribute generated sources in tarballs
David Zeuthen [Tue, 22 Nov 2011 15:28:29 +0000 (10:28 -0500)]
Don't distribute generated sources in tarballs

... instead, insist that these sources are regenerated at build time.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate misc files
David Zeuthen [Tue, 22 Nov 2011 15:01:47 +0000 (10:01 -0500)]
Update misc files

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMove udisks man page to section 8
David Zeuthen [Tue, 22 Nov 2011 14:55:39 +0000 (09:55 -0500)]
Move udisks man page to section 8

... from section 7. This is to avoid conflicts with the udisks(7) man
page from udisks 1.x.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd shell-snippet showing how to update the ATA smart data
David Zeuthen [Mon, 21 Nov 2011 18:36:22 +0000 (13:36 -0500)]
Add shell-snippet showing how to update the ATA smart data

  gdbus call --system --dest org.freedesktop.UDisks2 \
             --object-path /org/freedesktop/UDisks2/drives/WDC_WD1002FAEX_00Y9A0_WD_WCAW30039835 \
             --method org.freedesktop.UDisks2.Drive.Ata.SmartUpdate \
             "{'atasmart_blob': <'$ATA_SMART_BLOB'>}"

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd new Block:HintPartitionable property
David Zeuthen [Wed, 16 Nov 2011 21:27:22 +0000 (16:27 -0500)]
Add new Block:HintPartitionable property

This can be used in the UI to determine if a "Format Disk" (to
e.g. create a partition table) button should be offered.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd ReadOnly property to the Block interface
David Zeuthen [Wed, 16 Nov 2011 16:10:38 +0000 (11:10 -0500)]
Add ReadOnly property to the Block interface

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoWipe device before formatting it
David Zeuthen [Tue, 15 Nov 2011 20:13:31 +0000 (15:13 -0500)]
Wipe device before formatting it

It's better to not trust various mkfs tools etc. to get it right.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoActually wait for the right object when formatting a block device
David Zeuthen [Tue, 15 Nov 2011 20:04:42 +0000 (15:04 -0500)]
Actually wait for the right object when formatting a block device

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAllow user to manipulate partitions of a loop device if he set it up
David Zeuthen [Mon, 14 Nov 2011 20:35:11 +0000 (15:35 -0500)]
Allow user to manipulate partitions of a loop device if he set it up

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUse LO_FLAGS_PARTSCAN when setting up a loop device
David Zeuthen [Mon, 14 Nov 2011 19:28:22 +0000 (14:28 -0500)]
Use LO_FLAGS_PARTSCAN when setting up a loop device

Actually, use its value of 8 until 3.2 has been out long enough for us
to require it to be available and installed when compiling the code.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPass UDisksObject so $(udisks2.device) is properly expanded
David Zeuthen [Mon, 14 Nov 2011 17:03:46 +0000 (12:03 -0500)]
Pass UDisksObject so $(udisks2.device) is properly expanded

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAllow creating partition tables with Block.Format()
David Zeuthen [Mon, 14 Nov 2011 16:44:58 +0000 (11:44 -0500)]
Allow creating partition tables with Block.Format()

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoSupport creating dos partitions
David Zeuthen [Thu, 10 Nov 2011 19:36:36 +0000 (14:36 -0500)]
Support creating dos partitions

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUDisksClient: add get_partitions() convenience method
David Zeuthen [Thu, 10 Nov 2011 18:08:54 +0000 (13:08 -0500)]
UDisksClient: add get_partitions() convenience method

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDon't support dos partitions of type 0x00
David Zeuthen [Wed, 9 Nov 2011 18:35:46 +0000 (13:35 -0500)]
Don't support dos partitions of type 0x00

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFor dos partitions of type 0, output 0x00, not 0x0
David Zeuthen [Wed, 9 Nov 2011 18:35:13 +0000 (13:35 -0500)]
For dos partitions of type 0, output 0x00, not 0x0

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRefuse to change partition type to an extended partition
David Zeuthen [Wed, 9 Nov 2011 18:17:19 +0000 (13:17 -0500)]
Refuse to change partition type to an extended partition

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoIntroduce UDisksPartitionTypeInfoFlags
David Zeuthen [Wed, 9 Nov 2011 16:52:44 +0000 (11:52 -0500)]
Introduce UDisksPartitionTypeInfoFlags

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoWhen creating a partition, ensure size is a multiple of 512
David Zeuthen [Wed, 9 Nov 2011 16:40:22 +0000 (11:40 -0500)]
When creating a partition, ensure size is a multiple of 512

Also account for parted(8) expecting the @end parameter to be
inclusive...

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