mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-05 00:43:40 +02:00
Revert "glocalfile: Check that parent device is the same when trashing"
This reverts commit 15cdcd2e0b
.
This commit is contained in:
@@ -1677,20 +1677,16 @@ find_mountpoint_for (const char *file,
|
||||
}
|
||||
}
|
||||
|
||||
static char *
|
||||
_g_local_file_find_topdir_for_internal (const char *file, dev_t file_dev)
|
||||
char *
|
||||
_g_local_file_find_topdir_for (const char *file)
|
||||
{
|
||||
char *dir;
|
||||
char *mountpoint = NULL;
|
||||
dev_t dir_dev;
|
||||
|
||||
dir = get_parent (file, &dir_dev);
|
||||
if (dir == NULL || dir_dev != file_dev)
|
||||
{
|
||||
g_free (dir);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
if (dir == NULL)
|
||||
return NULL;
|
||||
|
||||
mountpoint = find_mountpoint_for (dir, dir_dev);
|
||||
g_free (dir);
|
||||
@@ -1698,17 +1694,6 @@ _g_local_file_find_topdir_for_internal (const char *file, dev_t file_dev)
|
||||
return mountpoint;
|
||||
}
|
||||
|
||||
char *
|
||||
_g_local_file_find_topdir_for (const char *file)
|
||||
{
|
||||
GStatBuf file_stat;
|
||||
|
||||
if (g_lstat (file, &file_stat) != 0)
|
||||
return NULL;
|
||||
|
||||
return _g_local_file_find_topdir_for_internal (file, file_stat.st_dev);
|
||||
}
|
||||
|
||||
static char *
|
||||
get_unique_filename (const char *basename,
|
||||
int id)
|
||||
@@ -1962,8 +1947,7 @@ g_local_file_trash (GFile *file,
|
||||
uid = geteuid ();
|
||||
g_snprintf (uid_str, sizeof (uid_str), "%lu", (unsigned long)uid);
|
||||
|
||||
topdir = _g_local_file_find_topdir_for_internal (local->filename,
|
||||
file_stat.st_dev);
|
||||
topdir = _g_local_file_find_topdir_for (local->filename);
|
||||
if (topdir == NULL)
|
||||
{
|
||||
g_set_io_error (error,
|
||||
|
Reference in New Issue
Block a user