tree-wide: unify logging of "Must be root" message

Let's unify this in one call, generalizing must_be_root() from
bootctl.c.
This commit is contained in:
Lennart Poettering
2017-12-11 23:19:45 +01:00
parent 4fe2ba0e25
commit fba868fa71
7 changed files with 25 additions and 27 deletions
-9
View File
@@ -925,15 +925,6 @@ static void read_loader_efi_var(const char *name, char **var) {
log_warning_errno(r, "Failed to read EFI variable %s: %m", name);
}
static int must_be_root(void) {
if (geteuid() == 0)
return 0;
log_error("Need to be root.");
return -EPERM;
}
static int verb_status(int argc, char *argv[], void *userdata) {
sd_id128_t uuid = SD_ID128_NULL;