remove use of realpath

It won't work on linux systems with grsec.
This commit is contained in:
John Cupitt 2019-11-27 15:14:42 +00:00
parent 298002c530
commit 0bc49a485e
2 changed files with 3 additions and 19 deletions

View File

@ -1,5 +1,6 @@
17/9/19 started 8.8.4
- improve compatibility with older imagemagick versions
- remove realpath, since it can fail on systems with grsec
31/8/19 started 8.8.3
- revert sharpen restoring the input colourspace

View File

@ -1873,25 +1873,10 @@ vips_realpath( const char *path )
{
char *real;
#ifdef HAVE_REALPATH
{
char buf[PATH_MAX];
/* More modern realpath() allow NULL for the second param, but we want
* to work with older libc as well.
/* It'd be nice to use realpath here, but sadly that won't work on
* linux systems with grsec, since it works by opening /proc/self/fd.
*/
if( !(real = realpath( path, buf )) ) {
vips_error_system( errno, "vips_realpath",
"%s", _( "unable to form filename" ) );
return( NULL );
}
/* We must return a path that can be freed with g_free().
*/
real = g_strdup( real );
}
#else /*!HAVE_REALPATH*/
{
if( !g_path_is_absolute( path ) ) {
char *cwd;
@ -1901,8 +1886,6 @@ vips_realpath( const char *path )
}
else
real = g_strdup( path );
}
#endif
return( real );
}