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

Add delimiter for pamenv #530

Merged
merged 1 commit into from
Dec 18, 2023
Merged

Add delimiter for pamenv #530

merged 1 commit into from
Dec 18, 2023

Conversation

huangyxi
Copy link
Contributor

The "#" character at start of line (no space at front) can be used to mark this line as a comment line.
https://man7.org/linux/man-pages/man5/pam_env.conf.5.html

@alerque
Copy link
Member

alerque commented Dec 18, 2023

This will only partially work because I don't think we have any accommodations for forcing comments to be at the start of a line. That might be worth opening a feature request to track as it may affect other formats as well. I can merge this but results will be a little bit inconsistent since most of the macros assume comments can start anywhere in a line.

@huangyxi
Copy link
Contributor Author

Thank you for your response and for identifying a generic issue in commenting.

I agree with the point that the current modification may not strictly follow the official document, potentially leading to inconsistency. However, in this specific situation, commenting whether at the start of a line doesn't actually affect the final result. Since the initial release of Linux-PAM on GitHub in June 2000, leading white spaces have been skipped before the comment sign # detection. And I have confirmed this on an Ubuntu machine.

	// `/modules/pam_env/pam_env.c`

	/* skip leading white space */
	key += strspn(key, " \n\t");

	/* skip blanks lines and comments */
	if (!key || key[0] == '#')
	    continue;

initial commit of above lines in linux-pam
current commit of above lines in linux-pam

Anyway, I understand and respect the decision, whether it involves merging this pull request or not.

@alerque alerque merged commit e361a44 into preservim:master Dec 18, 2023
1 check passed
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