From e396c8839878a2d47d5ce36c0461d6707bc132ec Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Sat, 14 Apr 2012 15:57:15 -0500 Subject: [PATCH] script/gentree: permissions on /conf/{base,default}/* will affect permissions when mountpoints are created at runtime; make sure they're as expected --- script/gentree | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/script/gentree b/script/gentree index e409eb6..2f96b57 100755 --- a/script/gentree +++ b/script/gentree @@ -306,16 +306,20 @@ do_imgconf() { chk mkdir -p "${sconf}/base" chk mkdir -p "${sconf}/default" + # This will screw up permissions when applied to /conf/{base,default}/* + # so do it before their creation + chk chown -R :operator "${sconf}" + ( find "${sconf}" -print0 | xargs -0 chmod o-rwx ) || chk + # Create packdirs for each for pack in "${cnfd}"/*.md_size do pack="$(basename "${pack%%.md_size}")" - chk mkdir -p "${sconf}/base/${pack}" - chk mkdir -p "${sconf}/default/${pack}" + chk mkdir -p "${sconf}/base/${pack}" "${sconf}/default/${pack}" + chk chown root:wheel "${sconf}/base/${pack}" "${sconf}/default/${pack}" + chk chmod 755 "${sconf}/base/${pack}" "${sconf}/default/${pack}" ( cat "${cnfd}/${pack}.md_size" > "${sconf}/base/${pack}/md_size" ) || chk done - chk chown -R :operator "${sconf}" - ( find "${sconf}" -print0 | xargs -0 chmod o-rwx ) || chk } do_imgetc() { -- 2.42.0