mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-09 01:18:35 +03:00
ostadmin: Print an error message if run as non-root
See https://bugzilla.gnome.org/show_bug.cgi?id=680823
This commit is contained in:
parent
a179138a23
commit
5284d21f8d
@ -100,6 +100,13 @@ ot_admin_main (int argc,
|
||||
if (argc < 2)
|
||||
return usage (argv, builtins, 1);
|
||||
|
||||
if (geteuid () != 0)
|
||||
{
|
||||
g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"ostadmin: Can only be run as root");
|
||||
goto out;
|
||||
}
|
||||
|
||||
cmd = argv[1];
|
||||
|
||||
builtin = builtins;
|
||||
|
Loading…
Reference in New Issue
Block a user