platform/upstream/udisks2.git
12 years agoUpdate NEWS for release
David Zeuthen [Fri, 26 Aug 2011 15:44:14 +0000 (11:44 -0400)]
Update NEWS for release

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoBug 24265 – Needs to create /var/run/udisks/ on demand
David Zeuthen [Fri, 26 Aug 2011 15:32:42 +0000 (11:32 -0400)]
Bug 24265 – Needs to create /var/run/udisks/ on demand

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoChange the default for LVM2 and dm-multipath support to off
David Zeuthen [Fri, 26 Aug 2011 15:09:24 +0000 (11:09 -0400)]
Change the default for LVM2 and dm-multipath support to off

The udev integration in device-mapper (and its users) is not exactly
working well - for example, you need to run 'udevadm trigger' in order
for the /lib/udev/udisks-lvm-pv-export prober to kick
in. Additionally, the fact that we run said prober on new events is
causing a lot of problems because its use of liblvm and the fact that
liblvm cannot currently be safely used in the udev path.

Signed-off-by: David Zeuthen <davidz@redhat.com>
Signed-off-by: Kay Sievers <kay@redhat.com>
13 years agoMark all rts_pstor devices as card readers
Ayan George [Thu, 21 Jul 2011 07:03:22 +0000 (09:03 +0200)]
Mark all rts_pstor devices as card readers

Generalize commit 361a2ce3 to apply to all card readers covered by the
rts_pstor driver.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
13 years agoFix typo in configure
Nicolas Lécureuil [Sat, 2 Jul 2011 22:30:26 +0000 (00:30 +0200)]
Fix typo in configure

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
13 years agoPost-release version bump to 1.0.4
David Zeuthen [Wed, 29 Jun 2011 14:17:30 +0000 (10:17 -0400)]
Post-release version bump to 1.0.4

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoUpdate NEWS for release
David Zeuthen [Wed, 29 Jun 2011 14:10:50 +0000 (10:10 -0400)]
Update NEWS for release

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoTeach udisks(1) about the new automount hint and spell automount as one word
David Zeuthen [Wed, 29 Jun 2011 14:09:19 +0000 (10:09 -0400)]
Teach udisks(1) about the new automount hint and spell automount as one word

It's automount, not "auto mount".

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoAdd UDISKS_AUTOMOUNT_HINT to the udisks(7) man page
David Zeuthen [Thu, 23 Jun 2011 17:27:59 +0000 (13:27 -0400)]
Add UDISKS_AUTOMOUNT_HINT to the udisks(7) man page

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoBug 38535 – A DeviceAutoMountHint attribute should be added to udisks
Ayan George [Thu, 23 Jun 2011 17:27:06 +0000 (13:27 -0400)]
Bug 38535 – A DeviceAutoMountHint attribute should be added to udisks

With minor changes by David Zeuthen, see the bug for details.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoBug 34710 — CD-ROM polling failed due to O_EXCL flag
Martin Pitt [Sun, 19 Jun 2011 18:48:22 +0000 (20:48 +0200)]
Bug 34710 — CD-ROM polling failed due to O_EXCL flag

Newer kernels (2.6.38+) support in-kernel polling of CD-ROM/SD card devices.
udev 172 and later enable this feature by default:

  http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=c5a41da949

That will also handle the eject button properly and send out remove uevents,
which causes stale mounts to be cleaned up properly.

In-kernel polling avoids the userspace race conditions with accessing the
drive.

If kernel polling is not supported or enabled, fall back to the previous method
of unlocking the CD drive door right after mounting, to keep the hardware
button working.

13 years agoAdd "unmount" option to DriveEject
Martin Pitt [Sun, 3 Apr 2011 22:07:03 +0000 (00:07 +0200)]
Add "unmount" option to DriveEject

DriveEject currently fails if there are mounted file systems on the drive. Add
an option "unmount" which will unmount any mounted file system on the drive to
be ejected first. The "eject" command conveniently already does this, so the
only thing we need to do here is to skip the "is mounted" check in
device_local_is_busy().

13 years agoAdd missing comma in fs whitelist
David Zeuthen [Mon, 9 May 2011 16:03:13 +0000 (12:03 -0400)]
Add missing comma in fs whitelist

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoAdd override for system internal property
Martin Pitt [Wed, 4 May 2011 08:38:01 +0000 (10:38 +0200)]
Add override for system internal property

Check UDISKS_SYSTEM_INTERNAL udev property to override the usual bus type based
"is drive system internal?" detection.

Based on patch by Patrick Stewart <patstew@gmail.com>, thank you!

