]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/login/logind-core.c
tree-wide: drop pointless zero initialization (#16900)
[thirdparty/systemd.git] / src / login / logind-core.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2
3 #include <fcntl.h>
4 #include <sys/ioctl.h>
5 #include <sys/types.h>
6 #include <linux/vt.h>
7
8 #include "sd-device.h"
9
10 #include "alloc-util.h"
11 #include "bus-error.h"
12 #include "bus-util.h"
13 #include "cgroup-util.h"
14 #include "conf-parser.h"
15 #include "device-util.h"
16 #include "efi-loader.h"
17 #include "errno-util.h"
18 #include "fd-util.h"
19 #include "limits-util.h"
20 #include "logind.h"
21 #include "parse-util.h"
22 #include "path-util.h"
23 #include "process-util.h"
24 #include "strv.h"
25 #include "terminal-util.h"
26 #include "udev-util.h"
27 #include "user-util.h"
28 #include "userdb.h"
29 #include "utmp-wtmp.h"
30
31 void manager_reset_config(Manager *m) {
32 assert(m);
33
34 m->n_autovts = 6;
35 m->reserve_vt = 6;
36 m->remove_ipc = true;
37 m->inhibit_delay_max = 5 * USEC_PER_SEC;
38 m->user_stop_delay = 10 * USEC_PER_SEC;
39
40 m->handle_power_key = HANDLE_POWEROFF;
41 m->handle_suspend_key = HANDLE_SUSPEND;
42 m->handle_hibernate_key = HANDLE_HIBERNATE;
43 m->handle_lid_switch = HANDLE_SUSPEND;
44 m->handle_lid_switch_ep = _HANDLE_ACTION_INVALID;
45 m->handle_lid_switch_docked = HANDLE_IGNORE;
46 m->power_key_ignore_inhibited = false;
47 m->suspend_key_ignore_inhibited = false;
48 m->hibernate_key_ignore_inhibited = false;
49 m->lid_switch_ignore_inhibited = true;
50
51 m->holdoff_timeout_usec = 30 * USEC_PER_SEC;
52
53 m->idle_action_usec = 30 * USEC_PER_MINUTE;
54 m->idle_action = HANDLE_IGNORE;
55
56 m->runtime_dir_size = physical_memory_scale(10U, 100U); /* 10% */
57 m->runtime_dir_inodes = DIV_ROUND_UP(m->runtime_dir_size, 4096); /* 4k per inode */
58 m->sessions_max = 8192;
59 m->inhibitors_max = 8192;
60
61 m->kill_user_processes = KILL_USER_PROCESSES;
62
63 m->kill_only_users = strv_free(m->kill_only_users);
64 m->kill_exclude_users = strv_free(m->kill_exclude_users);
65 }
66
67 int manager_parse_config_file(Manager *m) {
68 assert(m);
69
70 return config_parse_many_nulstr(
71 PKGSYSCONFDIR "/logind.conf",
72 CONF_PATHS_NULSTR("systemd/logind.conf.d"),
73 "Login\0",
74 config_item_perf_lookup, logind_gperf_lookup,
75 CONFIG_PARSE_WARN, m,
76 NULL);
77 }
78
79 int manager_add_device(Manager *m, const char *sysfs, bool master, Device **ret_device) {
80 Device *d;
81
82 assert(m);
83 assert(sysfs);
84
85 d = hashmap_get(m->devices, sysfs);
86 if (d)
87 /* we support adding master-flags, but not removing them */
88 d->master = d->master || master;
89 else {
90 d = device_new(m, sysfs, master);
91 if (!d)
92 return -ENOMEM;
93 }
94
95 if (ret_device)
96 *ret_device = d;
97
98 return 0;
99 }
100
101 int manager_add_seat(Manager *m, const char *id, Seat **ret_seat) {
102 Seat *s;
103 int r;
104
105 assert(m);
106 assert(id);
107
108 s = hashmap_get(m->seats, id);
109 if (!s) {
110 r = seat_new(&s, m, id);
111 if (r < 0)
112 return r;
113 }
114
115 if (ret_seat)
116 *ret_seat = s;
117
118 return 0;
119 }
120
121 int manager_add_session(Manager *m, const char *id, Session **ret_session) {
122 Session *s;
123 int r;
124
125 assert(m);
126 assert(id);
127
128 s = hashmap_get(m->sessions, id);
129 if (!s) {
130 r = session_new(&s, m, id);
131 if (r < 0)
132 return r;
133 }
134
135 if (ret_session)
136 *ret_session = s;
137
138 return 0;
139 }
140
141 int manager_add_user(
142 Manager *m,
143 UserRecord *ur,
144 User **ret_user) {
145
146 User *u;
147 int r;
148
149 assert(m);
150 assert(ur);
151
152 u = hashmap_get(m->users, UID_TO_PTR(ur->uid));
153 if (!u) {
154 r = user_new(&u, m, ur);
155 if (r < 0)
156 return r;
157 }
158
159 if (ret_user)
160 *ret_user = u;
161
162 return 0;
163 }
164
165 int manager_add_user_by_name(
166 Manager *m,
167 const char *name,
168 User **ret_user) {
169
170 _cleanup_(user_record_unrefp) UserRecord *ur = NULL;
171 int r;
172
173 assert(m);
174 assert(name);
175
176 r = userdb_by_name(name, USERDB_AVOID_SHADOW, &ur);
177 if (r < 0)
178 return r;
179
180 return manager_add_user(m, ur, ret_user);
181 }
182
183 int manager_add_user_by_uid(
184 Manager *m,
185 uid_t uid,
186 User **ret_user) {
187
188 _cleanup_(user_record_unrefp) UserRecord *ur = NULL;
189 int r;
190
191 assert(m);
192 assert(uid_is_valid(uid));
193
194 r = userdb_by_uid(uid, USERDB_AVOID_SHADOW, &ur);
195 if (r < 0)
196 return r;
197
198 return manager_add_user(m, ur, ret_user);
199 }
200
201 int manager_add_inhibitor(Manager *m, const char* id, Inhibitor **ret) {
202 Inhibitor *i;
203 int r;
204
205 assert(m);
206 assert(id);
207
208 i = hashmap_get(m->inhibitors, id);
209 if (!i) {
210 r = inhibitor_new(&i, m, id);
211 if (r < 0)
212 return r;
213 }
214
215 if (ret)
216 *ret = i;
217
218 return 0;
219 }
220
221 int manager_add_button(Manager *m, const char *name, Button **ret_button) {
222 Button *b;
223
224 assert(m);
225 assert(name);
226
227 b = hashmap_get(m->buttons, name);
228 if (!b) {
229 b = button_new(m, name);
230 if (!b)
231 return -ENOMEM;
232 }
233
234 if (ret_button)
235 *ret_button = b;
236
237 return 0;
238 }
239
240 int manager_process_seat_device(Manager *m, sd_device *d) {
241 Device *device;
242 int r;
243
244 assert(m);
245
246 if (device_for_action(d, DEVICE_ACTION_REMOVE)) {
247 const char *syspath;
248
249 r = sd_device_get_syspath(d, &syspath);
250 if (r < 0)
251 return 0;
252
253 device = hashmap_get(m->devices, syspath);
254 if (!device)
255 return 0;
256
257 seat_add_to_gc_queue(device->seat);
258 device_free(device);
259
260 } else {
261 const char *sn, *syspath;
262 bool master;
263 Seat *seat;
264
265 if (sd_device_get_property_value(d, "ID_SEAT", &sn) < 0 || isempty(sn))
266 sn = "seat0";
267
268 if (!seat_name_is_valid(sn)) {
269 log_device_warning(d, "Device with invalid seat name %s found, ignoring.", sn);
270 return 0;
271 }
272
273 seat = hashmap_get(m->seats, sn);
274 master = sd_device_has_tag(d, "master-of-seat") > 0;
275
276 /* Ignore non-master devices for unknown seats */
277 if (!master && !seat)
278 return 0;
279
280 r = sd_device_get_syspath(d, &syspath);
281 if (r < 0)
282 return r;
283
284 r = manager_add_device(m, syspath, master, &device);
285 if (r < 0)
286 return r;
287
288 if (!seat) {
289 r = manager_add_seat(m, sn, &seat);
290 if (r < 0) {
291 if (!device->seat)
292 device_free(device);
293
294 return r;
295 }
296 }
297
298 device_attach(device, seat);
299 seat_start(seat);
300 }
301
302 return 0;
303 }
304
305 int manager_process_button_device(Manager *m, sd_device *d) {
306 const char *sysname;
307 Button *b;
308 int r;
309
310 assert(m);
311
312 r = sd_device_get_sysname(d, &sysname);
313 if (r < 0)
314 return r;
315
316 if (device_for_action(d, DEVICE_ACTION_REMOVE)) {
317
318 b = hashmap_get(m->buttons, sysname);
319 if (!b)
320 return 0;
321
322 button_free(b);
323
324 } else {
325 const char *sn;
326
327 r = manager_add_button(m, sysname, &b);
328 if (r < 0)
329 return r;
330
331 if (sd_device_get_property_value(d, "ID_SEAT", &sn) < 0 || isempty(sn))
332 sn = "seat0";
333
334 button_set_seat(b, sn);
335
336 r = button_open(b);
337 if (r < 0) /* event device doesn't have any keys or switches relevant to us? (or any other error
338 * opening the device?) let's close the button again. */
339 button_free(b);
340 }
341
342 return 0;
343 }
344
345 int manager_get_session_by_pid(Manager *m, pid_t pid, Session **ret) {
346 _cleanup_free_ char *unit = NULL;
347 Session *s;
348 int r;
349
350 assert(m);
351
352 if (!pid_is_valid(pid))
353 return -EINVAL;
354
355 s = hashmap_get(m->sessions_by_leader, PID_TO_PTR(pid));
356 if (!s) {
357 r = cg_pid_get_unit(pid, &unit);
358 if (r >= 0)
359 s = hashmap_get(m->session_units, unit);
360 }
361
362 if (ret)
363 *ret = s;
364
365 return !!s;
366 }
367
368 int manager_get_user_by_pid(Manager *m, pid_t pid, User **ret) {
369 _cleanup_free_ char *unit = NULL;
370 User *u = NULL;
371 int r;
372
373 assert(m);
374
375 if (!pid_is_valid(pid))
376 return -EINVAL;
377
378 r = cg_pid_get_slice(pid, &unit);
379 if (r >= 0)
380 u = hashmap_get(m->user_units, unit);
381
382 if (ret)
383 *ret = u;
384
385 return !!u;
386 }
387
388 int manager_get_idle_hint(Manager *m, dual_timestamp *t) {
389 Session *s;
390 bool idle_hint;
391 dual_timestamp ts = DUAL_TIMESTAMP_NULL;
392 Iterator i;
393
394 assert(m);
395
396 idle_hint = !manager_is_inhibited(m, INHIBIT_IDLE, INHIBIT_BLOCK, t, false, false, 0, NULL);
397
398 HASHMAP_FOREACH(s, m->sessions, i) {
399 dual_timestamp k;
400 int ih;
401
402 ih = session_get_idle_hint(s, &k);
403 if (ih < 0)
404 return ih;
405
406 if (!ih) {
407 if (!idle_hint) {
408 if (k.monotonic < ts.monotonic)
409 ts = k;
410 } else {
411 idle_hint = false;
412 ts = k;
413 }
414 } else if (idle_hint) {
415
416 if (k.monotonic > ts.monotonic)
417 ts = k;
418 }
419 }
420
421 if (t)
422 *t = ts;
423
424 return idle_hint;
425 }
426
427 bool manager_shall_kill(Manager *m, const char *user) {
428 assert(m);
429 assert(user);
430
431 if (!m->kill_exclude_users && streq(user, "root"))
432 return false;
433
434 if (strv_contains(m->kill_exclude_users, user))
435 return false;
436
437 if (!strv_isempty(m->kill_only_users))
438 return strv_contains(m->kill_only_users, user);
439
440 return m->kill_user_processes;
441 }
442
443 int config_parse_n_autovts(
444 const char *unit,
445 const char *filename,
446 unsigned line,
447 const char *section,
448 unsigned section_line,
449 const char *lvalue,
450 int ltype,
451 const char *rvalue,
452 void *data,
453 void *userdata) {
454
455 unsigned *n = data;
456 unsigned o;
457 int r;
458
459 assert(filename);
460 assert(lvalue);
461 assert(rvalue);
462 assert(data);
463
464 r = safe_atou(rvalue, &o);
465 if (r < 0) {
466 log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse number of autovts, ignoring: %s", rvalue);
467 return 0;
468 }
469
470 if (o > 15) {
471 log_syntax(unit, LOG_ERR, filename, line, r, "A maximum of 15 autovts are supported, ignoring: %s", rvalue);
472 return 0;
473 }
474
475 *n = o;
476 return 0;
477 }
478
479 static int vt_is_busy(unsigned vtnr) {
480 struct vt_stat vt_stat;
481 int r;
482 _cleanup_close_ int fd;
483
484 assert(vtnr >= 1);
485
486 /* VT_GETSTATE "cannot return state for more than 16 VTs, since v_state is short" */
487 assert(vtnr <= 15);
488
489 /* We explicitly open /dev/tty1 here instead of /dev/tty0. If
490 * we'd open the latter we'd open the foreground tty which
491 * hence would be unconditionally busy. By opening /dev/tty1
492 * we avoid this. Since tty1 is special and needs to be an
493 * explicitly loaded getty or DM this is safe. */
494
495 fd = open_terminal("/dev/tty1", O_RDWR|O_NOCTTY|O_CLOEXEC);
496 if (fd < 0)
497 return -errno;
498
499 if (ioctl(fd, VT_GETSTATE, &vt_stat) < 0)
500 r = -errno;
501 else
502 r = !!(vt_stat.v_state & (1 << vtnr));
503
504 return r;
505 }
506
507 int manager_spawn_autovt(Manager *m, unsigned vtnr) {
508 _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
509 char name[sizeof("autovt@tty.service") + DECIMAL_STR_MAX(unsigned)];
510 int r;
511
512 assert(m);
513 assert(vtnr >= 1);
514
515 if (vtnr > m->n_autovts &&
516 vtnr != m->reserve_vt)
517 return 0;
518
519 if (vtnr != m->reserve_vt) {
520 /* If this is the reserved TTY, we'll start the getty
521 * on it in any case, but otherwise only if it is not
522 * busy. */
523
524 r = vt_is_busy(vtnr);
525 if (r < 0)
526 return r;
527 else if (r > 0)
528 return -EBUSY;
529 }
530
531 snprintf(name, sizeof(name), "autovt@tty%u.service", vtnr);
532 r = sd_bus_call_method(
533 m->bus,
534 "org.freedesktop.systemd1",
535 "/org/freedesktop/systemd1",
536 "org.freedesktop.systemd1.Manager",
537 "StartUnit",
538 &error,
539 NULL,
540 "ss", name, "fail");
541 if (r < 0)
542 return log_error_errno(r, "Failed to start %s: %s", name, bus_error_message(&error, r));
543
544 return 0;
545 }
546
547 bool manager_is_lid_closed(Manager *m) {
548 Iterator i;
549 Button *b;
550
551 HASHMAP_FOREACH(b, m->buttons, i)
552 if (b->lid_closed)
553 return true;
554
555 return false;
556 }
557
558 static bool manager_is_docked(Manager *m) {
559 Iterator i;
560 Button *b;
561
562 HASHMAP_FOREACH(b, m->buttons, i)
563 if (b->docked)
564 return true;
565
566 return false;
567 }
568
569 static int manager_count_external_displays(Manager *m) {
570 _cleanup_(sd_device_enumerator_unrefp) sd_device_enumerator *e = NULL;
571 sd_device *d;
572 int r, n = 0;
573
574 r = sd_device_enumerator_new(&e);
575 if (r < 0)
576 return r;
577
578 r = sd_device_enumerator_allow_uninitialized(e);
579 if (r < 0)
580 return r;
581
582 r = sd_device_enumerator_add_match_subsystem(e, "drm", true);
583 if (r < 0)
584 return r;
585
586 FOREACH_DEVICE(e, d) {
587 const char *status, *enabled, *dash, *nn, *subsys;
588 sd_device *p;
589
590 if (sd_device_get_parent(d, &p) < 0)
591 continue;
592
593 /* If the parent shares the same subsystem as the
594 * device we are looking at then it is a connector,
595 * which is what we are interested in. */
596 if (sd_device_get_subsystem(p, &subsys) < 0 || !streq(subsys, "drm"))
597 continue;
598
599 if (sd_device_get_sysname(d, &nn) < 0)
600 continue;
601
602 /* Ignore internal displays: the type is encoded in the sysfs name, as the second dash
603 * separated item (the first is the card name, the last the connector number). We implement a
604 * deny list of external displays here, rather than an allow list of internal ones, to ensure
605 * we don't block suspends too eagerly. */
606 dash = strchr(nn, '-');
607 if (!dash)
608 continue;
609
610 dash++;
611 if (!STARTSWITH_SET(dash,
612 "VGA-", "DVI-I-", "DVI-D-", "DVI-A-"
613 "Composite-", "SVIDEO-", "Component-",
614 "DIN-", "DP-", "HDMI-A-", "HDMI-B-", "TV-"))
615 continue;
616
617 /* Ignore ports that are not enabled */
618 if (sd_device_get_sysattr_value(d, "enabled", &enabled) < 0 || !streq(enabled, "enabled"))
619 continue;
620
621 /* We count any connector which is not explicitly
622 * "disconnected" as connected. */
623 if (sd_device_get_sysattr_value(d, "status", &status) < 0 || !streq(status, "disconnected"))
624 n++;
625 }
626
627 return n;
628 }
629
630 bool manager_is_docked_or_external_displays(Manager *m) {
631 int n;
632
633 /* If we are docked don't react to lid closing */
634 if (manager_is_docked(m)) {
635 log_debug("System is docked.");
636 return true;
637 }
638
639 /* If we have more than one display connected,
640 * assume that we are docked. */
641 n = manager_count_external_displays(m);
642 if (n < 0)
643 log_warning_errno(n, "Display counting failed: %m");
644 else if (n >= 1) {
645 log_debug("External (%i) displays connected.", n);
646 return true;
647 }
648
649 return false;
650 }
651
652 bool manager_is_on_external_power(void) {
653 int r;
654
655 /* For now we only check for AC power, but 'external power' can apply to anything that isn't an internal
656 * battery */
657 r = on_ac_power();
658 if (r < 0)
659 log_warning_errno(r, "Failed to read AC power status: %m");
660
661 return r != 0; /* Treat failure as 'on AC' */
662 }
663
664 bool manager_all_buttons_ignored(Manager *m) {
665 assert(m);
666
667 if (m->handle_power_key != HANDLE_IGNORE)
668 return false;
669 if (m->handle_suspend_key != HANDLE_IGNORE)
670 return false;
671 if (m->handle_hibernate_key != HANDLE_IGNORE)
672 return false;
673 if (m->handle_lid_switch != HANDLE_IGNORE)
674 return false;
675 if (!IN_SET(m->handle_lid_switch_ep, _HANDLE_ACTION_INVALID, HANDLE_IGNORE))
676 return false;
677 if (m->handle_lid_switch_docked != HANDLE_IGNORE)
678 return false;
679
680 return true;
681 }
682
683 int manager_read_utmp(Manager *m) {
684 #if ENABLE_UTMP
685 int r;
686 _cleanup_(utxent_cleanup) bool utmpx = false;
687
688 assert(m);
689
690 if (utmpxname(_PATH_UTMPX) < 0)
691 return log_error_errno(errno, "Failed to set utmp path to " _PATH_UTMPX ": %m");
692
693 utmpx = utxent_start();
694
695 for (;;) {
696 _cleanup_free_ char *t = NULL;
697 struct utmpx *u;
698 const char *c;
699 Session *s;
700
701 errno = 0;
702 u = getutxent();
703 if (!u) {
704 if (errno != 0)
705 log_warning_errno(errno, "Failed to read " _PATH_UTMPX ", ignoring: %m");
706 return 0;
707 }
708
709 if (u->ut_type != USER_PROCESS)
710 continue;
711
712 if (!pid_is_valid(u->ut_pid))
713 continue;
714
715 t = strndup(u->ut_line, sizeof(u->ut_line));
716 if (!t)
717 return log_oom();
718
719 c = path_startswith(t, "/dev/");
720 if (c) {
721 r = free_and_strdup(&t, c);
722 if (r < 0)
723 return log_oom();
724 }
725
726 if (isempty(t))
727 continue;
728
729 s = hashmap_get(m->sessions_by_leader, PID_TO_PTR(u->ut_pid));
730 if (!s)
731 continue;
732
733 if (s->tty_validity == TTY_FROM_UTMP && !streq_ptr(s->tty, t)) {
734 /* This may happen on multiplexed SSH connection (i.e. 'SSH connection sharing'). In
735 * this case PAM and utmp sessions don't match. In such a case let's invalidate the TTY
736 * information and never acquire it again. */
737
738 s->tty = mfree(s->tty);
739 s->tty_validity = TTY_UTMP_INCONSISTENT;
740 log_debug("Session '%s' has inconsistent TTY information, dropping TTY information.", s->id);
741 continue;
742 }
743
744 /* Never override what we figured out once */
745 if (s->tty || s->tty_validity >= 0)
746 continue;
747
748 s->tty = TAKE_PTR(t);
749 s->tty_validity = TTY_FROM_UTMP;
750 log_debug("Acquired TTY information '%s' from utmp for session '%s'.", s->tty, s->id);
751 }
752
753 #else
754 return 0;
755 #endif
756 }
757
758 #if ENABLE_UTMP
759 static int manager_dispatch_utmp(sd_event_source *s, const struct inotify_event *event, void *userdata) {
760 Manager *m = userdata;
761
762 assert(m);
763
764 /* If there's indication the file itself might have been removed or became otherwise unavailable, then let's
765 * reestablish the watch on whatever there's now. */
766 if ((event->mask & (IN_ATTRIB|IN_DELETE_SELF|IN_MOVE_SELF|IN_Q_OVERFLOW|IN_UNMOUNT)) != 0)
767 manager_connect_utmp(m);
768
769 (void) manager_read_utmp(m);
770 return 0;
771 }
772 #endif
773
774 void manager_connect_utmp(Manager *m) {
775 #if ENABLE_UTMP
776 sd_event_source *s = NULL;
777 int r;
778
779 assert(m);
780
781 /* Watch utmp for changes via inotify. We do this to deal with tools such as ssh, which will register the PAM
782 * session early, and acquire a TTY only much later for the connection. Thus during PAM the TTY won't be known
783 * yet. ssh will register itself with utmp when it finally acquired the TTY. Hence, let's make use of this, and
784 * watch utmp for the TTY asynchronously. We use the PAM session's leader PID as key, to find the right entry.
785 *
786 * Yes, relying on utmp is pretty ugly, but it's good enough for informational purposes, as well as idle
787 * detection (which, for tty sessions, relies on the TTY used) */
788
789 r = sd_event_add_inotify(m->event, &s, _PATH_UTMPX, IN_MODIFY|IN_MOVE_SELF|IN_DELETE_SELF|IN_ATTRIB, manager_dispatch_utmp, m);
790 if (r < 0)
791 log_full_errno(r == -ENOENT ? LOG_DEBUG: LOG_WARNING, r, "Failed to create inotify watch on " _PATH_UTMPX ", ignoring: %m");
792 else {
793 r = sd_event_source_set_priority(s, SD_EVENT_PRIORITY_IDLE);
794 if (r < 0)
795 log_warning_errno(r, "Failed to adjust utmp event source priority, ignoring: %m");
796
797 (void) sd_event_source_set_description(s, "utmp");
798 }
799
800 sd_event_source_unref(m->utmp_event_source);
801 m->utmp_event_source = s;
802 #endif
803 }
804
805 void manager_reconnect_utmp(Manager *m) {
806 #if ENABLE_UTMP
807 assert(m);
808
809 if (m->utmp_event_source)
810 return;
811
812 manager_connect_utmp(m);
813 #endif
814 }
815
816 int manager_read_efi_boot_loader_entries(Manager *m) {
817 #if ENABLE_EFI
818 int r;
819
820 assert(m);
821 if (m->efi_boot_loader_entries_set)
822 return 0;
823
824 r = efi_loader_get_entries(&m->efi_boot_loader_entries);
825 if (r == -ENOENT || ERRNO_IS_NOT_SUPPORTED(r)) {
826 log_debug_errno(r, "Boot loader reported no entries.");
827 m->efi_boot_loader_entries_set = true;
828 return 0;
829 }
830 if (r < 0)
831 return log_error_errno(r, "Failed to determine entries reported by boot loader: %m");
832
833 m->efi_boot_loader_entries_set = true;
834 return 1;
835 #else
836 return 0;
837 #endif
838 }