]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/conf-parser.c
Merge pull request #4115 from yuwata/completion-fix
[thirdparty/systemd.git] / src / shared / conf-parser.c
1 /***
2 This file is part of systemd.
3
4 Copyright 2010 Lennart Poettering
5
6 systemd is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
10
11 systemd is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with systemd; If not, see <http://www.gnu.org/licenses/>.
18 ***/
19
20 #include <errno.h>
21 #include <limits.h>
22 #include <stdint.h>
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <string.h>
26 #include <sys/types.h>
27
28 #include "alloc-util.h"
29 #include "conf-files.h"
30 #include "conf-parser.h"
31 #include "extract-word.h"
32 #include "fd-util.h"
33 #include "fs-util.h"
34 #include "log.h"
35 #include "macro.h"
36 #include "parse-util.h"
37 #include "path-util.h"
38 #include "process-util.h"
39 #include "signal-util.h"
40 #include "socket-util.h"
41 #include "string-util.h"
42 #include "strv.h"
43 #include "syslog-util.h"
44 #include "time-util.h"
45 #include "utf8.h"
46
47 int config_item_table_lookup(
48 const void *table,
49 const char *section,
50 const char *lvalue,
51 ConfigParserCallback *func,
52 int *ltype,
53 void **data,
54 void *userdata) {
55
56 const ConfigTableItem *t;
57
58 assert(table);
59 assert(lvalue);
60 assert(func);
61 assert(ltype);
62 assert(data);
63
64 for (t = table; t->lvalue; t++) {
65
66 if (!streq(lvalue, t->lvalue))
67 continue;
68
69 if (!streq_ptr(section, t->section))
70 continue;
71
72 *func = t->parse;
73 *ltype = t->ltype;
74 *data = t->data;
75 return 1;
76 }
77
78 return 0;
79 }
80
81 int config_item_perf_lookup(
82 const void *table,
83 const char *section,
84 const char *lvalue,
85 ConfigParserCallback *func,
86 int *ltype,
87 void **data,
88 void *userdata) {
89
90 ConfigPerfItemLookup lookup = (ConfigPerfItemLookup) table;
91 const ConfigPerfItem *p;
92
93 assert(table);
94 assert(lvalue);
95 assert(func);
96 assert(ltype);
97 assert(data);
98
99 if (!section)
100 p = lookup(lvalue, strlen(lvalue));
101 else {
102 char *key;
103
104 key = strjoin(section, ".", lvalue, NULL);
105 if (!key)
106 return -ENOMEM;
107
108 p = lookup(key, strlen(key));
109 free(key);
110 }
111
112 if (!p)
113 return 0;
114
115 *func = p->parse;
116 *ltype = p->ltype;
117 *data = (uint8_t*) userdata + p->offset;
118 return 1;
119 }
120
121 /* Run the user supplied parser for an assignment */
122 static int next_assignment(const char *unit,
123 const char *filename,
124 unsigned line,
125 ConfigItemLookup lookup,
126 const void *table,
127 const char *section,
128 unsigned section_line,
129 const char *lvalue,
130 const char *rvalue,
131 bool relaxed,
132 void *userdata) {
133
134 ConfigParserCallback func = NULL;
135 int ltype = 0;
136 void *data = NULL;
137 int r;
138
139 assert(filename);
140 assert(line > 0);
141 assert(lookup);
142 assert(lvalue);
143 assert(rvalue);
144
145 r = lookup(table, section, lvalue, &func, &ltype, &data, userdata);
146 if (r < 0)
147 return r;
148
149 if (r > 0) {
150 if (func)
151 return func(unit, filename, line, section, section_line,
152 lvalue, ltype, rvalue, data, userdata);
153
154 return 0;
155 }
156
157 /* Warn about unknown non-extension fields. */
158 if (!relaxed && !startswith(lvalue, "X-"))
159 log_syntax(unit, LOG_WARNING, filename, line, 0, "Unknown lvalue '%s' in section '%s'", lvalue, section);
160
161 return 0;
162 }
163
164 /* Parse a variable assignment line */
165 static int parse_line(const char* unit,
166 const char *filename,
167 unsigned line,
168 const char *sections,
169 ConfigItemLookup lookup,
170 const void *table,
171 bool relaxed,
172 bool allow_include,
173 char **section,
174 unsigned *section_line,
175 bool *section_ignored,
176 char *l,
177 void *userdata) {
178
179 char *e;
180
181 assert(filename);
182 assert(line > 0);
183 assert(lookup);
184 assert(l);
185
186 l = strstrip(l);
187
188 if (!*l)
189 return 0;
190
191 if (strchr(COMMENTS "\n", *l))
192 return 0;
193
194 if (startswith(l, ".include ")) {
195 _cleanup_free_ char *fn = NULL;
196
197 /* .includes are a bad idea, we only support them here
198 * for historical reasons. They create cyclic include
199 * problems and make it difficult to detect
200 * configuration file changes with an easy
201 * stat(). Better approaches, such as .d/ drop-in
202 * snippets exist.
203 *
204 * Support for them should be eventually removed. */
205
206 if (!allow_include) {
207 log_syntax(unit, LOG_ERR, filename, line, 0, ".include not allowed here. Ignoring.");
208 return 0;
209 }
210
211 fn = file_in_same_dir(filename, strstrip(l+9));
212 if (!fn)
213 return -ENOMEM;
214
215 return config_parse(unit, fn, NULL, sections, lookup, table, relaxed, false, false, userdata);
216 }
217
218 if (*l == '[') {
219 size_t k;
220 char *n;
221
222 k = strlen(l);
223 assert(k > 0);
224
225 if (l[k-1] != ']') {
226 log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid section header '%s'", l);
227 return -EBADMSG;
228 }
229
230 n = strndup(l+1, k-2);
231 if (!n)
232 return -ENOMEM;
233
234 if (sections && !nulstr_contains(sections, n)) {
235
236 if (!relaxed && !startswith(n, "X-"))
237 log_syntax(unit, LOG_WARNING, filename, line, 0, "Unknown section '%s'. Ignoring.", n);
238
239 free(n);
240 *section = mfree(*section);
241 *section_line = 0;
242 *section_ignored = true;
243 } else {
244 free(*section);
245 *section = n;
246 *section_line = line;
247 *section_ignored = false;
248 }
249
250 return 0;
251 }
252
253 if (sections && !*section) {
254
255 if (!relaxed && !*section_ignored)
256 log_syntax(unit, LOG_WARNING, filename, line, 0, "Assignment outside of section. Ignoring.");
257
258 return 0;
259 }
260
261 e = strchr(l, '=');
262 if (!e) {
263 log_syntax(unit, LOG_WARNING, filename, line, 0, "Missing '='.");
264 return -EINVAL;
265 }
266
267 *e = 0;
268 e++;
269
270 return next_assignment(unit,
271 filename,
272 line,
273 lookup,
274 table,
275 *section,
276 *section_line,
277 strstrip(l),
278 strstrip(e),
279 relaxed,
280 userdata);
281 }
282
283 /* Go through the file and parse each line */
284 int config_parse(const char *unit,
285 const char *filename,
286 FILE *f,
287 const char *sections,
288 ConfigItemLookup lookup,
289 const void *table,
290 bool relaxed,
291 bool allow_include,
292 bool warn,
293 void *userdata) {
294
295 _cleanup_free_ char *section = NULL, *continuation = NULL;
296 _cleanup_fclose_ FILE *ours = NULL;
297 unsigned line = 0, section_line = 0;
298 bool section_ignored = false, allow_bom = true;
299 int r;
300
301 assert(filename);
302 assert(lookup);
303
304 if (!f) {
305 f = ours = fopen(filename, "re");
306 if (!f) {
307 /* Only log on request, except for ENOENT,
308 * since we return 0 to the caller. */
309 if (warn || errno == ENOENT)
310 log_full(errno == ENOENT ? LOG_DEBUG : LOG_ERR,
311 "Failed to open configuration file '%s': %m", filename);
312 return errno == ENOENT ? 0 : -errno;
313 }
314 }
315
316 fd_warn_permissions(filename, fileno(f));
317
318 for (;;) {
319 char buf[LINE_MAX], *l, *p, *c = NULL, *e;
320 bool escaped = false;
321
322 if (!fgets(buf, sizeof buf, f)) {
323 if (feof(f))
324 break;
325
326 return log_error_errno(errno, "Failed to read configuration file '%s': %m", filename);
327 }
328
329 l = buf;
330 if (allow_bom && startswith(l, UTF8_BYTE_ORDER_MARK))
331 l += strlen(UTF8_BYTE_ORDER_MARK);
332 allow_bom = false;
333
334 truncate_nl(l);
335
336 if (continuation) {
337 c = strappend(continuation, l);
338 if (!c) {
339 if (warn)
340 log_oom();
341 return -ENOMEM;
342 }
343
344 continuation = mfree(continuation);
345 p = c;
346 } else
347 p = l;
348
349 for (e = p; *e; e++) {
350 if (escaped)
351 escaped = false;
352 else if (*e == '\\')
353 escaped = true;
354 }
355
356 if (escaped) {
357 *(e-1) = ' ';
358
359 if (c)
360 continuation = c;
361 else {
362 continuation = strdup(l);
363 if (!continuation) {
364 if (warn)
365 log_oom();
366 return -ENOMEM;
367 }
368 }
369
370 continue;
371 }
372
373 r = parse_line(unit,
374 filename,
375 ++line,
376 sections,
377 lookup,
378 table,
379 relaxed,
380 allow_include,
381 &section,
382 &section_line,
383 &section_ignored,
384 p,
385 userdata);
386 free(c);
387
388 if (r < 0) {
389 if (warn)
390 log_warning_errno(r, "Failed to parse file '%s': %m",
391 filename);
392 return r;
393 }
394 }
395
396 return 0;
397 }
398
399 static int config_parse_many_files(
400 const char *conf_file,
401 char **files,
402 const char *sections,
403 ConfigItemLookup lookup,
404 const void *table,
405 bool relaxed,
406 void *userdata) {
407
408 char **fn;
409 int r;
410
411 if (conf_file) {
412 r = config_parse(NULL, conf_file, NULL, sections, lookup, table, relaxed, false, true, userdata);
413 if (r < 0)
414 return r;
415 }
416
417 STRV_FOREACH(fn, files) {
418 r = config_parse(NULL, *fn, NULL, sections, lookup, table, relaxed, false, true, userdata);
419 if (r < 0)
420 return r;
421 }
422
423 return 0;
424 }
425
426 /* Parse each config file in the directories specified as nulstr. */
427 int config_parse_many_nulstr(
428 const char *conf_file,
429 const char *conf_file_dirs,
430 const char *sections,
431 ConfigItemLookup lookup,
432 const void *table,
433 bool relaxed,
434 void *userdata) {
435
436 _cleanup_strv_free_ char **files = NULL;
437 int r;
438
439 r = conf_files_list_nulstr(&files, ".conf", NULL, conf_file_dirs);
440 if (r < 0)
441 return r;
442
443 return config_parse_many_files(conf_file, files,
444 sections, lookup, table, relaxed, userdata);
445 }
446
447 /* Parse each config file in the directories specified as strv. */
448 int config_parse_many(
449 const char *conf_file,
450 const char* const* conf_file_dirs,
451 const char *dropin_dirname,
452 const char *sections,
453 ConfigItemLookup lookup,
454 const void *table,
455 bool relaxed,
456 void *userdata) {
457
458 _cleanup_strv_free_ char **dropin_dirs = NULL;
459 _cleanup_strv_free_ char **files = NULL;
460 const char *suffix;
461 int r;
462
463 suffix = strjoina("/", dropin_dirname);
464 r = strv_extend_strv_concat(&dropin_dirs, (char**) conf_file_dirs, suffix);
465 if (r < 0)
466 return r;
467
468 r = conf_files_list_strv(&files, ".conf", NULL, (const char* const*) dropin_dirs);
469 if (r < 0)
470 return r;
471
472 return config_parse_many_files(conf_file, files,
473 sections, lookup, table, relaxed, userdata);
474 }
475
476 #define DEFINE_PARSER(type, vartype, conv_func) \
477 int config_parse_##type( \
478 const char *unit, \
479 const char *filename, \
480 unsigned line, \
481 const char *section, \
482 unsigned section_line, \
483 const char *lvalue, \
484 int ltype, \
485 const char *rvalue, \
486 void *data, \
487 void *userdata) { \
488 \
489 vartype *i = data; \
490 int r; \
491 \
492 assert(filename); \
493 assert(lvalue); \
494 assert(rvalue); \
495 assert(data); \
496 \
497 r = conv_func(rvalue, i); \
498 if (r < 0) \
499 log_syntax(unit, LOG_ERR, filename, line, r, \
500 "Failed to parse %s value, ignoring: %s", \
501 #type, rvalue); \
502 \
503 return 0; \
504 } \
505 struct __useless_struct_to_allow_trailing_semicolon__
506
507 DEFINE_PARSER(int, int, safe_atoi);
508 DEFINE_PARSER(long, long, safe_atoli);
509 DEFINE_PARSER(uint16, uint16_t, safe_atou16);
510 DEFINE_PARSER(uint32, uint32_t, safe_atou32);
511 DEFINE_PARSER(uint64, uint64_t, safe_atou64);
512 DEFINE_PARSER(unsigned, unsigned, safe_atou);
513 DEFINE_PARSER(double, double, safe_atod);
514 DEFINE_PARSER(nsec, nsec_t, parse_nsec);
515 DEFINE_PARSER(sec, usec_t, parse_sec);
516 DEFINE_PARSER(mode, mode_t, parse_mode);
517
518 int config_parse_iec_size(const char* unit,
519 const char *filename,
520 unsigned line,
521 const char *section,
522 unsigned section_line,
523 const char *lvalue,
524 int ltype,
525 const char *rvalue,
526 void *data,
527 void *userdata) {
528
529 size_t *sz = data;
530 uint64_t v;
531 int r;
532
533 assert(filename);
534 assert(lvalue);
535 assert(rvalue);
536 assert(data);
537
538 r = parse_size(rvalue, 1024, &v);
539 if (r < 0 || (uint64_t) (size_t) v != v) {
540 log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse size value, ignoring: %s", rvalue);
541 return 0;
542 }
543
544 *sz = (size_t) v;
545 return 0;
546 }
547
548 int config_parse_si_size(const char* unit,
549 const char *filename,
550 unsigned line,
551 const char *section,
552 unsigned section_line,
553 const char *lvalue,
554 int ltype,
555 const char *rvalue,
556 void *data,
557 void *userdata) {
558
559 size_t *sz = data;
560 uint64_t v;
561 int r;
562
563 assert(filename);
564 assert(lvalue);
565 assert(rvalue);
566 assert(data);
567
568 r = parse_size(rvalue, 1000, &v);
569 if (r < 0 || (uint64_t) (size_t) v != v) {
570 log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse size value, ignoring: %s", rvalue);
571 return 0;
572 }
573
574 *sz = (size_t) v;
575 return 0;
576 }
577
578 int config_parse_iec_uint64(const char* unit,
579 const char *filename,
580 unsigned line,
581 const char *section,
582 unsigned section_line,
583 const char *lvalue,
584 int ltype,
585 const char *rvalue,
586 void *data,
587 void *userdata) {
588
589 uint64_t *bytes = data;
590 int r;
591
592 assert(filename);
593 assert(lvalue);
594 assert(rvalue);
595 assert(data);
596
597 r = parse_size(rvalue, 1024, bytes);
598 if (r < 0)
599 log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse size value, ignoring: %s", rvalue);
600
601 return 0;
602 }
603
604 int config_parse_bool(const char* unit,
605 const char *filename,
606 unsigned line,
607 const char *section,
608 unsigned section_line,
609 const char *lvalue,
610 int ltype,
611 const char *rvalue,
612 void *data,
613 void *userdata) {
614
615 int k;
616 bool *b = data;
617
618 assert(filename);
619 assert(lvalue);
620 assert(rvalue);
621 assert(data);
622
623 k = parse_boolean(rvalue);
624 if (k < 0) {
625 log_syntax(unit, LOG_ERR, filename, line, k, "Failed to parse boolean value, ignoring: %s", rvalue);
626 return 0;
627 }
628
629 *b = !!k;
630 return 0;
631 }
632
633 int config_parse_tristate(
634 const char* unit,
635 const char *filename,
636 unsigned line,
637 const char *section,
638 unsigned section_line,
639 const char *lvalue,
640 int ltype,
641 const char *rvalue,
642 void *data,
643 void *userdata) {
644
645 int k, *t = data;
646
647 assert(filename);
648 assert(lvalue);
649 assert(rvalue);
650 assert(data);
651
652 /* A tristate is pretty much a boolean, except that it can
653 * also take the special value -1, indicating "uninitialized",
654 * much like NULL is for a pointer type. */
655
656 k = parse_boolean(rvalue);
657 if (k < 0) {
658 log_syntax(unit, LOG_ERR, filename, line, k, "Failed to parse boolean value, ignoring: %s", rvalue);
659 return 0;
660 }
661
662 *t = !!k;
663 return 0;
664 }
665
666 int config_parse_string(
667 const char *unit,
668 const char *filename,
669 unsigned line,
670 const char *section,
671 unsigned section_line,
672 const char *lvalue,
673 int ltype,
674 const char *rvalue,
675 void *data,
676 void *userdata) {
677
678 char **s = data, *n;
679
680 assert(filename);
681 assert(lvalue);
682 assert(rvalue);
683 assert(data);
684
685 if (!utf8_is_valid(rvalue)) {
686 log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, rvalue);
687 return 0;
688 }
689
690 if (isempty(rvalue))
691 n = NULL;
692 else {
693 n = strdup(rvalue);
694 if (!n)
695 return log_oom();
696 }
697
698 free(*s);
699 *s = n;
700
701 return 0;
702 }
703
704 int config_parse_path(
705 const char *unit,
706 const char *filename,
707 unsigned line,
708 const char *section,
709 unsigned section_line,
710 const char *lvalue,
711 int ltype,
712 const char *rvalue,
713 void *data,
714 void *userdata) {
715
716 char **s = data, *n;
717
718 assert(filename);
719 assert(lvalue);
720 assert(rvalue);
721 assert(data);
722
723 if (!utf8_is_valid(rvalue)) {
724 log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, rvalue);
725 return 0;
726 }
727
728 if (!path_is_absolute(rvalue)) {
729 log_syntax(unit, LOG_ERR, filename, line, 0, "Not an absolute path, ignoring: %s", rvalue);
730 return 0;
731 }
732
733 n = strdup(rvalue);
734 if (!n)
735 return log_oom();
736
737 path_kill_slashes(n);
738
739 free(*s);
740 *s = n;
741
742 return 0;
743 }
744
745 int config_parse_strv(const char *unit,
746 const char *filename,
747 unsigned line,
748 const char *section,
749 unsigned section_line,
750 const char *lvalue,
751 int ltype,
752 const char *rvalue,
753 void *data,
754 void *userdata) {
755
756 char ***sv = data;
757 int r;
758
759 assert(filename);
760 assert(lvalue);
761 assert(rvalue);
762 assert(data);
763
764 if (isempty(rvalue)) {
765 char **empty;
766
767 /* Empty assignment resets the list. As a special rule
768 * we actually fill in a real empty array here rather
769 * than NULL, since some code wants to know if
770 * something was set at all... */
771 empty = new0(char*, 1);
772 if (!empty)
773 return log_oom();
774
775 strv_free(*sv);
776 *sv = empty;
777
778 return 0;
779 }
780
781 for (;;) {
782 char *word = NULL;
783
784 r = extract_first_word(&rvalue, &word, WHITESPACE, EXTRACT_QUOTES|EXTRACT_RETAIN_ESCAPE);
785 if (r == 0)
786 break;
787 if (r == -ENOMEM)
788 return log_oom();
789 if (r < 0) {
790 log_syntax(unit, LOG_ERR, filename, line, r, "Invalid syntax, ignoring: %s", rvalue);
791 break;
792 }
793
794 if (!utf8_is_valid(word)) {
795 log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, rvalue);
796 free(word);
797 continue;
798 }
799 r = strv_consume(sv, word);
800 if (r < 0)
801 return log_oom();
802 }
803
804 return 0;
805 }
806
807 int config_parse_log_facility(
808 const char *unit,
809 const char *filename,
810 unsigned line,
811 const char *section,
812 unsigned section_line,
813 const char *lvalue,
814 int ltype,
815 const char *rvalue,
816 void *data,
817 void *userdata) {
818
819
820 int *o = data, x;
821
822 assert(filename);
823 assert(lvalue);
824 assert(rvalue);
825 assert(data);
826
827 x = log_facility_unshifted_from_string(rvalue);
828 if (x < 0) {
829 log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse log facility, ignoring: %s", rvalue);
830 return 0;
831 }
832
833 *o = (x << 3) | LOG_PRI(*o);
834
835 return 0;
836 }
837
838 int config_parse_log_level(
839 const char *unit,
840 const char *filename,
841 unsigned line,
842 const char *section,
843 unsigned section_line,
844 const char *lvalue,
845 int ltype,
846 const char *rvalue,
847 void *data,
848 void *userdata) {
849
850
851 int *o = data, x;
852
853 assert(filename);
854 assert(lvalue);
855 assert(rvalue);
856 assert(data);
857
858 x = log_level_from_string(rvalue);
859 if (x < 0) {
860 log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse log level, ignoring: %s", rvalue);
861 return 0;
862 }
863
864 *o = (*o & LOG_FACMASK) | x;
865 return 0;
866 }
867
868 int config_parse_signal(
869 const char *unit,
870 const char *filename,
871 unsigned line,
872 const char *section,
873 unsigned section_line,
874 const char *lvalue,
875 int ltype,
876 const char *rvalue,
877 void *data,
878 void *userdata) {
879
880 int *sig = data, r;
881
882 assert(filename);
883 assert(lvalue);
884 assert(rvalue);
885 assert(sig);
886
887 r = signal_from_string_try_harder(rvalue);
888 if (r <= 0) {
889 log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse signal name, ignoring: %s", rvalue);
890 return 0;
891 }
892
893 *sig = r;
894 return 0;
895 }
896
897 int config_parse_personality(
898 const char *unit,
899 const char *filename,
900 unsigned line,
901 const char *section,
902 unsigned section_line,
903 const char *lvalue,
904 int ltype,
905 const char *rvalue,
906 void *data,
907 void *userdata) {
908
909 unsigned long *personality = data, p;
910
911 assert(filename);
912 assert(lvalue);
913 assert(rvalue);
914 assert(personality);
915
916 p = personality_from_string(rvalue);
917 if (p == PERSONALITY_INVALID) {
918 log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse personality, ignoring: %s", rvalue);
919 return 0;
920 }
921
922 *personality = p;
923 return 0;
924 }
925
926 int config_parse_ifname(
927 const char *unit,
928 const char *filename,
929 unsigned line,
930 const char *section,
931 unsigned section_line,
932 const char *lvalue,
933 int ltype,
934 const char *rvalue,
935 void *data,
936 void *userdata) {
937
938 char **s = data;
939 int r;
940
941 assert(filename);
942 assert(lvalue);
943 assert(rvalue);
944 assert(data);
945
946 if (isempty(rvalue)) {
947 *s = mfree(*s);
948 return 0;
949 }
950
951 if (!ifname_valid(rvalue)) {
952 log_syntax(unit, LOG_ERR, filename, line, 0, "Interface name is not valid or too long, ignoring assignment: %s", rvalue);
953 return 0;
954 }
955
956 r = free_and_strdup(s, rvalue);
957 if (r < 0)
958 return log_oom();
959
960 return 0;
961 }