Author: aschnell Date: Wed Aug 6 01:33:05 2008 New Revision: 49742 URL: http://svn.opensuse.org/viewcvs/yast?rev=49742&view=rev Log: - shell quoting Modified: trunk/storage/libstorage/src/StorageDefines.h trunk/storage/libstorage/src/Volume.cc Modified: trunk/storage/libstorage/src/StorageDefines.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageDefines.h?rev=49742&r1=49741&r2=49742&view=diff ============================================================================== --- trunk/storage/libstorage/src/StorageDefines.h (original) +++ trunk/storage/libstorage/src/StorageDefines.h Wed Aug 6 01:33:05 2008 @@ -27,5 +27,10 @@ #define KPARTXBIN "/sbin/kpartx" #define DMRAIDBIN "/sbin/dmraid" +#define MOUNTBIN "/bin/mount" +#define UMOUNTBIN "/bin/umount" +#define SWAPONBIN "/sbin/swapon" +#define SWAPOFFBIN "/sbin/swapoff" + #endif Modified: trunk/storage/libstorage/src/Volume.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Volume.cc?rev=49742&r1=49741&r2=49742&view=diff ============================================================================== --- trunk/storage/libstorage/src/Volume.cc (original) +++ trunk/storage/libstorage/src/Volume.cc Wed Aug 6 01:33:05 2008 @@ -787,7 +787,7 @@ { cmd += params + " "; } - cmd += mountDevice(); + cmd += quote(mountDevice()); SystemCmd c; c.setOutputProcessor( p ); c.execute( cmd ); @@ -817,7 +817,7 @@ cmd += "journal_data_writeback "; else cmd += "journal_data "; - cmd += mountDevice(); + cmd += quote(mountDevice()); SystemCmd c( cmd ); if( c.retcode()!=0 ) ret = VOLUME_TUNE2FS_FAILED; @@ -931,21 +931,21 @@ d = dmcrypt_dev; else if( loop_active ) d = loop_dev; - string cmdline = ((detected_fs != SWAP)?"umount ":"swapoff ") + d; + string cmdline = ((detected_fs != SWAP)?UMOUNTBIN " ":SWAPOFFBIN " ") + quote(d); int ret = cmd.execute( cmdline ); if( ret != 0 && mountDevice()!=dev ) { - cmdline = ((detected_fs != SWAP)?"umount ":"swapoff ") + dev; + cmdline = ((detected_fs != SWAP)?UMOUNTBIN " ":SWAPOFFBIN " ") + quote(dev); ret = cmd.execute( cmdline ); } if( ret!=0 && !mp.empty() && mp!="swap" ) { - cmdline = "umount " + mp; + cmdline = UMOUNTBIN " " + quote(mp); ret = cmd.execute( cmdline ); } if( ret!=0 && !orig_mp.empty() && orig_mp!="swap" ) { - cmdline = "umount " + orig_mp; + cmdline = UMOUNTBIN " " + quote(orig_mp); ret = cmd.execute( cmdline ); } if( ret != 0 ) @@ -1701,10 +1701,10 @@ if( ok ) { c.execute( "modprobe " + fs_names[detected_fs] ); - c.execute( "mount -oro -t " + fsTypeString(detected_fs) + " " + - use_dev + " " + mpname ); + c.execute(MOUNTBIN " -oro -t " + fsTypeString(detected_fs) + " " + + quote(use_dev) + " " + quote(mpname)); ok = c.retcode()==0; - c.execute( "umount " + mpname ); + c.execute(UMOUNTBIN " " + quote(mpname)); } if( !ok ) { @@ -2120,7 +2120,7 @@ cmdline = "modprobe nls_iso8859-1"; cmd.execute( cmdline ); } - cmdline = "mount "; + cmdline = MOUNTBIN " "; if( ro ) cmdline += "-r "; const char * ign_opt[] = { "defaults", "" }; @@ -2145,11 +2145,11 @@ opts += mergeString( l, "," ); opts += " "; } - cmdline += "-t " + fsn + opts + mountDevice() + " " + lmount; + cmdline += "-t " + fsn + opts + quote(mountDevice()) + " " + quote(lmount); } else { - cmdline = "swapon " + mountDevice(); + cmdline = SWAPONBIN " " + quote(mountDevice()); if( cont->getStorage()->instsys() ) { ProcMounts mountData( cont->getStorage() ); @@ -2527,7 +2527,7 @@ } else { - c.execute( (string)"mount -oremount " + mp ); + c.execute(MOUNTBIN " -oremount " + quote(mp)); y2mil( "remount remount:" << c.retcode() ); if( c.retcode()!=0 ) ret = VOLUME_REMOUNT_FAILED; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org