chiark / gitweb /
env: considerably beef up environment cleaning logic
authorLennart Poettering <lennart@poettering.net>
Mon, 11 Feb 2013 02:46:08 +0000 (03:46 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 11 Feb 2013 02:54:50 +0000 (03:54 +0100)
commit4d1a69043862ed979642f5688097160355d4cc81
treedeac099c3b4da6740cedac9af10913981303f78b
parentc62c294fd521e5b65bb52f831773916bbc4cd90a
env: considerably beef up environment cleaning logic

Now, actually check if the environment variable names and values used
are valid, before accepting them. With this in place are at some places
more rigid than POSIX, and less rigid at others. For example, this code
allows lower-case environment variables (which POSIX suggests not to
use), but it will not allow non-UTF8 variable values.

All in all this should be a good middle ground of what to allow and what
not to allow as environment variables.

(This also splits out all environment related calls into env-util.[ch])
14 files changed:
Makefile.am
src/core/dbus-manager.c
src/core/execute.c
src/core/service.c
src/hostname/hostnamed.c
src/locale/localed.c
src/notify/notify.c
src/shared/env-util.c [new file with mode: 0644]
src/shared/env-util.h [new file with mode: 0644]
src/shared/strv.c
src/shared/strv.h
src/shared/util.c
src/shared/util.h
src/test/test-env-replace.c