13 years agoMark Realtek PCI flash card reader as such
Ayan George [Tue, 3 May 2011 06:47:34 +0000 (08:47 +0200)]
Mark Realtek PCI flash card reader as such

https://launchpad.net/bugs/759963

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
13 years agoRemove blkid probing of device-mapper nodes
Martin Pitt [Tue, 5 Apr 2011 20:16:00 +0000 (22:16 +0200)]
Remove blkid probing of device-mapper nodes

This was introduced years ago when udev rules were still something new, but
these workarounds really should not be in udev any longer.

lvm2 has shipped udev/13-dm-disk.rules with that blkid command for at least a
year (probably longer).

13 years agoSupport calling device_drive_eject() and device_filesystem_unmount() from daemon
Martin Pitt [Sun, 3 Apr 2011 21:02:46 +0000 (23:02 +0200)]
Support calling device_drive_eject() and device_filesystem_unmount() from daemon

In device_drive_eject() and device_filesystem_unmount(), only specify a
PolicyKit action if we actually have a D-BUS invocation context. If not, the
method is called from within the daemon, so use a NULL PK action to avoid a
crash. This is similar to device_drive_ata_smart_refresh_data().

Use the throw_error() wrapper instead of direct dbus_g_method_return_error(),
to support NULL contexts.

13 years agothrow_error(): Print error to stderr when being called internally
Martin Pitt [Sun, 3 Apr 2011 20:55:26 +0000 (22:55 +0200)]
throw_error(): Print error to stderr when being called internally

throw_error() immediately returns for Device methods which are called
internally from the daemon (i. e. without an actual PolicyKit check), as we do
not have a D-BUS invocation context. Print out the error message in this case
as well.

13 years agoFix udisks --eject-options
Martin Pitt [Sun, 3 Apr 2011 22:04:36 +0000 (00:04 +0200)]
Fix udisks --eject-options

Pass the split option array to the D-BUS call, not the original unsplit string.

13 years agoNuke the PolicyKit extension as that is now deprecated
David Zeuthen [Tue, 15 Mar 2011 16:24:18 +0000 (12:24 -0400)]
Nuke the PolicyKit extension as that is now deprecated

Ideally we'd use the replacement interface but it's not a very big
deal to not have this. We'll revisit this in udisks version 2
(e.g. the work going on in the udisks-gdbus branch).

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoNuke generated D-Bus code from distribution tarballs
David Zeuthen [Tue, 15 Mar 2011 14:34:24 +0000 (10:34 -0400)]
Nuke generated D-Bus code from distribution tarballs

This avoids a nasty bug when using an older version of the dbus-glib
library than the version that was used to generate the code. Credit
goes to Tomáš Trnka <tomastrnka@gmx.com> for figuring this out in RH
bug #673544 comment 15. See

 https://bugzilla.redhat.com/show_bug.cgi?id=673544

for more details

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoUpdate comment about validating requested filesystem type
David Zeuthen [Tue, 15 Mar 2011 13:39:26 +0000 (09:39 -0400)]
Update comment about validating requested filesystem type

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoFix all warnings caused by -Wunused-but-set-variable
David Zeuthen [Tue, 15 Mar 2011 13:32:47 +0000 (09:32 -0400)]
Fix all warnings caused by -Wunused-but-set-variable

This is new with gcc 4.6.

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoFix warning message
David Zeuthen [Tue, 15 Mar 2011 13:26:51 +0000 (09:26 -0400)]
Fix warning message

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoBug 32232 – CVE-2010-4661: Arbitrary kernel module load
David Zeuthen [Tue, 15 Mar 2011 13:20:44 +0000 (09:20 -0400)]
Bug 32232 – CVE-2010-4661: Arbitrary kernel module load

Validate what is passed to the mount(8) command. In particular, only
allow either well-known filesystems, filesystems already loaded or
filesystem explicitly allowed by the administrator via the
/etc/filesystems file.

See https://bugs.freedesktop.org/show_bug.cgi?id=32232 for details.

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoBug 32917 — EeePC 900 SD card reader icon looks like a usb stick in GNOME
Sitsofe Wheeler [Thu, 10 Mar 2011 22:55:57 +0000 (23:55 +0100)]
Bug 32917 — EeePC 900 SD card reader icon looks like a usb stick in GNOME

Add missing rule for identifying SD card readers as such.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32917
Bug-Ubuntu: https://launchpad.net/bugs/460713

13 years agoIgnore broken directory permissions on UDF media
Martin Pitt [Thu, 24 Feb 2011 12:39:52 +0000 (13:39 +0100)]
Ignore broken directory permissions on UDF media

Some broken DVDs come with 0400 directory permissions, making them unreadable;
according to the UDF spec (http://www.osta.org/specs/pdf/udf260.pdf) directory
permissions are to be respected, but apparently Windows ignores those.

To work around this, override readonly UDF media with a dmode=0500, as on those
it doesn't really make sense to hide anything.

https://launchpad.net/bugs/635499

13 years agotestsuite: Update assert statements
Martin Pitt [Thu, 24 Feb 2011 11:19:47 +0000 (12:19 +0100)]
testsuite: Update assert statements

assert_() and failIf() are deprecated in favor of assertTrue() and
assertFalse().

13 years agotestsuite: Port to Python 3
Martin Pitt [Thu, 24 Feb 2011 11:18:12 +0000 (12:18 +0100)]
testsuite: Port to Python 3

This now works with both Python 2 and 3.

13 years agotestsuite: fix race in LVM
Martin Pitt [Thu, 24 Feb 2011 10:09:45 +0000 (11:09 +0100)]
testsuite: fix race in LVM

Do an udev sync before getting the old list of devices, as there might still be
lingering updates from other tests; these appear as new devices in the delta
list and break the test.

13 years agoHide recovery partition on newer Lenovo machines
Bastien Nocera [Sat, 16 Oct 2010 22:52:36 +0000 (23:52 +0100)]
Hide recovery partition on newer Lenovo machines

Hide the "SYSTEM RESERVED" recovery partition on newer Lenovo
machines.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoPost-release version bump to 1.0.3
Martin Pitt [Thu, 2 Dec 2010 09:09:51 +0000 (10:09 +0100)]
Post-release version bump to 1.0.3

13 years agoupdate NEWS for 1.0.2 release
Martin Pitt [Thu, 2 Dec 2010 08:41:29 +0000 (09:41 +0100)]
update NEWS for 1.0.2 release

13 years agoFix hang on setting invalid VFAT labels
Martin Pitt [Sat, 6 Nov 2010 17:40:07 +0000 (13:40 -0400)]
Fix hang on setting invalid VFAT labels

VFAT does not support several characters in file names and labels, in
particular: " * / : < > ? \ |
(http://en.wikipedia.org/wiki/File_Allocation_Table)

When using one of those, mlabel interactively asks what to do, and thus causes
a hang. Now check for invalid characters and return a proper error instead.

Also update the test case to verify that we get an Error on invalid labels, and
that valid labels still work.

13 years agosimplify validate_and_escape_label()
Martin Pitt [Sat, 6 Nov 2010 17:28:39 +0000 (13:28 -0400)]
simplify validate_and_escape_label()

Cleanup from 3d42082

13 years agoEscape NTFS labels properly
Martin Pitt [Sat, 6 Nov 2010 17:13:35 +0000 (13:13 -0400)]
Escape NTFS labels properly

Caught by recent test suite update.

13 years agotestsuite: use shorter label for renaming
Martin Pitt [Sat, 6 Nov 2010 17:09:04 +0000 (13:09 -0400)]
testsuite: use shorter label for renaming

The previous one was too long for some file systems like XFS. This produced a
correct DBusException, but it's not what we primarily want to test for.

13 years agoudisks: escape backslash for label string
Jiro SEKIBA [Fri, 15 Oct 2010 04:48:07 +0000 (13:48 +0900)]
udisks: escape backslash for label string

validate_and_escape_label will only escapes '"'.
However, string '\"' will be escaped to '\\"' which leads unmatched
double quote for shell string in result.

This adds escaping '\' in validate_and_escape_label to avoid the problem.

Signed-off-by: Jiro SEKIBA <jir@unicus.jp>
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
13 years agotestsuite: Check correct handling of labels with funny characters
Martin Pitt [Sat, 6 Nov 2010 17:00:27 +0000 (13:00 -0400)]
testsuite: Check correct handling of labels with funny characters

Try to change to a label containing backslashes and quotes. This will make
things fall over quite badly in a lot of cases right now.

13 years agoFix building with Linux 2.6.37
Martin Pitt [Sat, 6 Nov 2010 16:42:09 +0000 (12:42 -0400)]
Fix building with Linux 2.6.37

<linux/fs.h> uses uint64_t without including it itself. Arguably a kernel bug,
but it costs us nothing to defend against it.

13 years agoudisks: Avoid deprecated polkit_authority_get() function
Marti Raudsepp [Wed, 20 Oct 2010 16:39:02 +0000 (19:39 +0300)]
udisks: Avoid deprecated polkit_authority_get() function

Use polkit_authority_get_sync() instead.

This was introduced in polkit-1 commit 322513b0d, thus bump the configure.ac
check to 0.97.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
13 years agotestsuite: Test forced removal of standard devices
Martin Pitt [Sun, 24 Oct 2010 13:48:51 +0000 (09:48 -0400)]
testsuite: Test forced removal of standard devices

Corresponding to the previous test for forced removal of LUKS encrypted
devices, also test handling of forced removal for plain unencrypted devices.

13 years agotestsuite: Check forced removal of LUKS encrypted device
Martin Pitt [Sun, 24 Oct 2010 13:31:51 +0000 (15:31 +0200)]
testsuite: Check forced removal of LUKS encrypted device

Add two new methods remove_device() and readd_devices() which simulate device
removal and readdition.

Add new test case for force-removal handling of a mounted LUKS device: verify
that it cleans up properly and device can be remounted again afterwards.

This reproduces the cleanup failure in bug 30332 and verifies that the fix for
tihs (16529b69f) works.

13 years agoFix uninitialized variable in part-id
Martin Pitt [Thu, 21 Oct 2010 07:35:29 +0000 (09:35 +0200)]
Fix uninitialized variable in part-id

With gcc 4.5:

part-id.c: In function ‘main’:
part-id.c:186:9: error: ‘partition_number’ may be used uninitialized in this function

This only affected the error path, where we would return an arbitrary value in
get_part_table_device_file()'s out_partition_number (but return a failure
result). No big deal, but let's initialize it for quiescing gcc.

13 years agopartutil: Explicitly use PART_TYPE_UNKNOWN
Martin Pitt [Thu, 21 Oct 2010 07:33:00 +0000 (09:33 +0200)]
partutil: Explicitly use PART_TYPE_UNKNOWN

Previously we were comparing PartitionScheme values against the undefined enum
value -1, which causes a warning with gcc 4.5. Define -1 explicitly as
"PART_TYPE_UNKNOWN" and only use that in the code, which is cleaner.

Thanks to Marti Raudsepp for pointing this out!

13 years agoudisks: fix a bug of unquoted/unescaped label string
Jiro SEKIBA [Fri, 15 Oct 2010 04:44:22 +0000 (13:44 +0900)]
udisks: fix a bug of unquoted/unescaped label string

This patch quotes/escapes label string for nilfs-tune.

Signed-off-by: Jiro SEKIBA <jir@unicus.jp>
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
13 years agoAdd nilfs2 label rename
Jiro SEKIBA [Thu, 14 Oct 2010 05:56:19 +0000 (14:56 +0900)]
Add nilfs2 label rename

Support renaming label of nilfs2 partition.  Renaming is done by nilfs2-tune,
which is in nilfs2-util > 2.0.20.

This patch enables the label test excluded for lacking utility.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
13 years agoAlso export UDISKS_DM_TARGET_PARAMS for 'multipath' target
David Zeuthen [Fri, 1 Oct 2010 16:02:24 +0000 (12:02 -0400)]
Also export UDISKS_DM_TARGET_PARAMS for 'multipath' target

This is safe - no key material or similar is ever exported
cf. CVE-2010-1149. Additionally, this unbreaks multipath support, see

http://people.freedesktop.org/~david/multipath-restored.png

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agotestsuite: Move to scsi_debug
Martin Pitt [Wed, 29 Sep 2010 11:50:17 +0000 (13:50 +0200)]
testsuite: Move to scsi_debug

Drop the usage of loop devices and move to scsi_debug. This provides much more
realistic behaviour (such as partitioning) and avoids using a kind of device
which udisks special-cases. scsi_debug fake devices can also be forcibly
removed (unlike loop and md), thus we can write test cases to check the cleanup
in this case.

Since scsi_debug only provides one (independent) test device, reorganize the
code a little to either just use one that one device (for most tests such as FS
or Smart), or use two partitions on that (for the LVM PVs).

Drop the "Loop" test case; it is not that interesting.

13 years agoFix creating NTFS on raw devices
Martin Pitt [Tue, 28 Sep 2010 07:53:20 +0000 (09:53 +0200)]
Fix creating NTFS on raw devices

Similarly to the other file systems, add a -F option to mkntfs, to avoid
failing on "this is not a partition blabla".

13 years agoFix mkfs.ext* arguments
Martin Pitt [Mon, 27 Sep 2010 18:40:22 +0000 (20:40 +0200)]
Fix mkfs.ext* arguments

Pass exactly one -F argument to mkfs.ext*, not one for each D-BUS method option
that we got (which meant none at all if there were no options). This fixes
creating ext* file systems on unpartitioned devices when supplying no option.

13 years agotestsuite: LVM: fix naming assumptions
Martin Pitt [Mon, 27 Sep 2010 15:05:20 +0000 (17:05 +0200)]
testsuite: LVM: fix naming assumptions

The LVM tests previously assumed that LVM devices had their primary device node
in /dev/mapper/. However, under the current udev rule device names should match
the kernel name, i. e. /dev/dm-*, and /dev/mapper/ should merely contain
symlinks.

Drop the /dev/mapper/* assumptions and just check whether there is a by-id/
symlink with the LV name.

13 years agotestsuite: Fix SMART test for SSDs
Martin Pitt [Mon, 27 Sep 2010 14:43:55 +0000 (16:43 +0200)]
testsuite: Fix SMART test for SSDs

SSDs do not have a "start-stop-count" (at least mine doesn't). Use
"power-on-hours" in the test suite instead.

13 years agotestsuite: fix race with SMART data
Martin Pitt [Mon, 27 Sep 2010 13:20:35 +0000 (15:20 +0200)]
testsuite: fix race with SMART data

On fast machines, the Smart.test_0_hd_status progresses too fast for the SMART
data to be collected at the time when its properties are tested. Now wait for
the data to become available.

13 years agoBug 30332 — udisks does not tear down LUKS devices when the slave is forcibly removed
Mathieu Trudel-Lapierre [Mon, 27 Sep 2010 12:52:26 +0000 (14:52 +0200)]
Bug 30332 — udisks does not tear down LUKS devices when the slave is forcibly removed

In the event of the forced removal of a crypto device, use the luks_holder
property since it is still available to figure out which underlying cleartext
LUKS device to teardown, instead of scanning through all available devices
(because the cleartext device already has had its properties cleaned up).

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
13 years agoprofile.h: Add missing include
Martin Pitt [Tue, 24 Aug 2010 12:44:31 +0000 (14:44 +0200)]
profile.h: Add missing include

access() and F_OK are defined in unistd.h. Not strictly necessary for udisks
itself, but easier for stealing the file for other projects.

13 years agoFix btrfs properties
Martin Pitt [Sun, 15 Aug 2010 15:39:42 +0000 (17:39 +0200)]
Fix btrfs properties

Fix the maximum label size, and availability for online resizing. Thanks Chris
Ball!

13 years agoBug 26258 — initial btrfs support
Martin Pitt [Sun, 15 Aug 2010 15:34:34 +0000 (17:34 +0200)]
Bug 26258 — initial btrfs support

Add basic support for creating and checking btrfs. This does not yet support
spanning multiple devices, RAID, etc.

We disable online fsck for now. It works, but is said to be too unstable still.

Also bump the size of the loop devices in the test suite, since btrfs needs at
least 256 MB.

13 years agoAdd nilfs2 file system support
Jiro SEKIBA [Sun, 15 Aug 2010 15:23:39 +0000 (17:23 +0200)]
Add nilfs2 file system support

This needs util-linux-ng > 2.18.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
14 years agoAdd udisks --eject option
Matt Zimmerman [Mon, 28 Jun 2010 09:05:58 +0000 (11:05 +0200)]
Add udisks --eject option

As a companion to --mount, --unmount, and --detach, it's useful for testing and
provides a policykit-authenticated alternative to eject(1).

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
14 years agoBug 28075 — Do not have files executable on NTFS
Martin Pitt [Thu, 3 Jun 2010 10:09:29 +0000 (12:09 +0200)]
Bug 28075 — Do not have files executable on NTFS

Set fmask on NTFS devices to avoid having files being executable. This provides
a better default for almost all NTFS use cases under Linux, and avoids
confusing "show or execute?" questions in nautilus.

This is similar to what commit 7e7ec1 did for vfat, except that NTFS does not
have this handy "showexec" option.

14 years agoFix long hangs on probing nonexistant floppy drives
Martin Pitt [Wed, 2 Jun 2010 13:56:07 +0000 (15:56 +0200)]
Fix long hangs on probing nonexistant floppy drives

A lot of modern machines do not have a floppy drive any more, but still have a
floppy controller somewhere (or at least the BIOS pretends to). Trying to
open(/dev/fd0) on these machines causes long hangs, which lead to long desktop
startup times.

To fix this, avoid probing floppies for media in update_info().

https://launchpad.net/bugs/539515

14 years agoAvoid using entities in introspection XML
David Zeuthen [Tue, 1 Jun 2010 21:22:38 +0000 (17:22 -0400)]
Avoid using entities in introspection XML

Unfortunately GMarkup doesn't understand entities so
gdbus-binding-tool will not work with these XML files without this
patch.

14 years agoDon't probe non-data discs for partition tables
David Zeuthen [Tue, 25 May 2010 14:59:01 +0000 (10:59 -0400)]
Don't probe non-data discs for partition tables

Suggested by Kay Sievers. This is related to
https://bugzilla.kernel.org/show_bug.cgi?id=15757

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agotestsuite: mkfs() code cleanup
Martin Pitt [Thu, 20 May 2010 20:12:44 +0000 (22:12 +0200)]
testsuite: mkfs() code cleanup

Replace the long if ladder for mkfs special cases with option dictionaries.
This makes it easier to extend in the future and the code easier to read.

14 years agoBug 28075 — Do not have all files executable on vfat
Martin Pitt [Wed, 12 May 2010 12:00:18 +0000 (14:00 +0200)]
Bug 28075 — Do not have all files executable on vfat

Enable the "showexec" vfat mount option, to avoid data files being executable
(which causes confusing question dialogs in nautilus which only have one
sensible answer).

See http://www.kernel.org/doc/Documentation/filesystems/vfat.txt (search for
"showexec") for the details of this option.

14 years agoUpdate to latest LVM2 API
David Zeuthen [Wed, 19 May 2010 17:01:31 +0000 (13:01 -0400)]
Update to latest LVM2 API

See

 http://lists.freedesktop.org/archives/devkit-devel/2010-April/000783.html

14 years agotestsuite: Check file permissions
Martin Pitt [Wed, 12 May 2010 11:00:16 +0000 (13:00 +0200)]
testsuite: Check file permissions

Add a check to the filesystem test cases for sane permissions of data files and
executables. In particular, this ensures that the executable bit is set where
it makes sense (directories and programs), but not on mere data files.

We currently ignore known-broken file systems like vfat and ntfs.

This is the groundwork to fix this behaviour at least on vfat. Its current
behaviour is quite unnerving, since trying to open a file on them in e. g.
GNOME will always ask for "do you want to open or run this file".

14 years agoPost-release version bump to 1.0.2
David Zeuthen [Fri, 9 Apr 2010 15:56:27 +0000 (11:56 -0400)]
Post-release version bump to 1.0.2

14 years agoUpdate NEWS for release
David Zeuthen [Fri, 9 Apr 2010 15:45:44 +0000 (11:45 -0400)]
Update NEWS for release

14 years agoadd information about CVE-2010-1149 to NEWS
Martin Pitt [Fri, 9 Apr 2010 11:19:44 +0000 (13:19 +0200)]
add information about CVE-2010-1149 to NEWS

14 years agoHide Sony E-Book launcher partition
Martin Pitt [Wed, 7 Apr 2010 07:50:19 +0000 (09:50 +0200)]
Hide Sony E-Book launcher partition

It only contains Windows software and is read-only, and thus useless.

https://launchpad.net/bugs/546924

14 years agojob-drive-benchmark.c: Fix data types in error messages
Martin Pitt [Wed, 7 Apr 2010 07:27:18 +0000 (09:27 +0200)]
job-drive-benchmark.c: Fix data types in error messages

We previously used wrongly sized data types in the error messages, which causes
crashes on platforms where they do not coincidentally match in size.

https://launchpad.net/bugs/527202

14 years agopart-id: Fix DM partition table detection
Martin Pitt [Wed, 7 Apr 2010 06:56:05 +0000 (08:56 +0200)]
part-id: Fix DM partition table detection

If DM_NAME does not end in 'pN' (i. e. is not a partition), do not treat it as
malformed, but just go ahead probing it. This fixes partition table detection
for kpartx'ed DM devices.

Re-enable the test case which originally uncovered this bug.

14 years agotestsuite: Check presence and properties of loop devices
Martin Pitt [Wed, 7 Apr 2010 06:36:42 +0000 (08:36 +0200)]
testsuite: Check presence and properties of loop devices

14 years agoBug 27494 — publicly exports dm key information
Martin Pitt [Wed, 7 Apr 2010 06:12:42 +0000 (08:12 +0200)]
Bug 27494 — publicly exports dm key information

Change udisks-dm-export to only export UDISKS_DM_TARGETS_PARAMS for "linear"
types. It is the only one we care about for now and know how to interpret.
"crypto" types have information about the encryption key in the target
parameters, which we must not leak.

Also add appropriate comments to the two places which currently evaluate
UDISKS_DM_TARGETS_PARAMS.

14 years agotestsuite: Test detection of kpartx LVM partitions
Martin Pitt [Tue, 6 Apr 2010 21:01:38 +0000 (23:01 +0200)]
testsuite: Test detection of kpartx LVM partitions

Add a new LVM test case where we create two partitions of the LV and check
their udisks properties.

This is primarily meant to test the rather involved logic of udisks-part-id to
determine which device that partition is a slave of (it involves parsing
UDISKS_DM_TARGETS_PARAMS and various DM_* properties).

This also apparently uncovered a bug: the partition table does not have correct
properties in udisks. Comment out the two checks for now, to be investigated
later.

14 years agotestsuite: Check that our udev probers do not leak key information
Martin Pitt [Tue, 6 Apr 2010 18:34:36 +0000 (20:34 +0200)]
testsuite: Check that our udev probers do not leak key information

This reproduces https://bugs.freedesktop.org/show_bug.cgi?id=27494

14 years agoFix exit code of umount.udisks
Martin Pitt [Fri, 19 Mar 2010 09:09:59 +0000 (10:09 +0100)]
Fix exit code of umount.udisks

Exit with return code 0 if the unmount succeeded.

https://launchpad.net/bugs/541740

14 years agoAllow other rules to set a more specific presentation icon
Martin Pitt [Thu, 18 Mar 2010 13:42:24 +0000 (14:42 +0100)]
Allow other rules to set a more specific presentation icon

If previous rules already set UDISKS_PRESENTATION_ICON_NAME (like in a future
media-player-info, to attach more specific icons to particular devices), do not
overwrite it with our generic icons; just set them if we do not have an icon at
all yet.

Also put the icon rules into their own visual section now, they were previously
in the middle of the "card reader type" rules.

14 years agoSet multimedia-player-ipod icon for iPod media players
Martin Pitt [Wed, 17 Mar 2010 14:46:03 +0000 (15:46 +0100)]
Set multimedia-player-ipod icon for iPod media players

Part of https://launchpad.net/bugs/540235

14 years agoUpdate NEWS for release
David Zeuthen [Mon, 15 Mar 2010 23:42:29 +0000 (19:42 -0400)]
Update NEWS for release

Ooops, should have done this before 1.0.0 - this will have to do.

14 years agoPost-release version bump to 1.0.1
David Zeuthen [Mon, 15 Mar 2010 23:38:42 +0000 (19:38 -0400)]
Post-release version bump to 1.0.1

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agoAdd TODO item about UTF-8 and D-Bus properties
David Zeuthen [Mon, 15 Mar 2010 22:37:21 +0000 (18:37 -0400)]
Add TODO item about UTF-8 and D-Bus properties

14 years agoGuarantee that DeviceFilePresentation always contain something meaningful
David Zeuthen [Mon, 15 Mar 2010 22:31:58 +0000 (18:31 -0400)]
Guarantee that DeviceFilePresentation always contain something meaningful

This makes life easier for UI tools - they can always just display
:DeviceFilePresentation instead of having to check whether it's blank
and if so use :DeviceFile.

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agoMake it possible to disable LVM2 and dm-multipath support
David Zeuthen [Mon, 15 Mar 2010 22:22:48 +0000 (18:22 -0400)]
Make it possible to disable LVM2 and dm-multipath support

Evidently, the device-mapper and LVM2 side of this needs some more
work so certain enterprise distros may want to disable this for now.

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agoUpdate TODO
David Zeuthen [Mon, 15 Mar 2010 19:38:53 +0000 (15:38 -0400)]
Update TODO

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agoFix partition table probing during coldplug
David Zeuthen [Mon, 15 Mar 2010 18:04:59 +0000 (14:04 -0400)]
Fix partition table probing during coldplug

Commit 8aa58f68ae3b53f6ba6d8c51b4f66bc8135b4123 introduced a subtle
assumption that the device file given on the command line for
udisks-part-id is the same as what udev_device_get_devnode() returns
for the udev_device object. This is actually not true when handling an
event as the node passed is a temporary one.

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agoudisks-part-id: Simplify code
Martin Pitt [Mon, 15 Mar 2010 07:41:32 +0000 (08:41 +0100)]
udisks-part-id: Simplify code

In 8aa58f we changed part-id to keep one singe udev_device around. Simplify
get_part_table_device_file() to not get the syspath from our device, just to
get a new udev device from that syspath again (which is exactly the same as the
device that we already have).

This also fixes a double udev_device_unref(), although this seems to have been
harmless.

14 years agoBug 27072 — does not force-unmount for drives in fstab
Martin Pitt [Sun, 14 Mar 2010 19:58:28 +0000 (20:58 +0100)]
Bug 27072 — does not force-unmount for drives in fstab

force_removal() previously only checked for entries in our own mtab.
This caused forced unmounts for drives in /etc/fstab not to work.

Now check for drives in /etc/fstab as well.

14 years agoTODO update for property update race conditions
Martin Pitt [Fri, 12 Mar 2010 19:07:24 +0000 (20:07 +0100)]
TODO update for property update race conditions

14 years agotestsuite: Add option to disable workarounds for race conditions
Martin Pitt [Fri, 12 Mar 2010 18:56:34 +0000 (19:56 +0100)]
testsuite: Add option to disable workarounds for race conditions

Some D-BUS API methods cause properties to not be up to date yet when a method
call finishes, thus we do an udevadm settle as a workaround in the test suite.
Those bugs should eventually get fixed properly, but it's unnerving to have the
tests fail on them when you are working on something else.

Split the udevadm settles into the existing .sync() for legitimate syncs, and a
new sync_workaround() for race condition workarounds.

Add --no-workarounds CLI option to disable those workaround syncs, so that
these race conditions can be detected and fixed.

14 years agotestsuite: Use loop devices instead of ram disks
Martin Pitt [Fri, 12 Mar 2010 18:14:24 +0000 (19:14 +0100)]
testsuite: Use loop devices instead of ram disks

On many platforms, the default size of RAM disks is too small for some file
systems or LVM devices. Rewrite using temporary loop devices.

14 years agoudisks-part-id: Check ID_FS_TYPE from environment first
Martin Pitt [Fri, 12 Mar 2010 17:30:23 +0000 (18:30 +0100)]
udisks-part-id: Check ID_FS_TYPE from environment first

We need to do that for the initial udev run where blkid and udisks-part-id are
called in the same round; the database is not updated at that time yet.

14 years agoBug 26996 — wrongly detects partition on unpartitioned VFAT device
Martin Pitt [Fri, 12 Mar 2010 16:42:25 +0000 (17:42 +0100)]
Bug 26996 — wrongly detects partition on unpartitioned VFAT device

A standard VFAT header matches the signature of an MBR, so we detected VFAT
file systems on raw unpartitioned devices as both VFAT and MBR partition table.
This confuses gnome-disk-utility/gvfs, and causes them to be ignored in GNOME.

The standard approach in the kernel/blkid is to only detect an MBR if it does
not have a valid VFAT signature. Since blkid already does that for us, do not
output PARTITION_TABLE properties in udisks-part-id if we already know that we
have a valid ID_FS_TYPE.

14 years agoudisks-part-id: Shuffle code to keep udev_device in main()
Martin Pitt [Fri, 12 Mar 2010 16:27:03 +0000 (17:27 +0100)]
udisks-part-id: Shuffle code to keep udev_device in main()

Reorder the code to get and keep an udev_device struct in main() and pass it
down to get_part_table_device_file(), instead of temporarily creating them in
that function and get_syspath(). This avoids duplicate lookups and also
allows us to do further queries on the udev_device later on (which we need to
fix bz#26996)

14 years agotestsuite: Check partitions with filesystems
Martin Pitt [Fri, 12 Mar 2010 15:15:52 +0000 (16:15 +0100)]
testsuite: Check partitions with filesystems

So far we only checked handling of partitions without file systems, which did
not detect the regression from commit cfc6698. Now test both combinations.

Note that we have to jump through some hoops here, since
Partition{Create,Modify} internally writes the new partition type/flags/etc,
and thus does not care about a broken part-id. Thus we trigger a change event
on block devices to actually check what the udev probers do.

14 years agoBug 25424 — Update to stable API of udev/gudev/dbus
Michael Biebl [Tue, 17 Nov 2009 03:18:14 +0000 (21:18 -0600)]
Bug 25424 — Update to stable API of udev/gudev/dbus

Remove G_UDEV_API_IS_SUBJECT_TO_CHANGE and
LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE.
Bump the build dependency on libudev to >= 143 and gudev-1.0 to >= 147
when those APIs were declared stable.
We also depend on dbus >= 1.0, so remove DBUS_API_SUBJECT_TO_CHANGE as
well.

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agoBug 25012 ­Add "usefree" to vfat available options
tuxce [Fri, 12 Mar 2010 12:12:41 +0000 (13:12 +0100)]
Bug 25012 ­Add "usefree" to vfat available options

When mounting a vfat volume, system scan the entire partition to know free
space available, using "usefree" option avoid this scan and use the free
clusters info on file system.

Modern kernels should not really need this any more, even on a 500 GB vfat
external disk it only takes two or three seconds to probe the file system.

However, this regressed in the kernel already twice in the past, so merely
allowing the mount option (without making it the default) provides a workaround
for such cases.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
14 years agotestsuite: Get along with running gvfs/nautilus
Martin Pitt [Fri, 12 Mar 2010 12:10:06 +0000 (13:10 +0100)]
testsuite: Get along with running gvfs/nautilus

Send a SIGSTOP to all gvfs-gdu-volume-monitor processes while the test suite is
running, to avoid nautilus windows popping up by the dozens, and causing "busy"
failures.