]> git.ipfire.org Git - thirdparty/systemd.git/commit
proc-cmdline: introduce proc_cmdline_strv()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 22 Mar 2023 23:33:59 +0000 (08:33 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 29 Mar 2023 01:34:39 +0000 (10:34 +0900)
commit94e0130ab0e22866033fb70891bd9155de1111a1
tree7f9834d576477d3ac1ea0bd84aced3784ac6ca01
parent70806d455483329ba69917832268800bff411382
proc-cmdline: introduce proc_cmdline_strv()

When we are running in a container, we parse the command line of PID1 in
proc_cmdline_parse() or friends. Previously, first we merge the command
line nulstr as a single string, and then split by using
extract_first_word(). That's not only redundant, but also unsafe when
the command line argument contain a space.

This drops the redundant steps, hence we can safely parse arguments with
space.
src/basic/proc-cmdline.c
src/basic/proc-cmdline.h
src/test/test-proc-cmdline.c