Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently use uid_t/gid_t for credentials #561

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kheaactua
Copy link
Contributor

@kheaactua kheaactua commented Nov 3, 2023

Consistent use uid_t/gid_t types for user/group IDs rather than sometimes using std::uint32_t.

We found this important in 3.1.20 and 3.3.8 on QNX, but also using these types should make vsomeip more platform independent.

@kheaactua kheaactua marked this pull request as draft November 3, 2023 17:08
@kheaactua kheaactua marked this pull request as ready for review November 4, 2023 14:23
Copy link
Contributor

@goncaloalmeida goncaloalmeida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase

@kheaactua kheaactua force-pushed the uid_gid branch 2 times, most recently from 1a64f38 to 40f2c8f Compare December 14, 2023 16:03
@kheaactua
Copy link
Contributor Author

Please rebase

Rebased to 3.4.10 and forced pushed a tweak to internal_android.hpp

@kheaactua
Copy link
Contributor Author

It looks like I hit the Windows build error:

D:\a\vsomeip\vsomeip\implementation\routing\src\../../configuration/include/internal.hpp(153,46): error C2039: 'uid_t': is not a member of '`global namespace'' [D:\a\vsomeip\vsomeip\build\vsomeip3.vcxproj]
D:\a\vsomeip\vsomeip\implementation\routing\src\../../configuration/include/internal.hpp(153,46): error C2275: 'vsomeip_v3::uid_t': expected an expression instead of a type [D:\a\vsomeip\vsomeip\build\vsomeip3.vcxproj]
D:\a\vsomeip\vsomeip\implementation\routing\src\../../configuration/include/internal.hpp(153,29): error C2923: 'std::numeric_limits': 'vsomeip_v3::uid_t' is not a valid template type argument for parameter '_Ty' [D:\a\vsomeip\vsomeip\build\vsomeip3.vcxproj]
D:\a\vsomeip\vsomeip\interface\vsomeip/primitive_types.hpp(60,27): message : see declaration of 'vsomeip_v3::uid_t' [D:\a\vsomeip\vsomeip\build\vsomeip3.vcxproj]
D:\a\vsomeip\vsomeip\implementation\routing\src\../../configuration/include/internal.hpp(153,54): error C2955: 'std::numeric_limits': use of class template requires template argument list [D:\a\vsomeip\vsomeip\build\vsomeip3.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\include\limits(84,22): message : see declaration of 'std::numeric_limits' [D:\a\vsomeip\vsomeip\build\vsomeip3.vcxproj]
D:\a\vsomeip\vsomeip\implementation\routing\src\../../configuration/include/internal.hpp(154,46): error C2039: 'gid_t': is not a member of '`global namespace'' [D:\a\vsomeip\vsomeip\build\vsomeip3.vcxproj]
D:\a\vsomeip\vsomeip\implementation\routing\src\../../configuration/include/internal.hpp(154,46): error C2275: 'vsomeip_v3::gid_t': expected an expression instead of a type [D:\a\vsomeip\vsomeip\build\vsomeip3.vcxproj]
D:\a\vsomeip\vsomeip\implementation\routing\src\../../configuration/include/internal.hpp(154,29): error C2923: 'std::numeric_limits': 'vsomeip_v3::gid_t' is not a valid template type argument for parameter '_Ty' [D:\a\vsomeip\vsomeip\build\vsomeip3.vcxproj]
D:\a\vsomeip\vsomeip\interface\vsomeip/primitive_types.hpp(61,27): message : see declaration of 'vsomeip_v3::gid_t' [D:\a\vsomeip\vsomeip\build\vsomeip3.vcxproj]
D:\a\vsomeip\vsomeip\implementation\routing\src\../../configuration/include/internal.hpp(154,54): error C2955: 'std::numeric_limits': use of class template requires template argument list [D:\a\vsomeip\vsomeip\build\vsomeip3.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\include\limits(84,22): message : see declaration of 'std::numeric_limits' [D:\a\vsomeip\vsomeip\build\vsomeip3.vcxproj]

I'll take a look at this and push a fix.

@kheaactua
Copy link
Contributor Author

Hi @goncaloalmeida,

PR is rebased, and all the tests pass.

@kheaactua
Copy link
Contributor Author

Tweaked the uid/gid deserialization.

@goncaloalmeida

Despite using proper types for uid/gid, the deserialization was still
assuming uint32_t.  This patch uses the OS's type (assuming it's 32 bits
long.)  This also removes the sketchy reinterpret_cast.

Signed-off-by: Matthew Russell <matthew.g.russell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants