Fix comment line handling in sysusers.d(8) files
sysusers.d(8) format permits empty lines and commits, and so must we. Add some extra fluff to the test-case for this. This is the second half of https://bugzilla.redhat.com/show_bug.cgi?id=2246236 Fixes: #2741
This commit is contained in:
parent
43cf645fc1
commit
a8ec768950
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue