[gparted] Quote mount point when resizing jfs (#782681)



commit 3a10e30c3a79a2322dcbac7cea26d9209a2dd5c9
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Fri May 19 15:18:06 2017 +0100

    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

 src/jfs.cc |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/jfs.cc b/src/jfs.cc
index 5ee7064..e827921 100644
--- a/src/jfs.cc
+++ b/src/jfs.cc
@@ -173,7 +173,8 @@ bool jfs::resize( const Partition & partition_new, OperationDetail & operationde
                mount_point = mk_temp_dir( "", operationdetail ) ;
                if ( mount_point .empty() )
                        return false ;
-               success &= ! execute_command( "mount -v -t jfs " + partition_new .get_path() + " " + 
mount_point,
+               success &= ! execute_command( "mount -v -t jfs " + partition_new .get_path() +
+                                             " \"" + mount_point + "\"",
                                              operationdetail, EXEC_CHECK_STATUS );
        }
        else
@@ -181,11 +182,13 @@ bool jfs::resize( const Partition & partition_new, OperationDetail & operationde
 
        if ( success )
        {
-               success &= ! execute_command( "mount -v -t jfs -o remount,resize " + partition_new 
.get_path() + " " + mount_point,
+               success &= ! execute_command( "mount -v -t jfs -o remount,resize " + partition_new 
.get_path() +
+                                             " \"" + mount_point + "\"",
                                              operationdetail, EXEC_CHECK_STATUS );
 
                if ( ! partition_new .busy )
-                       success &= ! execute_command( "umount -v " + mount_point, operationdetail, 
EXEC_CHECK_STATUS );
+                       success &= ! execute_command( "umount -v \"" + mount_point + "\"",
+                                                     operationdetail, EXEC_CHECK_STATUS );
        }
 
        if ( ! partition_new .busy )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]