Move LOCKS_DIR out of NFS file directory.

This changes the default LOCKS_DIR, for file locking, from the
role account's NFS directory to /google/data.  It also updates the
file masks to meet the requirements of the new directory.

BUG=18379210
TEST=Tested from my home account.

Change-Id: I925c9adf589b2c46fc03207ef87ea69fb14ff395
Reviewed-on: https://chrome-internal-review.googlesource.com/234200
Commit-Ready: Caroline Tice <cmtice@google.com>
Tested-by: Caroline Tice <cmtice@google.com>
Reviewed-by: Caroline Tice <cmtice@google.com>
diff --git a/file_lock_machine.py b/file_lock_machine.py
index 1496a2c..f67a9bb 100755
--- a/file_lock_machine.py
+++ b/file_lock_machine.py
@@ -21,13 +21,17 @@
 
 LOCK_SUFFIX = "_check_lock_liveness"
 
+# The locks file directory REQUIRES that 'group' only has read/write
+# privileges and 'world' has no privileges.  So the mask must be
+# '0027': 0777 - 0027 = 0750.
+LOCK_MASK = 0027
 
 def FileCheckName(name):
   return name + LOCK_SUFFIX
 
 
 def OpenLiveCheck(file_name):
-  with FileCreationMask(0000):
+  with FileCreationMask(LOCK_MASK):
     fd = open(file_name, "a+w")
   try:
     fcntl.lockf(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
@@ -127,7 +131,7 @@
     logger.GetLogger().LogOutput("\n%s" % cls.AsString(file_locks))
 
   def __enter__(self):
-    with FileCreationMask(0000):
+    with FileCreationMask(LOCK_MASK):
       try:
         self._file = open(self._filepath, "a+")
         self._file.seek(0, os.SEEK_SET)
@@ -244,7 +248,7 @@
 
 
 class Machine(object):
-  LOCKS_DIR = "/home/mobiletc-prebuild/locks"
+  LOCKS_DIR = "/google/data/rw/users/mo/mobiletc-prebuild/locks"
 
   def __init__(self, name, locks_dir=LOCKS_DIR, auto=True):
     self._name = name