Skip to content

SYS_UID_MIN/SYS_UID_MAX are inclusive use greater only(no equal) - #15277

Open
teacup-on-rockingchair wants to merge 2 commits into
ComplianceAsCode:masterfrom
teacup-on-rockingchair:no_shelllogin_for_systemaccounts
Open

teacup-on-rockingchair wants to merge 2 commits into
ComplianceAsCode:masterfrom
teacup-on-rockingchair:no_shelllogin_for_systemaccounts

Conversation

@teacup-on-rockingchair

Copy link
Copy Markdown
Contributor

Description:

  • Cover the case user id is equal to SYS_UID_MAX constant

Rationale:

  • Take into consideration that SYS_UID_MAX is inclusive so there should be no user ID eqaul to SYS_UID_MAX, i.e if SYS_UID_MAX is 999 , the uid 1000 can have shell login

Review Hints:

  • Made some changes to the unit tests to cover that scenario
  • added copy distro default macro for SUSE platform in common.sh as first test setup step

@teacup-on-rockingchair teacup-on-rockingchair added Test Suite Update in Test Suite. OVAL OVAL update. Related to the systems assessments. SLES SUSE Linux Enterprise Server product related. labels Nov 1, 2026
@teacup-on-rockingchair teacup-on-rockingchair added this to the 0.1.83 milestone Nov 1, 2026
@svet-se svet-se self-assigned this Nov 4, 2026
@vojtapolasek vojtapolasek self-assigned this Nov 9, 2026

@vojtapolasek vojtapolasek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add a test for all platforms which checks exactly the off by one error you address. You check it only for Suse platform. Thank you.

@@ -0,0 +1,9 @@
#!/bin/bash

{{% if product in ['opensuse16', 'sle16', 'slmicro6'] %}}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this actually needed? There is similar if conditional within the macro it self.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Definitely overdoing it here :) thanks for bringing it up 🙇 Should be ok in 252a3ea

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OVAL OVAL update. Related to the systems assessments. SLES SUSE Linux Enterprise Server product related. Test Suite Update in Test Suite.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants