Author: aschnell Date: Wed Jul 30 11:11:31 2008 New Revision: 49507 URL: http://svn.opensuse.org/viewcvs/yast?rev=49507&view=rev Log: - fixed segmentation fault (bnc #405129) - sometimes use absolute paths for programs - cleanup Added: trunk/storage/libstorage/src/StorageDefines.h Modified: trunk/storage/VERSION trunk/storage/libstorage/src/Disk.cc trunk/storage/libstorage/src/LvmVg.cc trunk/storage/libstorage/src/Makefile.am trunk/storage/libstorage/src/Md.cc trunk/storage/package/yast2-storage.changes trunk/storage/yast2-storage.spec.in Modified: trunk/storage/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/VERSION?rev=49507&r1=49506&r2=49507&view=diff ============================================================================== --- trunk/storage/VERSION (original) +++ trunk/storage/VERSION Wed Jul 30 11:11:31 2008 @@ -1 +1 @@ -2.17.5 +2.17.6 Modified: trunk/storage/libstorage/src/Disk.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Disk.cc?rev=49507&r1=49506&r2=49507&view=diff ============================================================================== --- trunk/storage/libstorage/src/Disk.cc (original) +++ trunk/storage/libstorage/src/Disk.cc Wed Jul 30 11:11:31 2008 @@ -20,9 +20,7 @@ #include "y2storage/AsciiFile.h" #include "y2storage/AppUtil.h" #include "y2storage/SystemCmd.h" - -#define PARTEDBIN "/usr/sbin/parted" -#define PARTEDCMD PARTEDBIN " -s " // blank at end !! +#include "y2storage/StorageDefines.h" using namespace std; using namespace storage; Modified: trunk/storage/libstorage/src/LvmVg.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/LvmVg.cc?rev=49507&r1=49506&r2=49507&view=diff ============================================================================== --- trunk/storage/libstorage/src/LvmVg.cc (original) +++ trunk/storage/libstorage/src/LvmVg.cc Wed Jul 30 11:11:31 2008 @@ -10,6 +10,7 @@ #include "y2storage/SystemCmd.h" #include "y2storage/AppUtil.h" #include "y2storage/Storage.h" +#include "y2storage/StorageDefines.h" using namespace std; using namespace storage; @@ -1335,15 +1336,15 @@ int ret = 0; y2milestone( "dev:%s", device.c_str() ); SystemCmd c; - string cmd = "mdadm --zero-superblock " + device; + string cmd = MDADMBIN " --zero-superblock " + quote(device); c.execute( cmd ); getStorage()->removeDmTableTo( device ); if( getStorage()->isDisk(device) ) { - cmd = "parted " + device + " mklabel msdos"; + cmd = PARTEDCMD + quote(device) + " mklabel msdos"; c.execute( cmd ); } - cmd = "echo y | pvcreate -ff " + metaString() + device; + cmd = "echo y | " PVCREATEBIN " -ff " + metaString() + device; c.execute( cmd ); if( c.retcode()!=0 ) { Modified: trunk/storage/libstorage/src/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Makefile.am?rev=49507&r1=49506&r2=49507&view=diff ============================================================================== --- trunk/storage/libstorage/src/Makefile.am (original) +++ trunk/storage/libstorage/src/Makefile.am Wed Jul 30 11:11:31 2008 @@ -58,7 +58,8 @@ StorageTypes.cc StorageTypes.h \ FilterIterator.h ListListIterator.h \ DerefIterator.h IterPair.h \ - Region.h StorageTmpl.h + Region.h StorageTmpl.h \ + StorageDefines.h liby2storage_la_LDFLAGS = -version-info 2:0 liby2storage_la_LIBADD = -lblocxx Modified: trunk/storage/libstorage/src/Md.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Md.cc?rev=49507&r1=49506&r2=49507&view=diff ============================================================================== --- trunk/storage/libstorage/src/Md.cc (original) +++ trunk/storage/libstorage/src/Md.cc Wed Jul 30 11:11:31 2008 @@ -13,6 +13,7 @@ #include "y2storage/SystemCmd.h" #include "y2storage/Regex.h" #include "y2storage/Container.h" +#include "y2storage/StorageDefines.h" using namespace storage; using namespace std; @@ -46,7 +47,7 @@ setNameDev(); getMajorMinor( dev, mjr, mnr ); } - SystemCmd c( "mdadm --detail " + quote(device()) ); + SystemCmd c(MDADMBIN " --detail " + quote(device())); c.select( "UUID : " ); string::size_type pos; if( c.retcode()==0 && c.numLines(true)>0 ) @@ -59,11 +60,14 @@ c.select( "Version : " ); if( c.retcode()==0 && c.numLines(true)>0 ) sb_ver = extractNthWord( 2, *c.getLine(0,true) ); - y2mil( "line:\"" << *c.getLine(0,true) << "\"" ); - y2mil( "sb_ver:\"" << sb_ver << "\"" ); - y2mil( "word0:\"" << extractNthWord( 0, *c.getLine(0,true)) << "\"" ); - y2mil( "word1:\"" << extractNthWord( 1, *c.getLine(0,true)) << "\"" ); - y2mil( "word2:\"" << extractNthWord( 2, *c.getLine(0,true)) << "\"" ); + if (c.retcode()==0 && c.numLines(true)>0 ) + { + y2mil( "line:\"" << *c.getLine(0,true) << "\"" ); + y2mil( "sb_ver:\"" << sb_ver << "\"" ); + y2mil( "word0:\"" << extractNthWord( 0, *c.getLine(0,true)) << "\"" ); + y2mil( "word1:\"" << extractNthWord( 1, *c.getLine(0,true)) << "\"" ); + y2mil( "word2:\"" << extractNthWord( 2, *c.getLine(0,true)) << "\"" ); + } string tmp; string line = line1; if( (pos=line.find( ':' ))!=string::npos ) @@ -250,7 +254,7 @@ void Md::getState(MdStateInfo& info) const { - SystemCmd c("mdadm --detail " + quote(device())); + SystemCmd c(MDADMBIN " --detail " + quote(device())); c.select("State : "); if( c.retcode()==0 && c.numLines(true)>0 ) @@ -310,7 +314,7 @@ string Md::createCmd() const { string cmd = "ls -l --full-time " + quote(devs) + " " + quote(spare) + "; "; - cmd += "modprobe " + pName() + "; mdadm --create " + quote(device()) + + cmd += "modprobe " + pName() + "; " MDADMBIN " --create " + quote(device()) + " --run --level=" + pName() + " -e 1.0"; if (pName() == "raid1" || pName() == "raid5" || pName() == "raid6" || pName() == "raid10") Added: trunk/storage/libstorage/src/StorageDefines.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageDefines.h?rev=49507&view=auto ============================================================================== --- trunk/storage/libstorage/src/StorageDefines.h (added) +++ trunk/storage/libstorage/src/StorageDefines.h Wed Jul 30 11:11:31 2008 @@ -0,0 +1,13 @@ +#ifndef STORAGE_DEFINES_H +#define STORAGE_DEFINES_H + + +#define PARTEDBIN "/usr/sbin/parted" +#define PARTEDCMD PARTEDBIN " -s " // blank at end !! + +#define MDADMBIN "/sbin/mdadm" + +#define PVCREATEBIN "/sbin/pvcreate" + + +#endif Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=49507&r1=49506&r2=49507&view=diff ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Wed Jul 30 11:11:31 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Jul 30 09:57:59 CEST 2008 - aschnell@suse.de + +- fixed segmentation fault (bnc #405129) +- version 2.17.6 + +------------------------------------------------------------------- Mon Jul 28 12:45:35 CEST 2008 - aschnell@suse.de - quoting of device names (bnc #396732) Modified: trunk/storage/yast2-storage.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/yast2-storage.spec.in?rev=49507&r1=49506&r2=49507&view=diff ============================================================================== --- trunk/storage/yast2-storage.spec.in (original) +++ trunk/storage/yast2-storage.spec.in Wed Jul 30 11:11:31 2008 @@ -21,7 +21,7 @@ Provides: y2t_inst-partitioning Obsoletes: y2t_inst-partitioning -Summary: Handling of disk storage related things in YaST2 +Summary: - %description This package is a part of YaST2. It contains the necessary scripts to -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org