]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/condition.c
tree-wide: drop 'This file is part of systemd' blurb
[thirdparty/systemd.git] / src / shared / condition.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 /***
3 Copyright 2010 Lennart Poettering
4 ***/
5
6 #include <errno.h>
7 #include <fcntl.h>
8 #include <fnmatch.h>
9 #include <limits.h>
10 #include <stdlib.h>
11 #include <string.h>
12 #include <sys/stat.h>
13 #include <sys/types.h>
14 #include <sys/utsname.h>
15 #include <time.h>
16 #include <unistd.h>
17
18 #include "sd-id128.h"
19
20 #include "alloc-util.h"
21 #include "apparmor-util.h"
22 #include "architecture.h"
23 #include "audit-util.h"
24 #include "cap-list.h"
25 #include "cgroup-util.h"
26 #include "condition.h"
27 #include "extract-word.h"
28 #include "fd-util.h"
29 #include "fileio.h"
30 #include "glob-util.h"
31 #include "hostname-util.h"
32 #include "ima-util.h"
33 #include "list.h"
34 #include "macro.h"
35 #include "mount-util.h"
36 #include "parse-util.h"
37 #include "path-util.h"
38 #include "proc-cmdline.h"
39 #include "process-util.h"
40 #include "selinux-util.h"
41 #include "smack-util.h"
42 #include "stat-util.h"
43 #include "string-table.h"
44 #include "string-util.h"
45 #include "tomoyo-util.h"
46 #include "user-util.h"
47 #include "util.h"
48 #include "virt.h"
49
50 Condition* condition_new(ConditionType type, const char *parameter, bool trigger, bool negate) {
51 Condition *c;
52 int r;
53
54 assert(type >= 0);
55 assert(type < _CONDITION_TYPE_MAX);
56 assert((!parameter) == (type == CONDITION_NULL));
57
58 c = new0(Condition, 1);
59 if (!c)
60 return NULL;
61
62 c->type = type;
63 c->trigger = trigger;
64 c->negate = negate;
65
66 r = free_and_strdup(&c->parameter, parameter);
67 if (r < 0) {
68 return mfree(c);
69 }
70
71 return c;
72 }
73
74 void condition_free(Condition *c) {
75 assert(c);
76
77 free(c->parameter);
78 free(c);
79 }
80
81 Condition* condition_free_list(Condition *first) {
82 Condition *c, *n;
83
84 LIST_FOREACH_SAFE(conditions, c, n, first)
85 condition_free(c);
86
87 return NULL;
88 }
89
90 static int condition_test_kernel_command_line(Condition *c) {
91 _cleanup_free_ char *line = NULL;
92 const char *p;
93 bool equal;
94 int r;
95
96 assert(c);
97 assert(c->parameter);
98 assert(c->type == CONDITION_KERNEL_COMMAND_LINE);
99
100 r = proc_cmdline(&line);
101 if (r < 0)
102 return r;
103
104 equal = strchr(c->parameter, '=');
105
106 for (p = line;;) {
107 _cleanup_free_ char *word = NULL;
108 bool found;
109
110 r = extract_first_word(&p, &word, NULL, EXTRACT_QUOTES|EXTRACT_RELAX);
111 if (r < 0)
112 return r;
113 if (r == 0)
114 break;
115
116 if (equal)
117 found = streq(word, c->parameter);
118 else {
119 const char *f;
120
121 f = startswith(word, c->parameter);
122 found = f && IN_SET(*f, 0, '=');
123 }
124
125 if (found)
126 return true;
127 }
128
129 return false;
130 }
131
132 static int condition_test_kernel_version(Condition *c) {
133 enum {
134 /* Listed in order of checking. Note that some comparators are prefixes of others, hence the longest
135 * should be listed first. */
136 LOWER_OR_EQUAL,
137 GREATER_OR_EQUAL,
138 LOWER,
139 GREATER,
140 EQUAL,
141 _ORDER_MAX,
142 };
143
144 static const char *const prefix[_ORDER_MAX] = {
145 [LOWER_OR_EQUAL] = "<=",
146 [GREATER_OR_EQUAL] = ">=",
147 [LOWER] = "<",
148 [GREATER] = ">",
149 [EQUAL] = "=",
150 };
151 const char *p = NULL;
152 struct utsname u;
153 size_t i;
154 int k;
155
156 assert(c);
157 assert(c->parameter);
158 assert(c->type == CONDITION_KERNEL_VERSION);
159
160 assert_se(uname(&u) >= 0);
161
162 for (i = 0; i < _ORDER_MAX; i++) {
163 p = startswith(c->parameter, prefix[i]);
164 if (p)
165 break;
166 }
167
168 /* No prefix? Then treat as glob string */
169 if (!p)
170 return fnmatch(skip_leading_chars(c->parameter, NULL), u.release, 0) == 0;
171
172 k = str_verscmp(u.release, skip_leading_chars(p, NULL));
173
174 switch (i) {
175
176 case LOWER:
177 return k < 0;
178
179 case LOWER_OR_EQUAL:
180 return k <= 0;
181
182 case EQUAL:
183 return k == 0;
184
185 case GREATER_OR_EQUAL:
186 return k >= 0;
187
188 case GREATER:
189 return k > 0;
190
191 default:
192 assert_not_reached("Can't compare");
193 }
194 }
195
196 static int condition_test_user(Condition *c) {
197 uid_t id;
198 int r;
199 _cleanup_free_ char *username = NULL;
200 const char *u;
201
202 assert(c);
203 assert(c->parameter);
204 assert(c->type == CONDITION_USER);
205
206 r = parse_uid(c->parameter, &id);
207 if (r >= 0)
208 return id == getuid() || id == geteuid();
209
210 if (streq("@system", c->parameter))
211 return uid_is_system(getuid()) || uid_is_system(geteuid());
212
213 username = getusername_malloc();
214 if (!username)
215 return -ENOMEM;
216
217 if (streq(username, c->parameter))
218 return 1;
219
220 if (getpid_cached() == 1)
221 return streq(c->parameter, "root");
222
223 u = c->parameter;
224 r = get_user_creds(&u, &id, NULL, NULL, NULL);
225 if (r < 0)
226 return 0;
227
228 return id == getuid() || id == geteuid();
229 }
230
231 static int condition_test_control_group_controller(Condition *c) {
232 int r;
233 CGroupMask system_mask, wanted_mask = 0;
234
235 assert(c);
236 assert(c->parameter);
237 assert(c->type == CONDITION_CONTROL_GROUP_CONTROLLER);
238
239 r = cg_mask_supported(&system_mask);
240 if (r < 0)
241 return log_debug_errno(r, "Failed to determine supported controllers: %m");
242
243 r = cg_mask_from_string(c->parameter, &wanted_mask);
244 if (r < 0 || wanted_mask <= 0) {
245 /* This won't catch the case that we have an unknown controller
246 * mixed in with valid ones -- these are only assessed on the
247 * validity of the valid controllers found. */
248 log_debug("Failed to parse cgroup string: %s", c->parameter);
249 return 1;
250 }
251
252 return FLAGS_SET(system_mask, wanted_mask);
253 }
254
255 static int condition_test_group(Condition *c) {
256 gid_t id;
257 int r;
258
259 assert(c);
260 assert(c->parameter);
261 assert(c->type == CONDITION_GROUP);
262
263 r = parse_gid(c->parameter, &id);
264 if (r >= 0)
265 return in_gid(id);
266
267 /* Avoid any NSS lookups if we are PID1 */
268 if (getpid_cached() == 1)
269 return streq(c->parameter, "root");
270
271 return in_group(c->parameter) > 0;
272 }
273
274 static int condition_test_virtualization(Condition *c) {
275 int b, v;
276
277 assert(c);
278 assert(c->parameter);
279 assert(c->type == CONDITION_VIRTUALIZATION);
280
281 if (streq(c->parameter, "private-users"))
282 return running_in_userns();
283
284 v = detect_virtualization();
285 if (v < 0)
286 return v;
287
288 /* First, compare with yes/no */
289 b = parse_boolean(c->parameter);
290 if (b >= 0)
291 return b == !!v;
292
293 /* Then, compare categorization */
294 if (streq(c->parameter, "vm"))
295 return VIRTUALIZATION_IS_VM(v);
296
297 if (streq(c->parameter, "container"))
298 return VIRTUALIZATION_IS_CONTAINER(v);
299
300 /* Finally compare id */
301 return v != VIRTUALIZATION_NONE && streq(c->parameter, virtualization_to_string(v));
302 }
303
304 static int condition_test_architecture(Condition *c) {
305 int a, b;
306
307 assert(c);
308 assert(c->parameter);
309 assert(c->type == CONDITION_ARCHITECTURE);
310
311 a = uname_architecture();
312 if (a < 0)
313 return a;
314
315 if (streq(c->parameter, "native"))
316 b = native_architecture();
317 else {
318 b = architecture_from_string(c->parameter);
319 if (b < 0) /* unknown architecture? Then it's definitely not ours */
320 return false;
321 }
322
323 return a == b;
324 }
325
326 static int condition_test_host(Condition *c) {
327 _cleanup_free_ char *h = NULL;
328 sd_id128_t x, y;
329 int r;
330
331 assert(c);
332 assert(c->parameter);
333 assert(c->type == CONDITION_HOST);
334
335 if (sd_id128_from_string(c->parameter, &x) >= 0) {
336
337 r = sd_id128_get_machine(&y);
338 if (r < 0)
339 return r;
340
341 return sd_id128_equal(x, y);
342 }
343
344 h = gethostname_malloc();
345 if (!h)
346 return -ENOMEM;
347
348 return fnmatch(c->parameter, h, FNM_CASEFOLD) == 0;
349 }
350
351 static int condition_test_ac_power(Condition *c) {
352 int r;
353
354 assert(c);
355 assert(c->parameter);
356 assert(c->type == CONDITION_AC_POWER);
357
358 r = parse_boolean(c->parameter);
359 if (r < 0)
360 return r;
361
362 return (on_ac_power() != 0) == !!r;
363 }
364
365 static int condition_test_security(Condition *c) {
366 assert(c);
367 assert(c->parameter);
368 assert(c->type == CONDITION_SECURITY);
369
370 if (streq(c->parameter, "selinux"))
371 return mac_selinux_use();
372 if (streq(c->parameter, "smack"))
373 return mac_smack_use();
374 if (streq(c->parameter, "apparmor"))
375 return mac_apparmor_use();
376 if (streq(c->parameter, "audit"))
377 return use_audit();
378 if (streq(c->parameter, "ima"))
379 return use_ima();
380 if (streq(c->parameter, "tomoyo"))
381 return mac_tomoyo_use();
382
383 return false;
384 }
385
386 static int condition_test_capability(Condition *c) {
387 _cleanup_fclose_ FILE *f = NULL;
388 int value;
389 char line[LINE_MAX];
390 unsigned long long capabilities = -1;
391
392 assert(c);
393 assert(c->parameter);
394 assert(c->type == CONDITION_CAPABILITY);
395
396 /* If it's an invalid capability, we don't have it */
397 value = capability_from_name(c->parameter);
398 if (value < 0)
399 return -EINVAL;
400
401 /* If it's a valid capability we default to assume
402 * that we have it */
403
404 f = fopen("/proc/self/status", "re");
405 if (!f)
406 return -errno;
407
408 while (fgets(line, sizeof(line), f)) {
409 truncate_nl(line);
410
411 if (startswith(line, "CapBnd:")) {
412 (void) sscanf(line+7, "%llx", &capabilities);
413 break;
414 }
415 }
416
417 return !!(capabilities & (1ULL << value));
418 }
419
420 static int condition_test_needs_update(Condition *c) {
421 const char *p;
422 struct stat usr, other;
423
424 assert(c);
425 assert(c->parameter);
426 assert(c->type == CONDITION_NEEDS_UPDATE);
427
428 /* If the file system is read-only we shouldn't suggest an update */
429 if (path_is_read_only_fs(c->parameter) > 0)
430 return false;
431
432 /* Any other failure means we should allow the condition to be true,
433 * so that we rather invoke too many update tools than too
434 * few. */
435
436 if (!path_is_absolute(c->parameter))
437 return true;
438
439 p = strjoina(c->parameter, "/.updated");
440 if (lstat(p, &other) < 0)
441 return true;
442
443 if (lstat("/usr/", &usr) < 0)
444 return true;
445
446 /*
447 * First, compare seconds as they are always accurate...
448 */
449 if (usr.st_mtim.tv_sec != other.st_mtim.tv_sec)
450 return usr.st_mtim.tv_sec > other.st_mtim.tv_sec;
451
452 /*
453 * ...then compare nanoseconds.
454 *
455 * A false positive is only possible when /usr's nanoseconds > 0
456 * (otherwise /usr cannot be strictly newer than the target file)
457 * AND the target file's nanoseconds == 0
458 * (otherwise the filesystem supports nsec timestamps, see stat(2)).
459 */
460 if (usr.st_mtim.tv_nsec > 0 && other.st_mtim.tv_nsec == 0) {
461 _cleanup_free_ char *timestamp_str = NULL;
462 uint64_t timestamp;
463 int r;
464
465 r = parse_env_file(NULL, p, NULL, "TIMESTAMP_NSEC", &timestamp_str, NULL);
466 if (r < 0) {
467 log_error_errno(r, "Failed to parse timestamp file '%s', using mtime: %m", p);
468 return true;
469 } else if (r == 0) {
470 log_debug("No data in timestamp file '%s', using mtime", p);
471 return true;
472 }
473
474 r = safe_atou64(timestamp_str, &timestamp);
475 if (r < 0) {
476 log_error_errno(r, "Failed to parse timestamp value '%s' in file '%s', using mtime: %m", timestamp_str, p);
477 return true;
478 }
479
480 timespec_store(&other.st_mtim, timestamp);
481 }
482
483 return usr.st_mtim.tv_nsec > other.st_mtim.tv_nsec;
484 }
485
486 static int condition_test_first_boot(Condition *c) {
487 int r;
488
489 assert(c);
490 assert(c->parameter);
491 assert(c->type == CONDITION_FIRST_BOOT);
492
493 r = parse_boolean(c->parameter);
494 if (r < 0)
495 return r;
496
497 return (access("/run/systemd/first-boot", F_OK) >= 0) == !!r;
498 }
499
500 static int condition_test_path_exists(Condition *c) {
501 assert(c);
502 assert(c->parameter);
503 assert(c->type == CONDITION_PATH_EXISTS);
504
505 return access(c->parameter, F_OK) >= 0;
506 }
507
508 static int condition_test_path_exists_glob(Condition *c) {
509 assert(c);
510 assert(c->parameter);
511 assert(c->type == CONDITION_PATH_EXISTS_GLOB);
512
513 return glob_exists(c->parameter) > 0;
514 }
515
516 static int condition_test_path_is_directory(Condition *c) {
517 assert(c);
518 assert(c->parameter);
519 assert(c->type == CONDITION_PATH_IS_DIRECTORY);
520
521 return is_dir(c->parameter, true) > 0;
522 }
523
524 static int condition_test_path_is_symbolic_link(Condition *c) {
525 assert(c);
526 assert(c->parameter);
527 assert(c->type == CONDITION_PATH_IS_SYMBOLIC_LINK);
528
529 return is_symlink(c->parameter) > 0;
530 }
531
532 static int condition_test_path_is_mount_point(Condition *c) {
533 assert(c);
534 assert(c->parameter);
535 assert(c->type == CONDITION_PATH_IS_MOUNT_POINT);
536
537 return path_is_mount_point(c->parameter, NULL, AT_SYMLINK_FOLLOW) > 0;
538 }
539
540 static int condition_test_path_is_read_write(Condition *c) {
541 assert(c);
542 assert(c->parameter);
543 assert(c->type == CONDITION_PATH_IS_READ_WRITE);
544
545 return path_is_read_only_fs(c->parameter) <= 0;
546 }
547
548 static int condition_test_directory_not_empty(Condition *c) {
549 int r;
550
551 assert(c);
552 assert(c->parameter);
553 assert(c->type == CONDITION_DIRECTORY_NOT_EMPTY);
554
555 r = dir_is_empty(c->parameter);
556 return r <= 0 && r != -ENOENT;
557 }
558
559 static int condition_test_file_not_empty(Condition *c) {
560 struct stat st;
561
562 assert(c);
563 assert(c->parameter);
564 assert(c->type == CONDITION_FILE_NOT_EMPTY);
565
566 return (stat(c->parameter, &st) >= 0 &&
567 S_ISREG(st.st_mode) &&
568 st.st_size > 0);
569 }
570
571 static int condition_test_file_is_executable(Condition *c) {
572 struct stat st;
573
574 assert(c);
575 assert(c->parameter);
576 assert(c->type == CONDITION_FILE_IS_EXECUTABLE);
577
578 return (stat(c->parameter, &st) >= 0 &&
579 S_ISREG(st.st_mode) &&
580 (st.st_mode & 0111));
581 }
582
583 static int condition_test_null(Condition *c) {
584 assert(c);
585 assert(c->type == CONDITION_NULL);
586
587 /* Note that during parsing we already evaluate the string and
588 * store it in c->negate */
589 return true;
590 }
591
592 int condition_test(Condition *c) {
593
594 static int (*const condition_tests[_CONDITION_TYPE_MAX])(Condition *c) = {
595 [CONDITION_PATH_EXISTS] = condition_test_path_exists,
596 [CONDITION_PATH_EXISTS_GLOB] = condition_test_path_exists_glob,
597 [CONDITION_PATH_IS_DIRECTORY] = condition_test_path_is_directory,
598 [CONDITION_PATH_IS_SYMBOLIC_LINK] = condition_test_path_is_symbolic_link,
599 [CONDITION_PATH_IS_MOUNT_POINT] = condition_test_path_is_mount_point,
600 [CONDITION_PATH_IS_READ_WRITE] = condition_test_path_is_read_write,
601 [CONDITION_DIRECTORY_NOT_EMPTY] = condition_test_directory_not_empty,
602 [CONDITION_FILE_NOT_EMPTY] = condition_test_file_not_empty,
603 [CONDITION_FILE_IS_EXECUTABLE] = condition_test_file_is_executable,
604 [CONDITION_KERNEL_COMMAND_LINE] = condition_test_kernel_command_line,
605 [CONDITION_KERNEL_VERSION] = condition_test_kernel_version,
606 [CONDITION_VIRTUALIZATION] = condition_test_virtualization,
607 [CONDITION_SECURITY] = condition_test_security,
608 [CONDITION_CAPABILITY] = condition_test_capability,
609 [CONDITION_HOST] = condition_test_host,
610 [CONDITION_AC_POWER] = condition_test_ac_power,
611 [CONDITION_ARCHITECTURE] = condition_test_architecture,
612 [CONDITION_NEEDS_UPDATE] = condition_test_needs_update,
613 [CONDITION_FIRST_BOOT] = condition_test_first_boot,
614 [CONDITION_USER] = condition_test_user,
615 [CONDITION_GROUP] = condition_test_group,
616 [CONDITION_CONTROL_GROUP_CONTROLLER] = condition_test_control_group_controller,
617 [CONDITION_NULL] = condition_test_null,
618 };
619
620 int r, b;
621
622 assert(c);
623 assert(c->type >= 0);
624 assert(c->type < _CONDITION_TYPE_MAX);
625
626 r = condition_tests[c->type](c);
627 if (r < 0) {
628 c->result = CONDITION_ERROR;
629 return r;
630 }
631
632 b = (r > 0) == !c->negate;
633 c->result = b ? CONDITION_SUCCEEDED : CONDITION_FAILED;
634 return b;
635 }
636
637 void condition_dump(Condition *c, FILE *f, const char *prefix, const char *(*to_string)(ConditionType t)) {
638 assert(c);
639 assert(f);
640
641 prefix = strempty(prefix);
642
643 fprintf(f,
644 "%s\t%s: %s%s%s %s\n",
645 prefix,
646 to_string(c->type),
647 c->trigger ? "|" : "",
648 c->negate ? "!" : "",
649 c->parameter,
650 condition_result_to_string(c->result));
651 }
652
653 void condition_dump_list(Condition *first, FILE *f, const char *prefix, const char *(*to_string)(ConditionType t)) {
654 Condition *c;
655
656 LIST_FOREACH(conditions, c, first)
657 condition_dump(c, f, prefix, to_string);
658 }
659
660 static const char* const condition_type_table[_CONDITION_TYPE_MAX] = {
661 [CONDITION_ARCHITECTURE] = "ConditionArchitecture",
662 [CONDITION_VIRTUALIZATION] = "ConditionVirtualization",
663 [CONDITION_HOST] = "ConditionHost",
664 [CONDITION_KERNEL_COMMAND_LINE] = "ConditionKernelCommandLine",
665 [CONDITION_KERNEL_VERSION] = "ConditionKernelVersion",
666 [CONDITION_SECURITY] = "ConditionSecurity",
667 [CONDITION_CAPABILITY] = "ConditionCapability",
668 [CONDITION_AC_POWER] = "ConditionACPower",
669 [CONDITION_NEEDS_UPDATE] = "ConditionNeedsUpdate",
670 [CONDITION_FIRST_BOOT] = "ConditionFirstBoot",
671 [CONDITION_PATH_EXISTS] = "ConditionPathExists",
672 [CONDITION_PATH_EXISTS_GLOB] = "ConditionPathExistsGlob",
673 [CONDITION_PATH_IS_DIRECTORY] = "ConditionPathIsDirectory",
674 [CONDITION_PATH_IS_SYMBOLIC_LINK] = "ConditionPathIsSymbolicLink",
675 [CONDITION_PATH_IS_MOUNT_POINT] = "ConditionPathIsMountPoint",
676 [CONDITION_PATH_IS_READ_WRITE] = "ConditionPathIsReadWrite",
677 [CONDITION_DIRECTORY_NOT_EMPTY] = "ConditionDirectoryNotEmpty",
678 [CONDITION_FILE_NOT_EMPTY] = "ConditionFileNotEmpty",
679 [CONDITION_FILE_IS_EXECUTABLE] = "ConditionFileIsExecutable",
680 [CONDITION_USER] = "ConditionUser",
681 [CONDITION_GROUP] = "ConditionGroup",
682 [CONDITION_CONTROL_GROUP_CONTROLLER] = "ConditionControlGroupController",
683 [CONDITION_NULL] = "ConditionNull"
684 };
685
686 DEFINE_STRING_TABLE_LOOKUP(condition_type, ConditionType);
687
688 static const char* const assert_type_table[_CONDITION_TYPE_MAX] = {
689 [CONDITION_ARCHITECTURE] = "AssertArchitecture",
690 [CONDITION_VIRTUALIZATION] = "AssertVirtualization",
691 [CONDITION_HOST] = "AssertHost",
692 [CONDITION_KERNEL_COMMAND_LINE] = "AssertKernelCommandLine",
693 [CONDITION_KERNEL_VERSION] = "AssertKernelVersion",
694 [CONDITION_SECURITY] = "AssertSecurity",
695 [CONDITION_CAPABILITY] = "AssertCapability",
696 [CONDITION_AC_POWER] = "AssertACPower",
697 [CONDITION_NEEDS_UPDATE] = "AssertNeedsUpdate",
698 [CONDITION_FIRST_BOOT] = "AssertFirstBoot",
699 [CONDITION_PATH_EXISTS] = "AssertPathExists",
700 [CONDITION_PATH_EXISTS_GLOB] = "AssertPathExistsGlob",
701 [CONDITION_PATH_IS_DIRECTORY] = "AssertPathIsDirectory",
702 [CONDITION_PATH_IS_SYMBOLIC_LINK] = "AssertPathIsSymbolicLink",
703 [CONDITION_PATH_IS_MOUNT_POINT] = "AssertPathIsMountPoint",
704 [CONDITION_PATH_IS_READ_WRITE] = "AssertPathIsReadWrite",
705 [CONDITION_DIRECTORY_NOT_EMPTY] = "AssertDirectoryNotEmpty",
706 [CONDITION_FILE_NOT_EMPTY] = "AssertFileNotEmpty",
707 [CONDITION_FILE_IS_EXECUTABLE] = "AssertFileIsExecutable",
708 [CONDITION_USER] = "AssertUser",
709 [CONDITION_GROUP] = "AssertGroup",
710 [CONDITION_CONTROL_GROUP_CONTROLLER] = "AssertControlGroupController",
711 [CONDITION_NULL] = "AssertNull"
712 };
713
714 DEFINE_STRING_TABLE_LOOKUP(assert_type, ConditionType);
715
716 static const char* const condition_result_table[_CONDITION_RESULT_MAX] = {
717 [CONDITION_UNTESTED] = "untested",
718 [CONDITION_SUCCEEDED] = "succeeded",
719 [CONDITION_FAILED] = "failed",
720 [CONDITION_ERROR] = "error",
721 };
722
723 DEFINE_STRING_TABLE_LOOKUP(condition_result, ConditionResult);