ensure-dirs: Fix a bug with queue/archive permissions
authorRené Nussbaumer <rn@google.com>
Thu, 18 Aug 2011 11:17:15 +0000 (13:17 +0200)
committerRené Nussbaumer <rn@google.com>
Fri, 19 Aug 2011 11:36:38 +0000 (13:36 +0200)
While it sets the permission on all files in queue/archive accordingly
it doesn't do so for the created archive directories. This patch fixes
this problem.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

daemons/ensure-dirs.in

index ff6d744..02ebb87 100644 (file)
@@ -101,6 +101,11 @@ _ensure_datadir() {
     local queue_owner="$(_fileset_owner masterd)"
     local ssconf_owner="$(_fileset_owner noded)"
 
+    find ${DATADIR}/queue/archive -type d | \
+    while read path; do
+      _ensure_dir ${path} 0700 "$queue_owner"
+    done
+
     _gather_files ${DATADIR}/queue 0600 @GNTMASTERUSER@ @GNTMASTERDGROUP@ | \
     while read path; do
       _ensure_file "$path" 0600 "$queue_owner"