Lines 62-67
Link Here
|
62 |
check_umount_policy( const char* device, int do_lazy ) |
62 |
check_umount_policy( const char* device, int do_lazy ) |
63 |
{ |
63 |
{ |
64 |
int devvalid; |
64 |
int devvalid; |
|
|
65 |
char mediadir[PATH_MAX]; |
65 |
|
66 |
|
66 |
devvalid = ( do_lazy || device_valid( device ) ) && |
67 |
devvalid = ( do_lazy || device_valid( device ) ) && |
67 |
device_mounted( device, 1, mntpt ); |
68 |
device_mounted( device, 1, mntpt ); |
Lines 75-82
Link Here
|
75 |
exit( E_INTERNAL ); |
76 |
exit( E_INTERNAL ); |
76 |
} |
77 |
} |
77 |
|
78 |
|
|
|
79 |
/* MEDIADIR may be a symlink (for read-only root systems) */ |
80 |
if( NULL == realpath( MEDIADIR, mediadir ) ) { |
81 |
fprintf( stderr, _("Error: could not find real path of %s\n"), |
82 |
MEDIADIR ); |
83 |
exit( E_INTERNAL ); |
84 |
} |
85 |
|
78 |
/* mount point must be below MEDIADIR */ |
86 |
/* mount point must be below MEDIADIR */ |
79 |
if( strncmp( mntpt, MEDIADIR, sizeof( MEDIADIR )-1 ) ) { |
87 |
if( strncmp( mntpt, mediadir, strlen( mediadir ) ) ) { |
80 |
fprintf( stderr, _("Error: mount point %s is not below %s\n"), mntpt, |
88 |
fprintf( stderr, _("Error: mount point %s is not below %s\n"), mntpt, |
81 |
MEDIADIR ); |
89 |
MEDIADIR ); |
82 |
return -1; |
90 |
return -1; |