]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/env-file-label.c
locale,firstboot: add headers to vconsole.conf
[thirdparty/systemd.git] / src / shared / env-file-label.c
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2
3 #include <sys/stat.h>
4
5 #include "env-file-label.h"
6 #include "env-file.h"
7 #include "selinux-util.h"
8
9 int write_env_file_label(int dir_fd, const char *fname, char **headers, char **l) {
10 int r;
11
12 r = mac_selinux_create_file_prepare(fname, S_IFREG);
13 if (r < 0)
14 return r;
15
16 r = write_env_file(dir_fd, fname, headers, l);
17
18 mac_selinux_create_file_clear();
19
20 return r;
21 }
22
23 int write_vconsole_conf_label(char **l) {
24 int r;
25
26 r = mac_selinux_create_file_prepare("/etc/vconsole.conf", S_IFREG);
27 if (r < 0)
28 return r;
29
30 r = write_vconsole_conf(AT_FDCWD, "/etc/vconsole.conf", l);
31
32 mac_selinux_create_file_clear();
33
34 return r;
35 }