chiark / gitweb /
Reject invalid quoted strings
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 30 Jul 2014 02:01:36 +0000 (22:01 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 31 Jul 2014 08:00:31 +0000 (04:00 -0400)
commita2a5291b3f5ab6ed4c92f51d0fd10a03047380d8
tree1a74a85c70861b0a411d9dd325b039976de4fd4e
parent73381fcf54e38456067f0e87b8611a21eff99169
Reject invalid quoted strings

String which ended in an unfinished quote were accepted, potentially
with bad memory accesses.

Reject anything which ends in a unfished quote, or contains
non-whitespace characters right after the closing quote.

_FOREACH_WORD now returns the invalid character in *state. But this return
value is not checked anywhere yet.

Also, make 'word' and 'state' variables const pointers, and rename 'w'
to 'word' in various places. Things are easier to read if the same name
is used consistently.

mbiebl_> am I correct that something like this doesn't work
mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"'
mbiebl_> systemd seems to strip of the quotes
mbiebl_> systemctl status shows
mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS  $RootDir $MountPoint
mbiebl_> which is pretty weird
33 files changed:
src/core/device.c
src/core/load-fragment.c
src/core/main.c
src/cryptsetup/cryptsetup.c
src/delta/delta.c
src/getty-generator/getty-generator.c
src/journal-remote/journal-remote.c
src/journal/journald-server.c
src/journal/sd-journal.c
src/libsystemd-network/network-internal.c
src/libsystemd/sd-login/sd-login.c
src/login/logind-inhibit.c
src/machine/machine.c
src/nspawn/nspawn.c
src/resolve/resolved-manager.c
src/shared/cgroup-util.c
src/shared/condition-util.c
src/shared/conf-parser.c
src/shared/conf-parser.h
src/shared/install.c
src/shared/log.c
src/shared/path-util.c
src/shared/sleep-config.c
src/shared/strv.c
src/shared/util.c
src/shared/util.h
src/systemctl/systemctl.c
src/sysv-generator/sysv-generator.c
src/test/test-strv.c
src/test/test-util.c
src/timesync/timesyncd.c
src/udev/net/link-config.c
src/udev/udevd.c