From 046203dd35eb9875148fc6a957c4a55684fbcaa4 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Sun, 13 Oct 2024 21:23:45 +0200 Subject: [PATCH] iox-#1176 Build ACL support according to the feature flag --- .../posix/filesystem/source/posix_acl.cpp | 21 ++-- .../test_posix_filesystem_posix_acl.cpp | 9 +- .../freertos/include/iceoryx_platform/acl.hpp | 104 ------------------ .../include/iceoryx_platform/types.hpp | 2 + .../include/iceoryx_platform/unistd.hpp | 1 - .../include/iceoryx_platform/acl.hpp | 16 ++- .../include/iceoryx_platform/generic/acl.hpp | 87 +++++++++++++++ .../iceoryx_platform/generic/stdlib.hpp | 3 + .../generic/source/acl_feature_off.cpp | 87 +++++++++++++++ .../generic/source/acl_feature_on.cpp | 86 +++++++++++++++ .../linux/include/iceoryx_platform/types.hpp | 2 + .../linux/include/iceoryx_platform/unistd.hpp | 1 - .../mac/include/iceoryx_platform/acl.hpp | 102 ----------------- .../qnx/include/iceoryx_platform/acl.hpp | 22 ---- .../unix/include/iceoryx_platform/acl.hpp | 102 ----------------- .../win/include/iceoryx_platform/acl.hpp | 101 ----------------- 16 files changed, 294 insertions(+), 452 deletions(-) delete mode 100644 iceoryx_platform/freertos/include/iceoryx_platform/acl.hpp rename iceoryx_platform/{linux => generic}/include/iceoryx_platform/acl.hpp (64%) create mode 100644 iceoryx_platform/generic/include/iceoryx_platform/generic/acl.hpp create mode 100644 iceoryx_platform/generic/source/acl_feature_off.cpp create mode 100644 iceoryx_platform/generic/source/acl_feature_on.cpp delete mode 100644 iceoryx_platform/mac/include/iceoryx_platform/acl.hpp delete mode 100644 iceoryx_platform/qnx/include/iceoryx_platform/acl.hpp delete mode 100644 iceoryx_platform/unix/include/iceoryx_platform/acl.hpp delete mode 100644 iceoryx_platform/win/include/iceoryx_platform/acl.hpp diff --git a/iceoryx_hoofs/posix/filesystem/source/posix_acl.cpp b/iceoryx_hoofs/posix/filesystem/source/posix_acl.cpp index 957e4c0980..69cdb58f55 100644 --- a/iceoryx_hoofs/posix/filesystem/source/posix_acl.cpp +++ b/iceoryx_hoofs/posix/filesystem/source/posix_acl.cpp @@ -64,7 +64,7 @@ bool PosixAcl::writePermissionsToFile(const int32_t fileDescriptor) const noexce } // check if acl is valid - auto aclCheckCall = IOX_POSIX_CALL(acl_valid)(workingACL.get()).successReturnValue(0).evaluate(); + auto aclCheckCall = IOX_POSIX_CALL(iox_acl_valid)(workingACL.get()).successReturnValue(0).evaluate(); if (aclCheckCall.has_error()) { @@ -73,7 +73,8 @@ bool PosixAcl::writePermissionsToFile(const int32_t fileDescriptor) const noexce } // set acl in the file given by descriptor - auto aclSetFdCall = IOX_POSIX_CALL(acl_set_fd)(fileDescriptor, workingACL.get()).successReturnValue(0).evaluate(); + auto aclSetFdCall = + IOX_POSIX_CALL(iox_acl_set_fd)(fileDescriptor, workingACL.get()).successReturnValue(0).evaluate(); if (aclSetFdCall.has_error()) { IOX_LOG(ERROR, "Error: Could not set file ACL."); @@ -86,7 +87,7 @@ bool PosixAcl::writePermissionsToFile(const int32_t fileDescriptor) const noexce expected PosixAcl::createACL(const int32_t numEntries) noexcept { // allocate memory for a new ACL - auto aclInitCall = IOX_POSIX_CALL(acl_init)(numEntries).failureReturnValue(nullptr).evaluate(); + auto aclInitCall = IOX_POSIX_CALL(iox_acl_init)(numEntries).failureReturnValue(nullptr).evaluate(); if (aclInitCall.has_error()) { @@ -95,7 +96,7 @@ expected PosixAcl::createACL(const // define how to free the memory (custom deleter for the smart pointer) function freeACL = [&](acl_t acl) { - auto aclFreeCall = IOX_POSIX_CALL(acl_free)(acl).successReturnValue(0).evaluate(); + auto aclFreeCall = IOX_POSIX_CALL(iox_acl_free)(acl).successReturnValue(0).evaluate(); // We ensure here instead of returning as this lambda will be called by unique_ptr IOX_ENFORCE(!aclFreeCall.has_error(), "Could not free ACL memory"); }; @@ -186,7 +187,7 @@ bool PosixAcl::createACLEntry(const acl_t ACL, const PermissionEntry& entry) noe acl_entry_t newEntry{}; acl_t l_ACL{ACL}; - auto aclCreateEntryCall = IOX_POSIX_CALL(acl_create_entry)(&l_ACL, &newEntry).successReturnValue(0).evaluate(); + auto aclCreateEntryCall = IOX_POSIX_CALL(iox_acl_create_entry)(&l_ACL, &newEntry).successReturnValue(0).evaluate(); if (aclCreateEntryCall.has_error()) { @@ -196,7 +197,7 @@ bool PosixAcl::createACLEntry(const acl_t ACL, const PermissionEntry& entry) noe // set tag type for new entry (user, group, ...) auto tagType = static_cast(entry.m_category); - auto aclSetTagTypeCall = IOX_POSIX_CALL(acl_set_tag_type)(newEntry, tagType).successReturnValue(0).evaluate(); + auto aclSetTagTypeCall = IOX_POSIX_CALL(iox_acl_set_tag_type)(newEntry, tagType).successReturnValue(0).evaluate(); if (aclSetTagTypeCall.has_error()) { @@ -210,7 +211,7 @@ bool PosixAcl::createACLEntry(const acl_t ACL, const PermissionEntry& entry) noe case ACL_USER: { auto aclSetQualifierCall = - IOX_POSIX_CALL(acl_set_qualifier)(newEntry, &(entry.m_id)).successReturnValue(0).evaluate(); + IOX_POSIX_CALL(iox_acl_set_qualifier)(newEntry, &(entry.m_id)).successReturnValue(0).evaluate(); if (aclSetQualifierCall.has_error()) { @@ -223,7 +224,7 @@ bool PosixAcl::createACLEntry(const acl_t ACL, const PermissionEntry& entry) noe case ACL_GROUP: { auto aclSetQualifierCall = - IOX_POSIX_CALL(acl_set_qualifier)(newEntry, &(entry.m_id)).successReturnValue(0).evaluate(); + IOX_POSIX_CALL(iox_acl_set_qualifier)(newEntry, &(entry.m_id)).successReturnValue(0).evaluate(); if (aclSetQualifierCall.has_error()) { @@ -241,7 +242,7 @@ bool PosixAcl::createACLEntry(const acl_t ACL, const PermissionEntry& entry) noe acl_permset_t entryPermissionSet{}; auto aclGetPermsetCall = - IOX_POSIX_CALL(acl_get_permset)(newEntry, &entryPermissionSet).successReturnValue(0).evaluate(); + IOX_POSIX_CALL(iox_acl_get_permset)(newEntry, &entryPermissionSet).successReturnValue(0).evaluate(); if (aclGetPermsetCall.has_error()) { @@ -280,7 +281,7 @@ bool PosixAcl::createACLEntry(const acl_t ACL, const PermissionEntry& entry) noe bool PosixAcl::addAclPermission(acl_permset_t permset, acl_perm_t perm) noexcept { - auto aclAddPermCall = IOX_POSIX_CALL(acl_add_perm)(permset, perm).successReturnValue(0).evaluate(); + auto aclAddPermCall = IOX_POSIX_CALL(iox_acl_add_perm)(permset, perm).successReturnValue(0).evaluate(); if (aclAddPermCall.has_error()) { diff --git a/iceoryx_hoofs/test/moduletests/test_posix_filesystem_posix_acl.cpp b/iceoryx_hoofs/test/moduletests/test_posix_filesystem_posix_acl.cpp index 12b4bbbd56..ef2dba5d9f 100644 --- a/iceoryx_hoofs/test/moduletests/test_posix_filesystem_posix_acl.cpp +++ b/iceoryx_hoofs/test/moduletests/test_posix_filesystem_posix_acl.cpp @@ -15,10 +15,12 @@ // // SPDX-License-Identifier: Apache-2.0 -#if defined(__linux__) +#include "iox/detail/posix_acl.hpp" + +#if IOX_FEATURE_ACL + #include "iceoryx_platform/pwd.hpp" #include "iceoryx_platform/stat.hpp" -#include "iox/detail/posix_acl.hpp" #include "iox/posix_call.hpp" #include "test.hpp" @@ -300,4 +302,5 @@ TEST_F(PosixAcl_test, addStrangeNames) EXPECT_FALSE(entryAdded); } } // namespace -#endif + +#endif // IOX_FEATURE_ACL diff --git a/iceoryx_platform/freertos/include/iceoryx_platform/acl.hpp b/iceoryx_platform/freertos/include/iceoryx_platform/acl.hpp deleted file mode 100644 index bdf94014f4..0000000000 --- a/iceoryx_platform/freertos/include/iceoryx_platform/acl.hpp +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. -// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. -// Copyright (c) 2023 by NXP. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: Apache-2.0 - -#ifndef IOX_HOOFS_FREERTOS_PLATFORM_ACL_HPP -#define IOX_HOOFS_FREERTOS_PLATFORM_ACL_HPP - -#include "iceoryx_platform/types.hpp" - -#define ACL_USER_OBJ 0 -#define ACL_USER 1 -#define ACL_GROUP_OBJ 2 -#define ACL_GROUP 3 -#define ACL_OTHER 4 -#define ACL_READ 5 -#define ACL_WRITE 6 -#define ACL_MASK 7 - -struct __acl_ext -{ -}; - -using acl_t = struct __acl_ext*; -using acl_permset_t = int; -using acl_perm_t = int; -using acl_entry_t = int; -using acl_tag_t = int; - -inline int acl_valid(acl_t) -{ - return 0; -} - -inline int acl_set_fd(int, acl_t) -{ - return 0; -} - -inline acl_t acl_init(int) -{ - static struct __acl_ext stub; - return &stub; -} - -inline int acl_free(void*) -{ - return 0; -} - -inline int acl_create_entry(acl_t*, acl_entry_t*) -{ - return 0; -} - -inline int acl_set_tag_type(acl_entry_t, acl_tag_t) -{ - return 0; -} - -inline int acl_set_qualifier(acl_entry_t, const void*) -{ - return 0; -} - -inline int acl_get_permset(acl_entry_t, acl_permset_t*) -{ - return 0; -} - -inline int acl_add_perm(acl_permset_t, acl_perm_t) -{ - return 0; -} - -inline char* acl_to_text(acl_t, ssize_t*) -{ - return nullptr; -} - -inline acl_t acl_from_text(const char*) -{ - return acl_t(); -} - -inline acl_t acl_get_fd(int) -{ - return acl_t(); -} - -#endif // IOX_HOOFS_FREERTOS_PLATFORM_ACL_HPP diff --git a/iceoryx_platform/freertos/include/iceoryx_platform/types.hpp b/iceoryx_platform/freertos/include/iceoryx_platform/types.hpp index 9f4d746880..ba0954a211 100644 --- a/iceoryx_platform/freertos/include/iceoryx_platform/types.hpp +++ b/iceoryx_platform/freertos/include/iceoryx_platform/types.hpp @@ -21,6 +21,8 @@ #include +using iox_ssize_t = ssize_t; + using iox_gid_t = gid_t; using iox_uid_t = uid_t; diff --git a/iceoryx_platform/freertos/include/iceoryx_platform/unistd.hpp b/iceoryx_platform/freertos/include/iceoryx_platform/unistd.hpp index 72569a1222..fdbd7a242a 100644 --- a/iceoryx_platform/freertos/include/iceoryx_platform/unistd.hpp +++ b/iceoryx_platform/freertos/include/iceoryx_platform/unistd.hpp @@ -27,7 +27,6 @@ #define IOX_SC_PAGESIZE _SC_PAGESIZE using iox_off_t = off_t; -using iox_ssize_t = ssize_t; #define IOX_F_OK F_OK #define IOX_X_OK X_OK diff --git a/iceoryx_platform/linux/include/iceoryx_platform/acl.hpp b/iceoryx_platform/generic/include/iceoryx_platform/acl.hpp similarity index 64% rename from iceoryx_platform/linux/include/iceoryx_platform/acl.hpp rename to iceoryx_platform/generic/include/iceoryx_platform/acl.hpp index 5ebf85c684..febbfa0f9e 100644 --- a/iceoryx_platform/linux/include/iceoryx_platform/acl.hpp +++ b/iceoryx_platform/generic/include/iceoryx_platform/acl.hpp @@ -1,5 +1,4 @@ -// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. -// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. +// Copyright (c) 2024 by ekxide IO GmbH. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,9 +13,14 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 -#ifndef IOX_HOOFS_LINUX_PLATFORM_ACL_HPP -#define IOX_HOOFS_LINUX_PLATFORM_ACL_HPP -#include +#ifndef IOX_PLATFORM_ACL_HPP +#define IOX_PLATFORM_ACL_HPP -#endif // IOX_HOOFS_LINUX_PLATFORM_ACL_HPP +#if __has_include("iceoryx_platform/override/acl.hpp") +#include "iceoryx_platform/override/acl.hpp" +#else +#include "iceoryx_platform/generic/acl.hpp" +#endif // __has_include + +#endif // IOX_PLATFORM_ACL_HPP diff --git a/iceoryx_platform/generic/include/iceoryx_platform/generic/acl.hpp b/iceoryx_platform/generic/include/iceoryx_platform/generic/acl.hpp new file mode 100644 index 0000000000..7b85c0e4b7 --- /dev/null +++ b/iceoryx_platform/generic/include/iceoryx_platform/generic/acl.hpp @@ -0,0 +1,87 @@ +// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2024 by ekxide IO GmbH. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + +#ifndef IOX_HOOFS_GENERIC_PLATFORM_ACL_HPP +#define IOX_HOOFS_GENERIC_PLATFORM_ACL_HPP + +#include "iceoryx_platform/platform_settings.hpp" +#include "iceoryx_platform/types.hpp" + +// NOTE: The functions can be individually overwritten by setting the corresponding 'IOX_PLATFORM_OVERRIDE_*' define in +// the respective platform specific 'override/*.h' header + + +#ifndef IOX_PLATFORM_OVERRIDE_ACL_ALL + +#if IOX_FEATURE_ACL + +#include + +#else + +// NOLINTBEGIN(cppcoreguidelines-macro-usage) Macros are required for compatibility with the ones from acl.h + +#define ACL_USER_OBJ 0 +#define ACL_USER 1 +#define ACL_GROUP_OBJ 2 +#define ACL_GROUP 3 +#define ACL_OTHER 4 +#define ACL_READ 5 +#define ACL_WRITE 6 +#define ACL_MASK 7 + +// NOLINTEND(cppcoreguidelines-macro-usage) + +struct iox_internal_acl_ext +{ +}; + +using acl_t = struct iox_internal_acl_ext*; +using acl_permset_t = int; +using acl_perm_t = int; +using acl_entry_t = int; +using acl_tag_t = int; + +#endif // IOX_FEATURE_ACL + +#endif // IOX_PLATFORM_OVERRIDE_ACL_ALL + +int iox_acl_valid(acl_t /*acl*/); + +int iox_acl_set_fd(int /*fd*/, acl_t /*acl*/); + +acl_t iox_acl_init(int /*count*/); + +int iox_acl_free(void* /*obj_p*/); + +int iox_acl_create_entry(acl_t* /*acl_p*/, acl_entry_t* /*entry_p*/); + +int iox_acl_set_tag_type(acl_entry_t /*entry_d*/, acl_tag_t /*tag_type*/); + +int iox_acl_set_qualifier(acl_entry_t /*entry_d*/, const void* /*qualifier_p*/); + +int iox_acl_get_permset(acl_entry_t /*entry_d*/, acl_permset_t* /*permset_p*/); + +int iox_acl_add_perm(acl_permset_t /*permset_d*/, acl_perm_t /*perm*/); + +char* iox_acl_to_text(acl_t /*acl*/, iox_ssize_t* /*len_p*/); + +acl_t iox_acl_from_text(const char* /*buf_p*/); + +acl_t iox_acl_get_fd(int /*fd*/); + +#endif // IOX_HOOFS_GENERIC_PLATFORM_ACL_HPP diff --git a/iceoryx_platform/generic/include/iceoryx_platform/generic/stdlib.hpp b/iceoryx_platform/generic/include/iceoryx_platform/generic/stdlib.hpp index 1dbf7ee149..024fe5b3c5 100644 --- a/iceoryx_platform/generic/include/iceoryx_platform/generic/stdlib.hpp +++ b/iceoryx_platform/generic/include/iceoryx_platform/generic/stdlib.hpp @@ -19,6 +19,9 @@ #include +// NOTE: The functions can be individually overwritten by setting the corresponding 'IOX_PLATFORM_OVERRIDE_*' define in +// the respective platform specific 'override/*.h' header + /// @brief Implementation of 'getenv_s' /// @param[out] actual_size_with_null of the value of the env variable including null-termination or 0 if the /// environment variable does not exist diff --git a/iceoryx_platform/generic/source/acl_feature_off.cpp b/iceoryx_platform/generic/source/acl_feature_off.cpp new file mode 100644 index 0000000000..61b374f23e --- /dev/null +++ b/iceoryx_platform/generic/source/acl_feature_off.cpp @@ -0,0 +1,87 @@ +// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2024 by ekxide IO GmbH. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + +#include "iceoryx_platform/acl.hpp" + +#ifndef IOX_PLATFORM_OVERRIDE_ACL_ALL + +#if !IOX_FEATURE_ACL + +int iox_acl_valid(acl_t /*acl*/) +{ + return 0; +} + +int iox_acl_set_fd(int /*fd*/, acl_t /*acl*/) +{ + return 0; +} + +acl_t iox_acl_init(int /*count*/) +{ + static struct iox_internal_acl_ext stub; + return &stub; +} + +int iox_acl_free(void* /*obj_p*/) +{ + return 0; +} + +int iox_acl_create_entry(acl_t* /*acl_p*/, acl_entry_t* /*entry_p*/) +{ + return 0; +} + +int iox_acl_set_tag_type(acl_entry_t /*entry_d*/, acl_tag_t /*tag_type*/) +{ + return 0; +} + +int iox_acl_set_qualifier(acl_entry_t /*entry_d*/, const void* /*qualifier_p*/) +{ + return 0; +} + +int iox_acl_get_permset(acl_entry_t /*entry_d*/, acl_permset_t* /*permset_p*/) +{ + return 0; +} + +int iox_acl_add_perm(acl_permset_t /*permset_d*/, acl_perm_t /*perm*/) +{ + return 0; +} + +char* iox_acl_to_text(acl_t /*acl*/, iox_ssize_t* /*len_p*/) +{ + return nullptr; +} + +acl_t iox_acl_from_text(const char* /*buf_p*/) +{ + return acl_t(); +} + +acl_t iox_acl_get_fd(int /*fd*/) +{ + return acl_t(); +} + +#endif // !IOX_FEATURE_ACL + +#endif // IOX_PLATFORM_OVERRIDE_ACL_ALL diff --git a/iceoryx_platform/generic/source/acl_feature_on.cpp b/iceoryx_platform/generic/source/acl_feature_on.cpp new file mode 100644 index 0000000000..4261a32774 --- /dev/null +++ b/iceoryx_platform/generic/source/acl_feature_on.cpp @@ -0,0 +1,86 @@ +// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2024 by ekxide IO GmbH. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + +#include "iceoryx_platform/acl.hpp" + +#ifndef IOX_PLATFORM_OVERRIDE_ACL_ALL + +#if IOX_FEATURE_ACL + +int iox_acl_valid(acl_t acl) +{ + return acl_valid(acl); +} + +int iox_acl_set_fd(int fd, acl_t acl) +{ + return acl_set_fd(fd, acl); +} + +acl_t iox_acl_init(int count) +{ + return acl_init(count); +} + +int iox_acl_free(void* obj_p) +{ + return acl_free(obj_p); +} + +int iox_acl_create_entry(acl_t* acl_p, acl_entry_t* entry_p) +{ + return acl_create_entry(acl_p, entry_p); +} + +int iox_acl_set_tag_type(acl_entry_t entry_d, acl_tag_t tag_type) +{ + return acl_set_tag_type(entry_d, tag_type); +} + +int iox_acl_set_qualifier(acl_entry_t entry_d, const void* qualifier_p) +{ + return acl_set_qualifier(entry_d, qualifier_p); +} + +int iox_acl_get_permset(acl_entry_t entry_d, acl_permset_t* permset_p) +{ + return acl_get_permset(entry_d, permset_p); +} + +int iox_acl_add_perm(acl_permset_t permset_d, acl_perm_t perm) +{ + return acl_add_perm(permset_d, perm); +} + +char* iox_acl_to_text(acl_t acl, iox_ssize_t* len_p) +{ + return acl_to_text(acl, len_p); +} + +acl_t iox_acl_from_text(const char* buf_p) +{ + return acl_from_text(buf_p); +} + +acl_t iox_acl_get_fd(int fd) +{ + return acl_get_fd(fd); +} + +#endif // IOX_FEATURE_ACL + +#endif // IOX_PLATFORM_OVERRIDE_ACL_ALL diff --git a/iceoryx_platform/linux/include/iceoryx_platform/types.hpp b/iceoryx_platform/linux/include/iceoryx_platform/types.hpp index 3b247b4be5..f4d7d99c6d 100644 --- a/iceoryx_platform/linux/include/iceoryx_platform/types.hpp +++ b/iceoryx_platform/linux/include/iceoryx_platform/types.hpp @@ -19,6 +19,8 @@ #include +using iox_ssize_t = ssize_t; + using iox_gid_t = gid_t; using iox_uid_t = uid_t; diff --git a/iceoryx_platform/linux/include/iceoryx_platform/unistd.hpp b/iceoryx_platform/linux/include/iceoryx_platform/unistd.hpp index 3f69ac9239..d389b540cd 100644 --- a/iceoryx_platform/linux/include/iceoryx_platform/unistd.hpp +++ b/iceoryx_platform/linux/include/iceoryx_platform/unistd.hpp @@ -25,7 +25,6 @@ #define IOX_SC_PAGESIZE _SC_PAGESIZE using iox_off_t = off_t; -using iox_ssize_t = ssize_t; #define IOX_F_OK F_OK #define IOX_X_OK X_OK diff --git a/iceoryx_platform/mac/include/iceoryx_platform/acl.hpp b/iceoryx_platform/mac/include/iceoryx_platform/acl.hpp deleted file mode 100644 index 2811f4e518..0000000000 --- a/iceoryx_platform/mac/include/iceoryx_platform/acl.hpp +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. -// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: Apache-2.0 -#ifndef IOX_HOOFS_MAC_PLATFORM_ACL_HPP -#define IOX_HOOFS_MAC_PLATFORM_ACL_HPP - -#include "iceoryx_platform/types.hpp" - -#define ACL_USER_OBJ 0 -#define ACL_USER 1 -#define ACL_GROUP_OBJ 2 -#define ACL_GROUP 3 -#define ACL_OTHER 4 -#define ACL_READ 5 -#define ACL_WRITE 6 -#define ACL_MASK 7 - -struct __acl_ext -{ -}; - -using acl_t = struct __acl_ext*; -using acl_permset_t = int; -using acl_perm_t = int; -using acl_entry_t = int; -using acl_tag_t = int; - -inline int acl_valid(acl_t) -{ - return 0; -} - -inline int acl_set_fd(int, acl_t) -{ - return 0; -} - -inline acl_t acl_init(int) -{ - static struct __acl_ext stub; - return &stub; -} - -inline int acl_free(void*) -{ - return 0; -} - -inline int acl_create_entry(acl_t*, acl_entry_t*) -{ - return 0; -} - -inline int acl_set_tag_type(acl_entry_t, acl_tag_t) -{ - return 0; -} - -inline int acl_set_qualifier(acl_entry_t, const void*) -{ - return 0; -} - -inline int acl_get_permset(acl_entry_t, acl_permset_t*) -{ - return 0; -} - -inline int acl_add_perm(acl_permset_t, acl_perm_t) -{ - return 0; -} - -inline char* acl_to_text(acl_t, ssize_t*) -{ - return nullptr; -} - -inline acl_t acl_from_text(const char*) -{ - return acl_t(); -} - -inline acl_t acl_get_fd(int) -{ - return acl_t(); -} - -#endif // IOX_HOOFS_MAC_PLATFORM_ACL_HPP diff --git a/iceoryx_platform/qnx/include/iceoryx_platform/acl.hpp b/iceoryx_platform/qnx/include/iceoryx_platform/acl.hpp deleted file mode 100644 index cd3a8420c8..0000000000 --- a/iceoryx_platform/qnx/include/iceoryx_platform/acl.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. -// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: Apache-2.0 -#ifndef IOX_HOOFS_QNX_PLATFORM_ACL_HPP -#define IOX_HOOFS_QNX_PLATFORM_ACL_HPP - -#include - -#endif // IOX_HOOFS_QNX_PLATFORM_ACL_HPP diff --git a/iceoryx_platform/unix/include/iceoryx_platform/acl.hpp b/iceoryx_platform/unix/include/iceoryx_platform/acl.hpp deleted file mode 100644 index 3ea81d2215..0000000000 --- a/iceoryx_platform/unix/include/iceoryx_platform/acl.hpp +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. -// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: Apache-2.0 -#ifndef IOX_HOOFS_UNIX_PLATFORM_ACL_HPP -#define IOX_HOOFS_UNIX_PLATFORM_ACL_HPP - -#include "iceoryx_platform/types.hpp" - -#define ACL_USER_OBJ 0 -#define ACL_USER 1 -#define ACL_GROUP_OBJ 2 -#define ACL_GROUP 3 -#define ACL_OTHER 4 -#define ACL_READ 5 -#define ACL_WRITE 6 -#define ACL_MASK 7 - -struct __acl_ext -{ -}; - -using acl_t = struct __acl_ext*; -using acl_permset_t = int; -using acl_perm_t = int; -using acl_entry_t = int; -using acl_tag_t = int; - -inline int acl_valid(acl_t) -{ - return 0; -} - -inline int acl_set_fd(int, acl_t) -{ - return 0; -} - -inline acl_t acl_init(int) -{ - static struct __acl_ext stub; - return &stub; -} - -inline int acl_free(void*) -{ - return 0; -} - -inline int acl_create_entry(acl_t*, acl_entry_t*) -{ - return 0; -} - -inline int acl_set_tag_type(acl_entry_t, acl_tag_t) -{ - return 0; -} - -inline int acl_set_qualifier(acl_entry_t, const void*) -{ - return 0; -} - -inline int acl_get_permset(acl_entry_t, acl_permset_t*) -{ - return 0; -} - -inline int acl_add_perm(acl_permset_t, acl_perm_t) -{ - return 0; -} - -inline char* acl_to_text(acl_t, ssize_t*) -{ - return nullptr; -} - -inline acl_t acl_from_text(const char*) -{ - return acl_t(); -} - -inline acl_t acl_get_fd(int) -{ - return acl_t(); -} - -#endif // IOX_HOOFS_UNIX_PLATFORM_ACL_HPP diff --git a/iceoryx_platform/win/include/iceoryx_platform/acl.hpp b/iceoryx_platform/win/include/iceoryx_platform/acl.hpp deleted file mode 100644 index 8d69c5e08a..0000000000 --- a/iceoryx_platform/win/include/iceoryx_platform/acl.hpp +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: Apache-2.0 -#ifndef IOX_HOOFS_WIN_PLATFORM_ACL_HPP -#define IOX_HOOFS_WIN_PLATFORM_ACL_HPP - -#include "iceoryx_platform/types.hpp" - -#define ACL_USER_OBJ 0 -#define ACL_USER 1 -#define ACL_GROUP_OBJ 2 -#define ACL_GROUP 3 -#define ACL_OTHER 4 -#define ACL_READ 5 -#define ACL_WRITE 6 -#define ACL_MASK 7 - -struct __acl_ext -{ -}; - -using acl_t = struct __acl_ext*; -using acl_permset_t = int; -using acl_perm_t = int; -using acl_entry_t = int; -using acl_tag_t = int; - -inline int acl_valid(acl_t acl) -{ - return 0; -} - -inline int acl_set_fd(int fd, acl_t acl) -{ - return 0; -} - -inline acl_t acl_init(int count) -{ - static struct __acl_ext stub; - return &stub; -} - -inline int acl_free(void*) -{ - return 0; -} - -inline int acl_create_entry(acl_t* acl_p, acl_entry_t* entry_p) -{ - return 0; -} - -inline int acl_set_tag_type(acl_entry_t entry_d, acl_tag_t tag_type) -{ - return 0; -} - -inline int acl_set_qualifier(acl_entry_t entry_d, const void* qualifier_p) -{ - return 0; -} - -inline int acl_get_permset(acl_entry_t entry_d, acl_permset_t* permset_p) -{ - return 0; -} - -inline int acl_add_perm(acl_permset_t permset_d, acl_perm_t perm) -{ - return 0; -} - -inline char* acl_to_text(acl_t acl, iox_ssize_t* len_p) -{ - return nullptr; -} - -inline acl_t acl_from_text(const char* buf_p) -{ - return acl_t(); -} - -inline acl_t acl_get_fd(int fd) -{ - return acl_t(); -} - -#endif // IOX_HOOFS_WIN_PLATFORM_ACL_HPP