fileio: port write_string_file() to LabelOps, and thus add WRITE_STRING_FILE_LABEL flag
Given that we have the LabelOps abstraction these days, we can teach write_string_file() to use it, which means we can get rid of fileio-label.[ch] as a separate concept. (The only reason that fileio-label.[ch] exists independently of fileio.[ch] was that the former linekd to libselinux potentially, and thus had to be in src/shared/ while the other always was in src/basic/. But the LabelOps vtable provides us with a nice work-around)
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
#include "constants.h"
|
||||
#include "daemon-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio-label.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "hashmap.h"
|
||||
@@ -395,7 +394,7 @@ static int context_write_data_local_rtc(Context *c) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return write_string_file_atomic_label("/etc/adjtime", w);
|
||||
return write_string_file("/etc/adjtime", w, WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC|WRITE_STRING_FILE_LABEL);
|
||||
}
|
||||
|
||||
static int context_update_ntp_status(Context *c, sd_bus *bus, sd_bus_message *m) {
|
||||
|
||||
Reference in New Issue
Block a user