init: Force 0755 permissions of /var/cache [Merge to M52]

/var/cache may already exist with wrong permissions  before mkdir is
executed, which will be ignored, and the permissions won't be set correctly.
This leads to extensions and apps not being synced correctly on certain devices.

This CL enforces the correct permissions of /var/cache.

BUG=chromium:617823
TEST=cros_workon_make
TEST=manually by setting /var/cache to 0700, restarting device, adding a new account,
and seeing apps and extensions being synced successfully.

Change-Id: I3e8dd51ab8ab03243ab45a1c74034de5847e5968
Reviewed-on: https://chromium-review.googlesource.com/351963
Commit-Ready: Ahmed Fakhry <afakhry@chromium.org>
Tested-by: Ahmed Fakhry <afakhry@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
(cherry picked from commit e9a281eb8aae85445304ce06c1f0384cb1e5d45c)
Reviewed-on: https://chromium-review.googlesource.com/355791
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Trybot-Ready: Ahmed Fakhry <afakhry@chromium.org>
diff --git a/init/chromeos_startup b/init/chromeos_startup
index 25ee2b5..1b43655 100755
--- a/init/chromeos_startup
+++ b/init/chromeos_startup
@@ -363,6 +363,9 @@
 # rsyslog needs to be able to create new logfiles, but not delete other logs
 chgrp syslog /var/log
 chmod 1775 /var/log
+# /var/cache, /var/db, and /var/empty may already exist with wrong permissions.
+# Force the correct ones.
+chmod 0755 /var/cache /var/db /var/empty
 
 mount -n -t tmpfs -o nodev,noexec,nosuid media /media