Compare commits

...

7 Commits

Author SHA1 Message Date
Yu Watanabe 5553041a62
Merge pull request #16435 from gaoyi1988/master
fix multi matches when use "||"
2020-07-12 21:46:22 +09:00
Yu Watanabe 6b949d2605 NEWS: mention source mode for MACVLAN or MACVTAP 2020-07-12 11:57:53 +02:00
Zbigniew Jędrzejewski-Szmek ddcdcac519
Merge pull request #16432 from cgzones/selinux_err_fix
SELlinux followup error/logging fixes
2020-07-12 11:55:44 +02:00
gaoyi 0d3a8bc7eb test: add test case for multi matches when use "||"
Signed-off-by: gaoyi <ymuemc@163.com>
2020-07-12 03:27:45 -04:00
gaoyi 1e67a9c2cd udev: specify the end of value
NULSTR_FOREACH may read the illegal match

Signed-off-by: gaoyi <ymuemc@163.com>
2020-07-12 03:24:42 -04:00
Christian Göttsche f2df56bfea namespace: unify logging in mount_tmpfs
Fixes: abad72be4d
Follow up: #16426
2020-07-11 21:25:39 +02:00
Christian Göttsche db06c162e8 shared: fix error handling in make_inaccessible_nodes
_label wrappers return -errno on failure instead of returning -1 and
setting global errno.

Fixes: 8d9cbd809d
Follow up: #16426
2020-07-11 21:25:39 +02:00
5 changed files with 22 additions and 3 deletions

3
NEWS
View File

@ -217,6 +217,9 @@ CHANGES WITH 246:
Description"). Support for "MUD" URLs was also added to the LLDP
stack, configurable in the [LLDP] section in .network files.
* The Mode= settings in [MACVLAN] and [MACVTAP] now support 'source'
mode. Also, the sections now support a new setting SourceMACAddress=.
* systemd-networkd's .netdev files now support a new setting
VLANProtocol= in the [Bridge] section that allows configuration of
the VLAN protocol to use.

View File

@ -876,7 +876,7 @@ static int mount_tmpfs(const MountEntry *m) {
r = label_fix_container(entry_path, source_path, 0);
if (r < 0)
return log_error_errno(r, "Failed to fix label of '%s' as '%s': %m", entry_path, source_path);
return log_debug_errno(r, "Failed to fix label of '%s' as '%s': %m", entry_path, source_path);
return 1;
}

View File

@ -107,8 +107,8 @@ int make_inaccessible_nodes(
else
r = mknod_label(path, table[i].mode, makedev(0, 0));
if (r < 0) {
if (errno != EEXIST)
log_debug_errno(errno, "Failed to create '%s', ignoring: %m", path);
if (r != -EEXIST)
log_debug_errno(r, "Failed to create '%s', ignoring: %m", path);
continue;
}

View File

@ -452,6 +452,11 @@ static int rule_line_add_token(UdevRuleLine *rule_line, UdevRuleTokenType type,
}
}
*b = '\0';
/* Make sure the value is end, so NULSTR_FOREACH can read correct match */
if (b < a)
b[1] = '\0';
if (bar)
empty = true;

View File

@ -1322,6 +1322,17 @@ EOF
KERNEL=="sda", TAG=""
TAGS=="foo|", SYMLINK+="found"
TAGS=="aaa|bbb", SYMLINK+="bad"
EOF
},
{
desc => "test multi matches 11",
devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
exp_name => "found",
not_exp_name => "bad",
rules => <<EOF
KERNEL=="sda", TAG="c"
TAGS=="foo||bar||c", SYMLINK+="found"
TAGS=="aaa||bbb||ccc", SYMLINK+="bad"
EOF
},
{