Author: fehr Date: Thu Nov 3 11:04:25 2011 New Revision: 66672 URL: http://svn.opensuse.org/viewcvs/yast?rev=66672&view=rev Log: add local static struct to getContVolInfo to prevent strings from being freed while perl interface might still access them Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc?rev=66672&r1=66671&r2=66672&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc Thu Nov 3 11:04:25 2011 @@ -5082,10 +5082,11 @@ int Storage::getContVolInfo(const string& device, ContVolInfo& info) { + static ContVolInfo s_info; // workaround for broken ycp bindings int ret = STORAGE_VOLUME_NOT_FOUND; ConstContIterator c; ConstVolIterator v; - info.ctype = CUNKNOWN; + s_info.ctype = CUNKNOWN; assertInit(); if (findVolume(device, c, v)) { @@ -5098,23 +5099,24 @@ findVolume(b->device(), c, v, true); } } - info.ctype = c->type(); - info.cname = c->name(); - info.cdevice = c->device(); - info.vname = v->name(); - info.vdevice = v->device(); + s_info.ctype = c->type(); + s_info.cname = c->name(); + s_info.cdevice = c->device(); + s_info.vname = v->name(); + s_info.vdevice = v->device(); if( v->isNumeric() ) - info.num = v->nr(); + s_info.num = v->nr(); } else if (findContainer(device, c)) { ret = 0; - info.ctype = c->type(); - info.cname = c->name(); - info.cdevice = c->device(); - info.vname = ""; - info.vdevice = ""; + s_info.ctype = c->type(); + s_info.cname = c->name(); + s_info.cdevice = c->device(); + s_info.vname = ""; + s_info.vdevice = ""; } + info = s_info; y2mil("device:" << device << " ret:" << ret << " cname:" << info.cname << " vname:" << info.vname); return ret; Modified: branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes?rev=66672&r1=66671&r2=66672&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Thu Nov 3 11:04:25 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Nov 3 10:55:36 CET 2011 - fehr@suse.de + +- add local static struct to getContVolInfo to prevent strings + from being freed while perl interface might still access them + +------------------------------------------------------------------- Wed Nov 2 13:04:19 CET 2011 - fehr@suse.de - add nofail for fstab entries on USB, ISCSI and FCOE disks -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org