Page MenuHomeFreeBSD

lib/flua/libjail: Allow empty params table
ClosedPublic

Authored by freqlabs on Feb 18 2021, 6:34 PM.
Tags
None
Referenced Files
F105993021: D28778.diff
Mon, Dec 23, 2:48 PM
Unknown Object (File)
Wed, Dec 4, 9:39 AM
Unknown Object (File)
Mon, Nov 25, 12:00 AM
Unknown Object (File)
Nov 4 2024, 1:15 AM
Unknown Object (File)
Nov 4 2024, 1:15 AM
Unknown Object (File)
Nov 4 2024, 1:15 AM
Unknown Object (File)
Nov 4 2024, 12:55 AM
Unknown Object (File)
Oct 2 2024, 2:33 PM
Subscribers
None

Details

Summary

The name or jid always gets added to the params, and that's enough to avoid allocating a 0 length params array.

Test Plan
# /usr/libexec/flua -l jail -e 'jail.setparams("myjail", {}, jail.CREATE | jail.ATTACH)' -e 'os.execute("ps ax")'
 PID TT  STAT    TIME COMMAND
2412  2  S+J  0:00.00 /usr/libexec/flua -l jail -e jail.setparams("myjail", {}, jail.CREATE|jail.ATTACH) -e os
2413  2  R+J  0:00.00 ps ax
# /usr/libexec/flua -l jail -l ucl <<EOF
jail.setparams("myjail", {persist="true"}, jail.CREATE)
_, params = jail.getparams("myjail", {})
print(ucl.to_json(params))
jail.setparams("myjail", {persist="false"}, jail.UPDATE)
EOF
{
    "name": "myjail"
}

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped