Author: aschnell Date: Fri Jul 25 10:23:28 2008 New Revision: 49409 URL: http://svn.opensuse.org/viewcvs/yast?rev=49409&view=rev Log: - quote device name (bug #396732) Modified: trunk/storage/libstorage/src/Disk.cc Modified: trunk/storage/libstorage/src/Disk.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Disk.cc?rev=49409&r1=49408&r2=49409&view=diff ============================================================================== --- trunk/storage/libstorage/src/Disk.cc (original) +++ trunk/storage/libstorage/src/Disk.cc Fri Jul 25 10:23:28 2008 @@ -394,7 +394,7 @@ bool Disk::detectPartitions( ProcPart& ppart ) { bool ret = true; - string cmd_line = PARTEDCMD + device() + " unit cyl print | sort -n"; + string cmd_line = PARTEDCMD + SystemCmd::quote(device()) + " unit cyl print | sort -n"; string dlabel; system_stderr.erase(); y2milestone( "executing cmd:%s", cmd_line.c_str() ); @@ -1850,7 +1850,7 @@ removePresentPartitions(); system_stderr.erase(); std::ostringstream cmd_line; - cmd_line << PARTEDCMD << device() << " mklabel " << label; + cmd_line << PARTEDCMD << SystemCmd::quote(device()) << " mklabel " << label; if( execCheckFailed( cmd_line.str() ) ) { ret = DISK_SET_LABEL_PARTED_FAILED; @@ -1910,7 +1910,7 @@ void Disk::redetectGeometry() { - string cmd_line = PARTEDCMD + device() + " unit cyl print"; + string cmd_line = PARTEDCMD + SystemCmd::quote(device()) + " unit cyl print"; y2milestone( "executing cmd:%s", cmd_line.c_str() ); SystemCmd Cmd( cmd_line ); if( Cmd.select( "BIOS cylinder" )>0 ) @@ -1945,7 +1945,7 @@ } system_stderr.erase(); std::ostringstream cmd_line; - cmd_line << PARTEDCMD << device() << " set " << p->nr() << " "; + cmd_line << PARTEDCMD << SystemCmd::quote(device()) << " set " << p->nr() << " "; string start_cmd = cmd_line.str(); if( ret==0 ) { @@ -2026,7 +2026,7 @@ { ProcPart ppart; std::ostringstream cmd_line; - cmd_line << PARTEDCMD << device() << " unit cyl print | grep -w \"^[ \t]*\"" << p->nr(); + cmd_line << PARTEDCMD << SystemCmd::quote(device()) << " unit cyl print | grep -w \"^[ \t]*\"" << p->nr(); SystemCmd cmd( cmd_line.str() ); unsigned nr, id; unsigned long start, csize; @@ -2053,7 +2053,7 @@ } } cmd_line.str(""); - cmd_line << PARTEDCMD << device() << " unit cyl print"; + cmd_line << PARTEDCMD << SystemCmd::quote(device()) << " unit cyl print"; cmd.execute( cmd_line.str() ); } return( ret ); @@ -2073,7 +2073,7 @@ else { std::ostringstream cmd_line; - cmd_line << PARTEDCMD << device() << " unit s print | grep -w \"^[ \t]*\"" << p->nr(); + cmd_line << PARTEDCMD << SystemCmd::quote(device()) << " unit s print | grep -w \"^[ \t]*\"" << p->nr(); SystemCmd cmd( cmd_line.str() ); if( cmd.numLines()>0 ) { @@ -2099,7 +2099,7 @@ { string cmd_line( "yes Fix | " PARTEDBIN ); cmd_line += " ---pretend-input-tty "; - cmd_line += device(); + cmd_line += SystemCmd::quote(device()); cmd_line += " print "; SystemCmd cmd( cmd_line ); gpt_enlarge = false; @@ -2141,7 +2141,7 @@ std::ostringstream cmd_line; if( ret==0 ) { - cmd_line << PARTEDCMD << device() << " unit cyl mkpart "; + cmd_line << PARTEDCMD << SystemCmd::quote(device()) << " unit cyl mkpart "; if( label != "sun" ) { switch( p->type() ) @@ -2325,7 +2325,7 @@ if( ret==0 && !p->created() ) { std::ostringstream cmd_line; - cmd_line << PARTEDCMD << device() << " rm " << p->OrigNr(); + cmd_line << PARTEDCMD << SystemCmd::quote(device()) << " rm " << p->OrigNr(); if( execCheckFailed( cmd_line.str() ) ) { ret = DISK_REMOVE_PARTITION_PARTED_FAILED; @@ -2508,7 +2508,7 @@ end_sect = max_end; y2mil( "new end_sect:" << end_sect ); } - cmd_line << "YAST_IS_RUNNING=1 " << PARTEDCMD << device() + cmd_line << "YAST_IS_RUNNING=1 " << PARTEDCMD << SystemCmd::quote(device()) << " unit s resize " << p->nr() << " " << start_sect << " " << end_sect; if( execCheckFailed( cmd_line.str() ) ) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org