support for owner/group permissions in tmpfiles
This commit is contained in:
parent
22bb388fdb
commit
87de61f78c
9
rc.in
9
rc.in
|
@ -31,13 +31,14 @@ rc.motd() {
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.tmpfiles() {
|
rc.tmpfiles() {
|
||||||
printf '%s\n' "${cfg_tmpdirs[@]}" | while IFS=':' read dir perm; do
|
printf '%s\n' "${cfg_tmpdirs[@]}" | while IFS=':' read dir perm own grp; do
|
||||||
mkdir -v -m "${perm:-755}" "$dir"
|
install -v -d -m "${perm:-755}" -o "${own:-root}" -g "${grp:-root}" "$dir" 2>/dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
printf '%s\n' "${cfg_tmpfiles[@]}" | while IFS=':' read file perm; do
|
printf '%s\n' "${cfg_tmpfiles[@]}" | while IFS=':' read file perm own grp; do
|
||||||
> "$file"
|
> "$file"
|
||||||
chmod -v "${perm:-644}" "$file"
|
chmod -c "${perm:-644}" "$file"
|
||||||
|
chown -c "${own:-root}:${grp:-root}" "$file"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user