diff --git a/fileattrs/sysusers.attr b/fileattrs/sysusers.attr index f7a3e838d1..48d4caede9 100644 --- a/fileattrs/sysusers.attr +++ b/fileattrs/sysusers.attr @@ -6,6 +6,9 @@ # For groups created as a side-effect, only provide the group. %__sysusers_provides() %{lua: for line in io.lines(macros["1"]) do + if line:sub(1, 1) == '#' then + goto continue + end fields = {} for w in line:gmatch("%S+") do table.insert(fields, w) @@ -14,5 +17,6 @@ table.insert(fields, 1, '-b') print(macros.add_sysuser(fields)) end + ::continue:: end } diff --git a/tests/data/SPECS/klang.spec b/tests/data/SPECS/klang.spec index e7c03cd7f8..64bd90c104 100644 --- a/tests/data/SPECS/klang.spec +++ b/tests/data/SPECS/klang.spec @@ -45,7 +45,12 @@ cat << EOF > ${RPM_BUILD_ROOT}/%{_sysusersdir}/klangd.conf u klangd - "Klang server" /var/lib/klangd /sbin/nologin EOF cat << EOF > ${RPM_BUILD_ROOT}/%{_sysusersdir}/plong.conf + +# Real life files have all sorts of anomalies u plong - "Plong fu" /var/lib/plong /sbin/nologin +#...such as empty lines + +# and comments comments g klong - m ding dong r - 123-321