aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2013-07-23 17:58:42 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2013-07-23 17:58:42 -0500
commit19579687fd6d4fb80ffbd83c010fab6777c3120c (patch)
tree23849cb1e22d46c2f210c6f3a5d19d1b5d6281e0 /sh
parentc18d623dc02728e39376239fedbee8e76a87208e (diff)
tmpfiles: make b and c commands set ownership and permissions
The b and c commands in tmpfiles.sh were not setting ownership and permissions for the device nodes.
Diffstat (limited to 'sh')
-rwxr-xr-xsh/tmpfiles.sh.in8
1 files changed, 6 insertions, 2 deletions
diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in
index cb9ecebe..59fdcd76 100755
--- a/sh/tmpfiles.sh.in
+++ b/sh/tmpfiles.sh.in
@@ -43,13 +43,17 @@ relabel() {
_b() {
# Create a block device node if it doesn't exist yet
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
- [ ! -e "$path" ] && dryrun_or_real mknod $path b ${arg%:*} ${arg#*:}
+ [ ! -e "$path" ] && \
+ dryrun_or_real mknod -m $mode $path b ${arg%:*} ${arg#*:} && \
+ dryrun_or_real chown $uid:$gid $path
}
_c() {
# Create a character device node if it doesn't exist yet
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
- [ ! -e "$path" ] && dryrun_or_real mknod $path c ${arg%:*} ${arg#*:}
+ [ ! -e "$path" ] && \
+ dryrun_or_real mknod -m $mode $path c ${arg%:*} ${arg#*:} && \
+ dryrun_or_real chown $uid:$gid $path
}