62
59
emap(sbuild::chroot::DEVICE_ABS, N_("Device must have an absolute path")),
63
60
emap(sbuild::chroot::DEVICE_LOCK, N_("Failed to lock device")),
64
61
emap(sbuild::chroot::DEVICE_NOTBLOCK, N_("File is not a block device")),
65
emap(sbuild::chroot::DEVICE_STAT, N_("Failed to stat device")),
66
62
emap(sbuild::chroot::DEVICE_UNLOCK, N_("Failed to unlock device")),
67
63
emap(sbuild::chroot::FILE_ABS, N_("File must have an absolute path")),
68
64
emap(sbuild::chroot::FILE_LOCK, N_("Failed to acquire file lock")),
69
65
emap(sbuild::chroot::FILE_NOTREG, N_("File is not a regular file")),
70
66
emap(sbuild::chroot::FILE_OWNER, N_("File is not owned by user root")),
71
67
emap(sbuild::chroot::FILE_PERMS, N_("File has write permissions for others")),
72
emap(sbuild::chroot::FILE_STAT, N_("Failed to stat file")),
73
68
emap(sbuild::chroot::FILE_UNLOCK, N_("Failed to discard file lock")),
74
69
emap(sbuild::chroot::LOCATION_ABS, N_("Location must have an absolute path")),
75
70
// TRANSLATORS: unlink refers to the C function which removes a file
573
sbuild::chroot::set_keyfile (keyfile const& keyfile)
578
sbuild::chroot::set_keyfile (keyfile const& keyfile,
579
string_list& used_keys)
581
// Keys which are used elsewhere, but should be counted as "used".
582
used_keys.push_back("type");
584
string_list keys = keyfile.get_keys(get_name());
585
for (string_list::const_iterator pos = keys.begin();
589
static regex description_keys("^description\\[.*\\]$");
590
if (regex_search(*pos, description_keys))
591
used_keys.push_back(*pos);
575
594
// This is set not in the configuration file, but set in the keyfile
576
595
// manually. The user must not have the ability to set this option.
577
596
keyfile::get_object_value(*this, &chroot::set_active,
578
597
keyfile, get_name(), "active",
579
598
keyfile::PRIORITY_REQUIRED);
599
used_keys.push_back("active");
581
601
keyfile::get_object_value(*this, &chroot::set_run_setup_scripts,
582
602
keyfile, get_name(), "run-setup-scripts",
583
603
keyfile::PRIORITY_OPTIONAL);
604
used_keys.push_back("run-setup-scripts");
585
606
keyfile::get_object_value(*this, &chroot::set_run_exec_scripts,
586
607
keyfile, get_name(), "run-session-scripts",
587
608
keyfile::PRIORITY_DEPRECATED);
609
used_keys.push_back("run-session-scripts");
588
610
keyfile::get_object_value(*this, &chroot::set_run_exec_scripts,
589
611
keyfile, get_name(), "run-exec-scripts",
590
612
keyfile::PRIORITY_OPTIONAL);
613
used_keys.push_back("run-exec-scripts");
592
615
keyfile::get_object_value(*this, &chroot::set_script_config,
593
616
keyfile, get_name(), "script-config",
594
617
keyfile::PRIORITY_OPTIONAL);
618
used_keys.push_back("script-config");
596
620
keyfile::get_object_value(*this, &chroot::set_priority,
597
621
keyfile, get_name(), "priority",
598
622
keyfile::PRIORITY_OPTIONAL);
623
used_keys.push_back("priority");
600
625
keyfile::get_object_list_value(*this, &chroot::set_aliases,
601
626
keyfile, get_name(), "aliases",
602
627
keyfile::PRIORITY_OPTIONAL);
628
used_keys.push_back("aliases");
604
630
keyfile::get_object_value(*this, &chroot::set_environment_filter,
605
631
keyfile, get_name(), "environment-filter",
606
632
keyfile::PRIORITY_OPTIONAL);
633
used_keys.push_back("environment-filter");
608
635
keyfile::get_object_value(*this, &chroot::set_description,
609
636
keyfile, get_name(), "description",
610
637
keyfile::PRIORITY_OPTIONAL);
638
used_keys.push_back("description");
612
640
keyfile::get_object_list_value(*this, &chroot::set_users,
613
641
keyfile, get_name(), "users",
614
642
keyfile::PRIORITY_OPTIONAL);
643
used_keys.push_back("users");
616
645
keyfile::get_object_list_value(*this, &chroot::set_groups,
617
646
keyfile, get_name(), "groups",
618
647
keyfile::PRIORITY_OPTIONAL);
648
used_keys.push_back("groups");
620
650
keyfile::get_object_list_value(*this, &chroot::set_root_users,
621
651
keyfile, get_name(), "root-users",
622
652
keyfile::PRIORITY_OPTIONAL);
653
used_keys.push_back("root-users");
624
655
keyfile::get_object_list_value(*this, &chroot::set_root_groups,
625
656
keyfile, get_name(), "root-groups",
626
657
keyfile::PRIORITY_OPTIONAL);
658
used_keys.push_back("root-groups");
628
660
keyfile::get_object_value(*this, &chroot::set_mount_location,
629
661
keyfile, get_name(), "mount-location",
631
663
keyfile::PRIORITY_REQUIRED :
632
664
keyfile::PRIORITY_DISALLOWED);
665
used_keys.push_back("mount-location");
634
667
keyfile::get_object_value(*this, &chroot::set_mount_device,
635
668
keyfile, get_name(), "mount-device",
637
670
keyfile::PRIORITY_OPTIONAL :
638
671
keyfile::PRIORITY_DISALLOWED);
672
used_keys.push_back("mount-device");
640
674
keyfile::get_object_list_value(*this, &chroot::set_command_prefix,
641
675
keyfile, get_name(), "command-prefix",
642
676
keyfile::PRIORITY_OPTIONAL);
677
used_keys.push_back("command-prefix");
644
679
keyfile::get_object_value(*this, &chroot::set_persona,
645
680
keyfile, get_name(), "personality",
646
681
keyfile::PRIORITY_OPTIONAL);
682
used_keys.push_back("personality");