pam-auth-update should allow for comments in pam-configs profiles

Bug #2075508 reported by Kodiak Firesmith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pam (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hello Ubuntu PAM maintainers. I've noticed that while not fatal, there are profile parsing errors when pam-auth-update encounters typical comment lines as it attempts to treat each new line that isn't part of another field as a $fieldname like so:

Use of uninitialized value $fieldname in hash element at /usr/sbin/pam-auth-update line 733, <PROFILE> line 1.
Use of uninitialized value $fieldname in hash element at /usr/sbin/pam-auth-update line 734, <PROFILE> line 1.
Use of uninitialized value $fieldname in hash element at /usr/sbin/pam-auth-update line 737, <PROFILE> line 1.

You can reproduce this by placing a `#` on a new line of the profile.

This is important to me because I have to do some unclean or less than ideal trickery described in 2075389, and I want to be able to explain my reasoning for doing so within the profile for the next person who comes across it.

Even if it were not the case due to that bug, I'd still like to be able to place descriptive comments into our custom profile as the whole PAMConfigFramework is not exhaustively documented and was not very approachable to a new profile author without a lot of investigation.

Thanks!

Ubuntu releases tested: 20.04, 22.04, 24.04

Package versions are: libpam-runtime 1.3.1-5ubuntu4.7 (20.04), 1.4.0-11ubuntu2.4 (22.04), 1.5.3-5ubuntu5.1 (24.04)

Expectation: pam-auth-update discards any comment-like content (especially `^#`, but perhaps also `^;` and `^//`.

Instead: Parsing errors

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.