[Bug 1185118] New: %attr rule with missing closing paren causes inscrutable error messages
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1185118 Bug ID: 1185118 Summary: %attr rule with missing closing paren causes inscrutable error messages Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other URL: https://github.com/rpm-software-management/rpm/issues/ 1648 OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: jeffm@suse.com Reporter: jeffm@suse.com QA Contact: qa-bugs@suse.de CC: mls@suse.com Found By: --- Blocker: --- When a malformed rule such as: %dir %attr(-,root,root /path/to/file is encountered, rpmbuild fails with an error message like: error: File must begin with "/": n�L�_;^? This is due to the check for the closing paren as found in other rule handlers is missing. When the rule is overwritten by spaces, parseForAttr assumes that the final character is the closing paren and will overwrite the entire string including the NUL terminator. Later, since the entire string is spaces and also not NUL terminated, the error message will include whatever garbage happens to be after the end of the string. Reported upstream as https://github.com/rpm-software-management/rpm/issues/1648 -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1185118 https://bugzilla.suse.com/show_bug.cgi?id=1185118#c1 --- Comment #1 from Jeff Mahoney <jeffm@suse.com> --- Created attachment 848632 --> https://bugzilla.suse.com/attachment.cgi?id=848632&action=edit [PATCH] Handle missing closing paren in %attr rules parseForAttr is missing the check for the closing paren. When a malformed rule is encountered, the bounds for the end of the rule will be the NUL terminator for the string. When it overwrites the rule with spaces, the entire string, including the NUL terminator, will be overwritten. Later, in parseForSimple, the string will no longer contain a pathname and will fail the check for files beginning with /. Since the string is also no longer NUL terminated, the error will contain garbage like the following: error: File must begin with "/": n�L�_;^? Adding the check for the closing paren fixes the issue. Fixes: #1648 -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1185118 https://bugzilla.suse.com/show_bug.cgi?id=1185118#c2 --- Comment #2 from Michael Schr�der <mls@suse.com> --- (Opening an issue in the upstream tracker is enough, you do not need to duplicate things into our bugzilla.) -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1185118 https://bugzilla.suse.com/show_bug.cgi?id=1185118#c3 --- Comment #3 from Jeff Mahoney <jeffm@suse.com> --- Fix has landed in upstream rpm 4.17 but not Tumbleweed yet. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com