You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gparted/gparted-realpath-fix.patch

29 lines
897 B

--- src/GParted_Core.cc 2006-12-05 14:39:31.000000000 -0500
+++ src/GParted_Core.cc.new 2007-10-30 00:29:11.000000000 -0400
@@ -487,12 +487,15 @@
while ( getline( proc_partitions, line ) )
if ( sscanf( line .c_str(), "%*d %*d %*d %255s", c_str ) == 1 )
{
+ char *real_path = NULL;
+
line = "/dev/" ;
line += c_str ;
//FIXME: it seems realpath is very unsafe to use (manpage)...
+ real_path = realpath( line .c_str(), NULL ) ;
if ( file_test( line, Glib::FILE_TEST_EXISTS ) &&
- realpath( line .c_str(), c_str ) &&
+ real_path &&
line != c_str )
{
//because we can make no assumption about which path libparted will detect
@@ -500,6 +503,8 @@
alternate_paths[ c_str ] = line ;
alternate_paths[ line ] = c_str ;
}
+ if ( real_path )
+ free( real_path ) ;
}
proc_partitions .close() ;