diff --git a/ChangeLog b/ChangeLog index 902e6f1a..dc56648b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-01-24 Bart Hakvoort + + * src/Utils.cc: use realpath() to get absolute path to 'real' + /etc/mtab. + unmount if something went wrong while adding the line to '/etc/mtab' + * src/Dialog_Progress.cc: replaced PACK_SHRINK with PACK_EXPAND_WIDGET + 2006-01-24 Bart Hakvoort * src/GParted_Core.cc: swapped 'line' and 'c_str' to make diff --git a/src/Dialog_Progress.cc b/src/Dialog_Progress.cc index d3f92260..ab654d36 100644 --- a/src/Dialog_Progress.cc +++ b/src/Dialog_Progress.cc @@ -88,7 +88,7 @@ Dialog_Progress::Dialog_Progress( const std::vector & operations ) expander_details .set_use_markup( true ) ; expander_details .add( scrolledwindow ) ; - this ->get_vbox() ->pack_start( expander_details, Gtk::PACK_SHRINK ) ; + this ->get_vbox() ->pack_start( expander_details, Gtk::PACK_EXPAND_WIDGET ) ; this ->get_vbox() ->set_spacing( 5 ) ; this ->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_NONE ) ; diff --git a/src/Utils.cc b/src/Utils.cc index 09311c98..ae3f8e19 100644 --- a/src/Utils.cc +++ b/src/Utils.cc @@ -166,16 +166,24 @@ bool Utils::mount( const Glib::ustring & node, //append 'line' to /etc/mtab if ( hit ) { - std::ofstream mtab( "/etc/mtab", std::ios::app ) ; - - if ( mtab ) + //in some situations (some livecd's e.g.) /etc/mtab is a (sym)link. + char real_path[255] ; + if ( realpath( "/etc/mtab", real_path ) ) { - mtab << line << '\n' ; - mtab .close() ; + std::ofstream mtab( real_path, std::ios::app ) ; - return true ; + if ( mtab ) + { + mtab << line << '\n' ; + mtab .close() ; + + return true ; + } } } + + //something went wrong while adding the line to mtab + umount( mountpoint .c_str() ) ; } } else