tmpfiles: Move relabelling before any other calls for device nodes
Device nodes are normally never device_t so this type does not have many permissions. After the mknod, the device should have its label corrected before any other operations (like chmod).
This commit is contained in:
parent
2c265e13c6
commit
6f080e9c1a
@ -65,8 +65,8 @@ _b() {
|
|||||||
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
|
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
|
||||||
if [ ! -e "$path" ]; then
|
if [ ! -e "$path" ]; then
|
||||||
dryrun_or_real mknod -m $mode $path b ${arg%:*} ${arg#*:}
|
dryrun_or_real mknod -m $mode $path b ${arg%:*} ${arg#*:}
|
||||||
dryrun_or_real chown $uid:$gid $path
|
|
||||||
_restorecon "$path"
|
_restorecon "$path"
|
||||||
|
dryrun_or_real chown $uid:$gid $path
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,8 +75,8 @@ _c() {
|
|||||||
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
|
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
|
||||||
if [ ! -e "$path" ]; then
|
if [ ! -e "$path" ]; then
|
||||||
dryrun_or_real mknod -m $mode $path c ${arg%:*} ${arg#*:}
|
dryrun_or_real mknod -m $mode $path c ${arg%:*} ${arg#*:}
|
||||||
dryrun_or_real chown $uid:$gid $path
|
|
||||||
_restorecon "$path"
|
_restorecon "$path"
|
||||||
|
dryrun_or_real chown $uid:$gid $path
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user