f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering This file is part of systemd.
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering Copyright 2013 Lennart Poettering
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering systemd is free software; you can redistribute it and/or modify it
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering under the terms of the GNU Lesser General Public License as published by
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering (at your option) any later version.
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering systemd is distributed in the hope that it will be useful, but
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering Lesser General Public License for more details.
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering You should have received a copy of the GNU Lesser General Public License
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering _cleanup_free_ char *one = NULL, *two = NULL, *three = NULL, *four = NULL, *five = NULL,
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering *six = NULL, *seven = NULL, *eight = NULL, *nine = NULL, *ten = NULL;
0ec0deaa30d0e68430f03fa6f32affa576481d18Lennart Poettering _cleanup_strv_free_ char **a = NULL, **b = NULL;
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering " # comment \n"
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering " ; comment \n"
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering " two = bar \n"
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering "invalid line\n"
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0Lennart Poettering "invalid line #comment\n"
7760171904ef007f19e8f46aa240a00e382d5b74Lennart Poettering "three = \"333\n"
7760171904ef007f19e8f46aa240a00e382d5b74Lennart Poettering "four = \'44\\\"44\'\n"
7760171904ef007f19e8f46aa240a00e382d5b74Lennart Poettering "five = \'55\\\'55\' \"FIVE\" cinco \n"
7760171904ef007f19e8f46aa240a00e382d5b74Lennart Poettering "six = seis sechs\\\n"
7760171904ef007f19e8f46aa240a00e382d5b74Lennart Poettering "seven=\"sevenval\" #nocomment\n"
7760171904ef007f19e8f46aa240a00e382d5b74Lennart Poettering "eight=eightval #nocomment\n"
7760171904ef007f19e8f46aa240a00e382d5b74Lennart Poettering "export nine=nineval\n"
fclose(f);
assert_se(r >= 0);
STRV_FOREACH(i, a)
strv_env_clean(a);
r = parse_env_file(
t, NULL,
NULL);
assert_se(r >= 0);
r = write_env_file(p, a);
assert_se(r >= 0);
assert_se(r >= 0);
unlink(t);
unlink(p);
char t[] = "/tmp/test-fileio-in-XXXXXX",
p[] = "/tmp/test-fileio-out-XXXXXX";
FILE *f;
assert_se(f);
fflush(f);
fclose(f);
assert_se(r >= 0);
STRV_FOREACH(i, a)
r = write_env_file(p, a);
assert_se(r >= 0);
assert_se(r >= 0);
unlink(t);
unlink(p);
char t[] = "/tmp/test-executable-XXXXXX";
FILE *f;
assert_se(f);
fflush(f);
assert_se(r > 0);
assert_se(r == 0);
fclose(f);
unlink(t);
puts(t);
if (r != -ENOENT) {
assert_se(r == 0);
puts(p);
if (r != -ENOENT) {
assert_se(r == 0);
puts(s);
if (r != -ENOENT) {
assert_se(r == 0);
puts(z);
assert_se(r == 0);
assert_se(f);
assert_se(f);
rewind(f);
assert_se(f);
rewind(f);
r = write_string_file("/proc/cmdline", buf, WRITE_STRING_FILE_VERIFY_ON_FAILURE|WRITE_STRING_FILE_AVOID_NEWLINE);
assert_se(write_string_file("/proc/cmdline", buf2, WRITE_STRING_FILE_VERIFY_ON_FAILURE|WRITE_STRING_FILE_AVOID_NEWLINE) == 0);
"HOME_URL=\"https://www.archlinux.org/\"\n"
"SUPPORT_URL=\"https://bbs.archlinux.org/\"\n"
"BUG_REPORT_URL=\"https://bugs.archlinux.org/\"\n",
assert_se(r == 0);
assert_se(f);
assert_se(r >= 0);
assert_se(STR_IN_SET(*k, "NAME", "ID", "PRETTY_NAME", "ANSI_COLOR", "HOME_URL", "SUPPORT_URL", "BUG_REPORT_URL"));
log_open();
test_capeff();