| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
|
| 3 |
#include <sys/stat.h> |
| 4 |
|
| 5 |
#include "env-file.h" |
| 6 |
#include "env-file-label.h" |
| 7 |
#include "locale-setup.h" |
| 8 |
#include "selinux-util.h" |
| 9 |
|
| 10 |
int write_env_file_label(int dir_fd, const char *fname, char **headers, char **l) { |
| 11 |
int r; |
| 12 |
|
| 13 |
r = mac_selinux_create_file_prepare(fname, S_IFREG); |
| 14 |
if (r < 0) |
| 15 |
return r; |
| 16 |
|
| 17 |
r = write_env_file(dir_fd, fname, headers, l); |
| 18 |
|
| 19 |
mac_selinux_create_file_clear(); |
| 20 |
|
| 21 |
return r; |
| 22 |
} |
| 23 |
|
| 24 |
int write_vconsole_conf_label(char **l) { |
| 25 |
int r; |
| 26 |
|
| 27 |
r = mac_selinux_create_file_prepare(etc_vconsole_conf(), S_IFREG); |
| 28 |
if (r < 0) |
| 29 |
return r; |
| 30 |
|
| 31 |
r = write_vconsole_conf(AT_FDCWD, etc_vconsole_conf(), l); |
| 32 |
|
| 33 |
mac_selinux_create_file_clear(); |
| 34 |
|
| 35 |
return r; |
| 36 |
} |