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

Control character check #687

Merged
merged 1 commit into from
Mar 31, 2023
Merged

Control character check #687

merged 1 commit into from
Mar 31, 2023

Conversation

tomspiderlabs
Copy link
Contributor

Added a check to search for control characters and return -1 (in "err") if found.

@github-advanced-security
Copy link

You have successfully added a new shellcheck configuration differential-shellcheck. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

Copy link
Member

@hallyn hallyn left a comment

Choose a reason for hiding this comment

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

Thank you for the patch. But let's not do two runs through the characters. You can just combine this with the check below for isprint().

If you'd rather I make that change in-line while merging, please let me know.

Copy link
Contributor Author

@tomspiderlabs tomspiderlabs left a comment

Choose a reason for hiding this comment

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

Added a control character check within the non-printable character pass.

lib/fields.c Show resolved Hide resolved
Copy link
Collaborator

@ikerexxe ikerexxe left a comment

Choose a reason for hiding this comment

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

Two minor comments and I'd like to raise that one of the tests is failing in the CI. I didn't check it profoundly, but it's a usermod test case and you are changing that file so it seems valid.

lib/fields.c Outdated Show resolved Hide resolved
lib/fields.c Outdated Show resolved Hide resolved
Copy link
Contributor Author

@tomspiderlabs tomspiderlabs left a comment

Choose a reason for hiding this comment

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

Updates to the text make sense as per the changes made to control characters returning -1 and non-printables returning 1 still.

Added control character check, returning -1 (to "err") if control characters are present.
@ikerexxe
Copy link
Collaborator

@hallyn what do we do with the failing test case?

@hallyn
Copy link
Member

hallyn commented Mar 30, 2023

@hallyn what do we do with the failing test case?

I'll have to look into it this hopefully tonight, else this weekend. I'll look at the others you mentioned too.

@hallyn
Copy link
Member

hallyn commented Mar 30, 2023

Oh - I see, it fails in your doc-only pr too. Let's just merge then.

@hallyn hallyn merged commit e5905c4 into shadow-maint:master Mar 31, 2023
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.

3 participants