Skip to content

Commit

Permalink
Merge pull request ome#208 from manics/openmicroscopy-5884
Browse files Browse the repository at this point in the history
Ignore owner when checking omero.data.dir is accessible
  • Loading branch information
joshmoore committed May 1, 2020
2 parents a8904e3 + e293ab3 commit d1c6071
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/omero/plugins/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import re
import os
import sys
import stat
import platform
import datetime
import time
Expand Down Expand Up @@ -1593,18 +1592,9 @@ def can_access(self, filepath, mask=os.R_OK | os.W_OK):
self.ctx.die(8, "FATAL: OMERO directory does not exist: %s"
% pathobj)

owner = os.stat(filepath)[stat.ST_UID]
if owner == 0:
msg = ""
msg += "FATAL: OMERO directory which needs to be writeable"\
" belongs to root: %s\n" % filepath
msg += "Please use \"chown -R NEWUSER %s\" and run as then"\
" run %s as NEWUSER" % (filepath, sys.argv[0])
self.ctx.die(9, msg)
else:
if not os.access(filepath, mask):
self.ctx.die(10, "FATAL: Cannot access %s, a required"
" file/directory for OMERO" % filepath)
if not os.access(filepath, mask):
self.ctx.die(10, "FATAL: Cannot access %s, a required"
" file/directory for OMERO" % filepath)

def check_access(self, mask=os.R_OK | os.W_OK, config=None):
"""Check that 'var' is accessible by the current user."""
Expand Down

0 comments on commit d1c6071

Please sign in to comment.