mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-19 22:51:48 +00:00
network: implement masking of .link, .network and .netdev files
This commit is contained in:
@@ -475,6 +475,11 @@ static int netdev_load_one(Manager *manager, const char *filename) {
|
||||
assert(manager);
|
||||
assert(filename);
|
||||
|
||||
if (null_or_empty_path(filename)) {
|
||||
log_debug("skipping empty file: %s", filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
file = fopen(filename, "re");
|
||||
if (!file) {
|
||||
if (errno == ENOENT)
|
||||
|
||||
@@ -44,6 +44,11 @@ static int network_load_one(Manager *manager, const char *filename) {
|
||||
return -errno;
|
||||
}
|
||||
|
||||
if (null_or_empty_path(filename)) {
|
||||
log_debug("skipping empty file: %s", filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
network = new0(Network, 1);
|
||||
if (!network)
|
||||
return log_oom();
|
||||
|
||||
@@ -146,6 +146,11 @@ static int load_link(link_config_ctx *ctx, const char *filename) {
|
||||
assert(ctx);
|
||||
assert(filename);
|
||||
|
||||
if (null_or_empty_path(filename)) {
|
||||
log_debug("skipping empty file: %s", filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
file = fopen(filename, "re");
|
||||
if (!file) {
|
||||
if (errno == ENOENT)
|
||||
|
||||
Reference in New Issue
Block a user