mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-04 10:39:08 +02:00
_dbus_check_dir_is_private_to_user: check that we own it
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61303 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
parent
723da23545
commit
00211794ed
1 changed files with 10 additions and 0 deletions
|
|
@ -1999,6 +1999,16 @@ _dbus_check_dir_is_private_to_user (DBusString *dir, DBusError *error)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (sb.st_uid != geteuid ())
|
||||
{
|
||||
dbus_set_error (error, DBUS_ERROR_FAILED,
|
||||
"%s directory is owned by user %lu, not %lu",
|
||||
directory,
|
||||
(unsigned long) sb.st_uid,
|
||||
(unsigned long) geteuid ());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((S_IROTH & sb.st_mode) || (S_IWOTH & sb.st_mode) ||
|
||||
(S_IRGRP & sb.st_mode) || (S_IWGRP & sb.st_mode))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue