[gparted] Stop using shell when reading jfs file system usage (#795617)



commit 4d7e66eda0a41fd674f48ebb597ffb9cc7337294
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Fri Oct 20 23:17:50 2017 +0100

    Stop using shell when reading jfs file system usage (#795617)
    
    Replace echoing "dm" into jfs_debugfs via a shell command to directly
    writing "dm" to the input of the jfs_debug command.  One less use of the
    shell.
    
    Bug 795617 - Implement opening and closing of LUKS mappings

 src/jfs.cc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/jfs.cc b/src/jfs.cc
index bcee88e..309a507 100644
--- a/src/jfs.cc
+++ b/src/jfs.cc
@@ -76,8 +76,8 @@ FS jfs::get_filesystem_support()
 
 void jfs::set_used_sectors( Partition & partition ) 
 {
-       const Glib::ustring jfs_debug_cmd = "echo dm | jfs_debugfs " + Glib::shell_quote( 
partition.get_path() );
-       if ( ! Utils::execute_command( "sh -c " + Glib::shell_quote( jfs_debug_cmd ), output, error, true ) )
+       const Glib::ustring jfs_debug_cmd = "jfs_debugfs " + Glib::shell_quote( partition.get_path() );
+       if ( ! Utils::execute_command( jfs_debug_cmd, "dm\n", output, error, true ) )
        {
                //blocksize
                Glib::ustring::size_type index = output.find( "Block Size:" );


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