1 /* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 // Namespace config for binaries under /postinstall. 18 // Only default namespace is defined and default has no directories 19 // other than /system/lib in the search paths. This is because linker calls 20 // realpath on the search paths and this causes selinux denial if the paths 21 // (/vendor, /odm) are not allowed to the postinstall binaries. There is no 22 // reason to allow the binaries to access the paths. 23 24 #include "linkerconfig/sectionbuilder.h" 25 26 #include "linkerconfig/namespacebuilder.h" 27 28 using android::linkerconfig::contents::SectionType; 29 using android::linkerconfig::modules::Namespace; 30 using android::linkerconfig::modules::Section; 31 32 namespace android { 33 namespace linkerconfig { 34 namespace contents { BuildPostInstallSection(Context & ctx)35Section BuildPostInstallSection(Context& ctx) { 36 ctx.SetCurrentSection(SectionType::Other); 37 std::vector<Namespace> namespaces; 38 39 namespaces.emplace_back(BuildPostInstallNamespace(ctx)); 40 41 return Section("postinstall", std::move(namespaces)); 42 } 43 } // namespace contents 44 } // namespace linkerconfig 45 } // namespace android 46