diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-17 22:56:28 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-20 23:32:53 -0500 |
commit | 184d19047370652184a44686cf85bf5001bdf413 (patch) | |
tree | ff4fe4f6a27cad87cb9da6e11b507a17e4e2daf8 /src/test/test-exec-util.c | |
parent | ccad1fd07ce4eb40a2fcf81cfb55d9b41fdcac48 (diff) |
Tighten checking for variable validity
In the future we might want to allow additional syntax (for example
"unset VAR". But let's check that the data we're getting does not contain
anything unexpected.
Diffstat (limited to 'src/test/test-exec-util.c')
-rw-r--r-- | src/test/test-exec-util.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/test/test-exec-util.c b/src/test/test-exec-util.c index 94fe042aa9..482b0751b9 100644 --- a/src/test/test-exec-util.c +++ b/src/test/test-exec-util.c @@ -305,8 +305,16 @@ static void test_environment_gathering(void) { "echo A=$A:24\n" "echo B=12\n" "echo C=000\n" - "echo C=001\n" /* variable overwriting */ - "echo PATH=$PATH:/no/such/file", /* variable from manager */ + "echo C=001\n" /* variable overwriting */ + /* various invalid entries */ + "echo unset A\n" + "echo unset A=\n" + "echo unset A=B\n" + "echo unset \n" + "echo A B=C\n" + "echo A\n" + /* test variable assignment without newline */ + "echo PATH=$PATH:/no/such/file", /* no newline */ WRITE_STRING_FILE_CREATE) == 0); assert_se(chmod(name, 0755) == 0); |