Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/plugins/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ gboolean bd_dm_map_exists (const gchar *map_name, gboolean live_only, gboolean a
guint64 next = 0;
gboolean ret = FALSE;

if (geteuid () != 0) {
g_set_error (error, BD_DM_ERROR, BD_DM_ERROR_NOT_ROOT,
"Not running as root, cannot query DM maps");
return FALSE;
}

task_list = dm_task_create (DM_DEVICE_LIST);
if (!task_list) {
g_set_error (error, BD_DM_ERROR, BD_DM_ERROR_TASK,
Expand Down