Commit Graph

3277 Commits

Author SHA1 Message Date
Mike Fleetwood cbab9849b1 Update README with the inclusion of Google Test framework (#781978)
Document the files and license of the Google Test C++ test framework.

Bug 781978 - Add Google Test C++ test framework
2017-06-02 10:13:16 -06:00
Mike Fleetwood 87f7170a55 Add Google Test 1.8.0 files (#781978)
Copy the Google Test C++ test framework (subset needed to build the unit
testing libraries) into the GParted project.  Copy the following files
and directories from Google Test, release 1.8.0:
    LICENSE
    README.md
    include/
    src/
into lib/gtest/.  All the files are under the BSD license as documented
in lib/gtest/LICENSE.

Bug 781978 - Add Google Test C++ test framework
2017-06-02 10:13:16 -06:00
Mike Fleetwood e0390d9cd8 Update comment with example LUKS_Info cache entry
Reflect the change made to the data model in commit:
    Use BlockSpecial in LUKS_Info module cache (#767842)
    7cd574cac5
2017-05-21 09:44:20 -06:00
Mike Fleetwood 6798c271c7 Quote mount point in Data Rescue dialog (#782681)
As before always quote use of mount points in command lines.

Bug 782681 - btrfs partitions mounted with whitespace cannot be resized
2017-05-21 09:44:20 -06:00
Mike Fleetwood 2025581029 Quote mount point when copying and resizing xfs (#782681)
Attempting to grow an already mounted xfs where the mount point
contained spaces failed like this:

    Grow /dev/sdb4 from 1.00 GiB to 1.50 GiB
    + calibrate /dev/sdb4
    + grow partition from 1.00 GiB to 1.50 GiB
    + grow file system to fill the partition
      + xfs_growfs /tmp/File System Label
        Usage: xfs_growfs [options] mountpoint
        ...

Apply the rule and quote all uses of mount points within command lines.
This is also applied to copying xfs file systems even though it was safe
because it only ever used GParted generated mount points.

Also for the xfs copy operation switch unmounting of partitions to
specify mount points instead of partitions.  This is just to be
consistent with how it is done in all the online file system resizing
code.

Bug 782681 - btrfs partitions mounted with whitespace cannot be resized
2017-05-21 09:44:20 -06:00
Mike Fleetwood 988dacfb1b Quote mount point when resizing nilfs2 (#782681)
The current nilfs2 resizing code is safe because it never passes a user
influenced mount point into a command line.  Regardless, apply the same
simple rule to always quote mount points when used in command lines.

WARNING:
Nilfs-resize is broken and can't actually resize a file system mounted
with spaces in the mount point anyway!

    # mkdir "/tmp/File System Label"
    # mount -v -t nilfs2 /dev/sdb3 "/tmp/File System Label"
    mount.nilfs2: started nilfs_cleanerd
    # nilfs-resize -v -y /dev/sdb3
    Error: cannot open NILFS on /dev/sdb3.
    # echo $?
    1
    # strace nilfs-resize -v -y /dev/sdb3
    ...
    stat("/dev/sdb3", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 19), ...}) = 0
    open("/dev/sdb3", O_RDONLY)             = 3
    ...
    open("/proc/mounts", O_RDONLY)          = 4
    read(4, "sysfs /sys sysfs rw,seclabel,nos"..., 1024) = 1024
    ...
    close(4)                                = 0
    open("/tmp/File\\040System\\040Label", O_RDONLY) = -1 ENOENT (No such file or directory)
    ...
    # fgrep /dev/sd /proc/mounts
    /dev/sda3 / ext4 rw,seclabel,relatime,data=ordered 0 0
    /dev/sda1 /boot ext4 rw,seclabel,relatime,data=ordered 0 0
    /dev/sdb3 /tmp/File\040System\040Label nilfs2 rw,relatime 0 0

So it looks like nilfs-resize (or a library it uses) can't decode the
octal characters '\040' used to encode spaces in the mount point as
reported in /proc/mounts.

Bug 782681 - btrfs partitions mounted with whitespace cannot be resized
2017-05-21 09:44:20 -06:00
Mike Fleetwood 3a10e30c3a Quote mount point when resizing jfs (#782681)
Attempting to grow an already mounted jfs where the mount point
contained spaces failed like this:

    Grow /dev/sdb2 from 1.00 GiB to 1.50 GiB
    + calibrate /dev/sdb2
    + grow partition from 1.00 GiB to 1.50 GiB
    + grow file system to fill the partition
      + mount -v -t jfs -o remount,resize /dev/sdb2 /tmp/File System Label
        Usage:
        mount [-lhV]
        mount -a [options]
        mount [options] [--source[ <source> | [--target] <directory>
        mount [options] <source> <directory>
        mount <operation> <mountpoint> [<target>]
        ...

Apply the rule to always enclose mount points within double quotes
within command lines.

Bug 782681 - btrfs partitions mounted with whitespace cannot be resized
2017-05-21 09:44:20 -06:00
Mike Fleetwood 618c1a202d Quote mount point when resizing btrfs (#782681)
A user had a btrfs file system mounted by automounter on a mount point
like "/mount/$USER/File System Label" which included white space
characters.  Resizing the file system while online failed like this:

    Grow /dev/sdb1 from 1.00 GiB to 1.50 GiB
    + calibrate /dev/sdb1
    + grow partition from 1.00 GiB to 1.50 GiB
    + grow file system to fill the partition
      + btrfs filesystem resize 1:max /mount/USER/File System Label
          btrfs filesystem resize: too many arguments
          usage: btrfs filesystem resize [devid:][+/-]<newsize>[kKmMgGtTpPeE]|[devid:]max <path>

So mount points not created by GParted should be considered under user
control and need quoting when used as parameters in command lines.
Strictly speaking, mount points created by GParted itself, by
FileSystem::mk_temp_dir(), are safe and don't need quoting.  However it
is simpler and safer just to quote all uses of mount points in command
lines, rather than risk missing some.

Bug 782681 - btrfs partitions mounted with whitespace cannot be resized
2017-05-21 09:44:20 -06:00
Mike Fleetwood 75131d85a5 Fix snap-to-alignment of operations creating partitions (#779339)
Using the default MiB alignment, creating an MSDOS logical partition
between two other existing logical partitions fails with this error
dialog:

    (-) <b>An error occurred while applying the operations</b>
        See the details for more information.
        <b>IMPORTANT</b>
        If you want support, you need to provide the saved details!
        See http://gparted.org/save-details.htm for more information.
                                                               [ OK ]

and these operation details:

    + libparted messages
      - Unable to satisfy all constraints on the partition.

This bug was introduced by this commit included in GParted 0.23.0:
    90e3ed68fc
    Shallow copy Device object into Operation object (#750168)

The commit message claimed that the deep copied Partition objects inside
the Device inside the Operation object are never accessed.  This turned
out not to be true.  Win_GParted::Add_Operation() uses them as part of
snap_to_alignment() which updates requested partition boundaries to
account for alignment requirements and the space needed for EBR
(Extended Boot Record) preceding logical partitions.

In this case the new logical partition was trying to be created over the
top of the EBR for the following logical partition because
snap_to_alignment() wasn't aware of its existence.

Fix by making Add_Operation() and snap_to_alignment() refer to the
current device, as displayed in the UI, rather than the shallow copy
included in the Operation object.  Hopefully now it is true that the
not copied vector of Partition objects in the Device object in each
Operation object are never accessed.

Bug 779339 - enforce at least 1 MiB "free space following"
2017-04-23 08:57:25 -06:00
gogo e31c96adc8 Update Croatian translation 2017-04-10 15:01:45 +00:00
Rafael Fontenelle 9927be7c83 Update Brazilian Portuguese translation 2017-03-26 01:41:07 +00:00
Mario Blättermann b4349f851e Update German translation 2017-03-15 09:04:06 +00:00
Jiri Grönroos aec9d903e8 Update Finnish translation 2017-02-18 16:21:30 +00:00
Curtis Gedak 883d7cf598 Append -git to version for continuing development 2017-02-17 15:55:27 -07:00
Curtis Gedak 7ac84119c0 ========== gparted-0.28.1 ========== 2017-02-17 15:42:22 -07:00
Curtis Gedak 4a0931c50d Restore ability to grow primary w/unallocated space before extended (#778700)
A regression which prevented growing a primary partition that had
unallocated space between it and the following extended partition was
introduced with the following commit:

  Create and use general find_extended_partition() function
  aa98107706

To fix the regression, restore the logic that checked for a logical
partition before seeking the index of the extended partition.

Bug 778700 - Unable to grow partition even though unallocated space is
             adjacent
2017-02-17 12:40:46 +00:00
Curtis Gedak 4cc5103dbd Work around make distcheck issue (#778628)
The command 'make distcheck' runs a build in dist directory subdirs
and then runs intltool -m which in turn complains about translations
in a built file:

  The following files contain translations and are currently not in
  use. Please consider adding these to the POTFILES.in file, located
  in the po/ directory.

  sub/gparted.desktop.in

See also upstream intltool issue bug report:

  intltool confused by separate build-dir
  https://bugs.launchpad.net/intltool/+bug/1117944

Bug 778628 - Work around automake-1.15 & intltool complaining about
             translations in build dir
2017-02-15 14:05:22 +00:00
Refael Sheinker 925e505f77 Make the Name Partition dialog a bit bigger (#778003)
Increase the size of the Name Partition dialog, matching the change made
to the Label File System dialog in the previous commit.  The code for
the Name Partition dialog was basically copied from the Label File
System dialog.

Bug 778003 - The "Label File System" dialog is too small
2017-02-14 18:59:23 +00:00
Refael Sheinker d1ce653d1b Make "Label File System" dialog a bit bigger (#778003)
On Arch Linux with XFCE 4.12 and Fedora 24 with GNOME 3.20 and later;
the Label File System dialog is too small.  The problem is that the
label entry box clips the Cancel and OK buttons.

Stop specifying the dialog height, instead letting it fit the combined
height of all the widgets automatically.

Also make the dialog wider and the label entry box wider so that longer
device names can be shown in the title before they are truncated.

Bug 778003 - The "Label File System" dialog is too small
2017-02-14 18:59:23 +00:00
Curtis Gedak f537b720bb Append -git to version for continuing development 2017-02-14 10:34:04 -07:00
Curtis Gedak 10d3490e18 ========== gparted-0.28.0 ========== 2017-02-14 10:06:45 -07:00
Curtis Gedak ad9aaa1dc3 Update copyright year 2017-02-14 10:00:41 -07:00
Matej Urbančič 4da32aedbb Updated Slovenian translation 2017-02-14 09:10:57 +01:00
Alexandre Franke 05df189a0a Update French translation 2017-02-13 16:41:29 +00:00
Andika Triwidada 3c882dfc5d Update Indonesian translation 2017-02-13 08:52:57 +00:00
Alexandre Franke 3a70177260 Update French translation 2017-02-12 22:09:02 +00:00
Мирослав Николић cf632a053f Updated Serbian translation 2017-02-12 07:25:01 +01:00
Anders Jonsson e5c402348d Update Swedish translation 2017-02-11 17:37:19 +00:00
Alan Mortensen d8e1295268 Updated Danish translation 2017-02-11 00:41:49 +01:00
Marek Cernocky 09cbbc7200 Updated Czech translation 2017-02-10 17:48:35 +01:00
Trần Ngọc Quân e768ab1cc0 Updated Vietnamese translation
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
2017-02-10 14:18:40 +07:00
Baurzhan Muftakhidinov bc661d084f Update Kazakh translation 2017-02-09 05:13:20 +00:00
Anders Jonsson 4912ad31b0 Update Swedish translation 2017-02-07 23:35:26 +00:00
Aurimas Černius 51dc435c9b Updated Lithuanian translation 2017-02-07 22:25:05 +02:00
Piotr Drąg 44290a01c3 Update Polish translation 2017-02-07 20:45:13 +01:00
Mike Fleetwood 38857e09c7 Improve error message in check_repair_filesystem() (#774818)
Change the error message after it raised a question with the translators
and to better align with the operation only being described as a check
in the GParted Manual and in the application UI.

Bug 774818 - Implement LUKS read-write actions NOT requiring a
             passphrase
2017-02-07 12:31:49 -07:00
Baurzhan Muftakhidinov f03a4106cc Update Kazakh translation 2017-02-07 09:50:43 +00:00
Josef Andersson 98eae5a51a Update Swedish translation 2017-02-06 20:38:46 +00:00
Rafael Fontenelle eeff05b423 Update Brazilian Portuguese translation 2017-02-05 00:39:49 +00:00
Josef Andersson 25f67b583e Update Swedish translation 2017-02-04 22:31:07 +00:00
Mario Blättermann abdc06bd12 Update German translation 2017-02-04 20:49:11 +00:00
Piotr Drąg 2258b70cd9 Fix translator comments
They need to be exactly one line above a string to show up in .po files.
2017-01-28 01:04:42 +01:00
Alan Mortensen 079c7864b7 Updated Danish translation 2017-01-17 21:12:34 +01:00
Rafael Fontenelle 7e392e8481 Update Brazilian Portuguese translation 2017-01-17 01:27:07 +00:00
Piotr Drąg 328508608e Update Polish translation 2017-01-15 14:39:57 +01:00
Mike Fleetwood aa98107706 Create and use general find_extended_partition() function
The Operation class already provided find_index_extended() method and
 was used in the Operation and derived classes where required.  It
returns the index to the extended partition in the PartitionVector
object, or -1 when no extended partition exists.

There were several cases of the same functionality being open coded in
GParted_Core and Win_GParted.  Therefore move the implementation to
find_extended_partition() in PartitionVector compilation unit and use
this implementation everywhere.
2017-01-14 08:49:58 -07:00
Mike Fleetwood 786a53b43c Replace 2 Win_GParted member variables with local variables
Member variables fs and gpart_output were used in just one method each
as local variables.  Replace them with local variables.
2017-01-14 08:49:58 -07:00
Mike Fleetwood fbd39b81e3 Fix for loop limit in fat16::sanitize_label()
Use the same uppercase_label string to determine the limit of the for
loop as is actually accessed.
2017-01-14 08:49:58 -07:00
Mike Fleetwood 0f76b8f8ff Remove unused clear_mountpoints parameter from add_mountpoint*()
The clear_mountpoints parameter has never been used since
add_mountpoint*() were first added [1][2].  clear_mountpoints() method
[3] is available to provide this functionality and used.  Therefore
removed unused parameter and code.

[1] add_mountpoints() added 2006-03-15
        9532c3cad1
        Made Partition::mountpoints private

[2] add_mountpoint() added 2011-12-16
        208083f11d84dbd4f186271a3cdbf5170db259f8b8
        Display LVM2 VGNAME as the PV's mount point (#160787)

[3] clear_mountpoint() added 2006-03-19
        ad9f2126e7
        fixed issues with copying (see also #335004) cleanups + added FIXME added
2017-01-14 08:49:58 -07:00
Mike Fleetwood 5857b46c5d Add LUKS notes to the GParted Manual (#774818)
Add LUKS encrypted partition notes to the GParted Manual about the new
capabilities coming in the next release of GParted.

Bug 774818 - Implement LUKS read-write actions NOT requiring a
             passphrase
2017-01-14 08:49:58 -07:00